Flow123d  master-46b78a5
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
FieldAlgorithmBase< spacedim, Value > Class Template Reference

#include <field_algo_base.hh>

Inheritance diagram for FieldAlgorithmBase< spacedim, Value >:
Inheritance graph
[legend]
Collaboration diagram for FieldAlgorithmBase< spacedim, Value >:
Collaboration graph
[legend]

Public Types

typedef Space< spacedim >::Point Point
 

Public Member Functions

 TYPEDEF_ERR_INFO (EI_Field, std::string)
 
 DECLARE_EXCEPTION (ExcInputInitUnsupported,<< "The field "<< EI_Field::qval<< " do not support initialization from input.\n")
 
 FieldAlgorithmBase (unsigned int n_comp=0)
 
virtual void init_from_input (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
 
virtual bool set_time (const TimeStep &time)
 
virtual void set_mesh (const Mesh *mesh)
 
void set_component_idx (unsigned int idx)
 
unsigned int n_comp () const
 
FieldResult field_result () const
 
virtual double next_change_time ()
 
virtual void cache_reinit (const ElementCacheMap &cache_map)
 Allows reinit data members or structures in descendants during reinit of FieldValueCache of 'parental' Field<> More...
 
virtual void cache_update (FieldValueCache< typename Value::element_type > &data_cache, ElementCacheMap &cache_map, unsigned int region_patch_idx)
 
virtual void set_native_dh (std::shared_ptr< DOFHandlerMultiDim >)
 
bool is_constant_in_space () const
 
virtual std::vector< const FieldCommon * > set_dependency (FMT_UNUSED FieldSet &field_set)
 
virtual ~FieldAlgorithmBase ()
 

Static Public Member Functions

static std::string template_name ()
 
static Input::Type::Abstractget_input_type ()
 
static const Input::Type::Instanceget_input_type_instance (Input::Type::Selection value_selection=Input::Type::Selection())
 
static const Input::Type::Recordget_field_algo_common_keys ()
 
static std::shared_ptr< FieldAlgorithmBase< spacedim, Value > > function_factory (const Input::AbstractRecord &rec, const struct FieldAlgoBaseInitData &init_data)
 

Static Public Attributes

static const unsigned int spacedim_ =spacedim
 
static constexpr bool is_enum_valued = std::is_same<typename Value::element_type, FieldEnum>::value
 

Protected Member Functions

void init_unit_conversion_coefficient (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
 Init value of unit_conversion_coefficient_ from input. More...
 

Protected Attributes

TimeStep time_
 Actual time level; initial value is -infinity. More...
 
Value value_
 Last value, prevents passing large values (vectors) by value. More...
 
Value::return_type r_value_
 
FieldResult field_result_
 Indicator of particular values (zero, one) constant over space. More...
 
unsigned int component_idx_
 Specify if the field is part of a MultiField and which component it is. More...
 
double unit_conversion_coefficient_
 Coeficient of conversion of user-defined unit. More...
 
bool is_constant_in_space_
 Flag detects that field is only dependent on time. More...
 

Detailed Description

template<int spacedim, class Value>
class FieldAlgorithmBase< spacedim, Value >

Base class for space-time function classes.

Definition at line 105 of file field_algo_base.hh.

Member Typedef Documentation

◆ Point

template<int spacedim, class Value >
typedef Space<spacedim>::Point FieldAlgorithmBase< spacedim, Value >::Point

Definition at line 108 of file field_algo_base.hh.

Constructor & Destructor Documentation

◆ FieldAlgorithmBase()

template<int spacedim, class Value >
FieldAlgorithmBase< spacedim, Value >::FieldAlgorithmBase ( unsigned int  n_comp = 0)

Kind of default constructor , with possible setting of the initial time. Fields that returns variable size vectors accepts number of components n_comp.

Definition at line 47 of file field_algo_base.impl.hh.

◆ ~FieldAlgorithmBase()

template<int spacedim, class Value >
virtual FieldAlgorithmBase< spacedim, Value >::~FieldAlgorithmBase ( )
inlinevirtual

Virtual destructor.

Definition at line 231 of file field_algo_base.hh.

Member Function Documentation

◆ cache_reinit()

template<int spacedim, class Value >
void FieldAlgorithmBase< spacedim, Value >::cache_reinit ( const ElementCacheMap cache_map)
virtual

Allows reinit data members or structures in descendants during reinit of FieldValueCache of 'parental' Field<>

Reimplemented in FieldPython< spacedim, Value >, FieldFormula< spacedim, Value >, and FieldFE< spacedim, Value >.

Definition at line 149 of file field_algo_base.impl.hh.

◆ cache_update()

template<int spacedim, class Value >
void FieldAlgorithmBase< spacedim, Value >::cache_update ( FieldValueCache< typename Value::element_type > &  data_cache,
ElementCacheMap cache_map,
unsigned int  region_patch_idx 
)
virtual

◆ DECLARE_EXCEPTION()

template<int spacedim, class Value >
FieldAlgorithmBase< spacedim, Value >::DECLARE_EXCEPTION ( ExcInputInitUnsupported  ,
<< "The field "<< EI_Field::qval<< " do not support initialization from input.\n"   
)

◆ field_result()

template<int spacedim, class Value >
FieldResult FieldAlgorithmBase< spacedim, Value >::field_result ( ) const
inline

Special field values spatially constant. Could allow optimization of tensor multiplication and tensor or vector addition. field_result_ should be set in constructor and in set_time method of particular Field implementation.

Definition at line 191 of file field_algo_base.hh.

◆ function_factory()

template<int spacedim, class Value >
shared_ptr< FieldAlgorithmBase< spacedim, Value > > FieldAlgorithmBase< spacedim, Value >::function_factory ( const Input::AbstractRecord rec,
const struct FieldAlgoBaseInitData init_data 
)
static

This static method gets accessor to abstract record with function input, dispatch to correct constructor and initialize appropriate function object from the input. Returns shared pointer to FunctionBase<>.

Definition at line 101 of file field_algo_base.impl.hh.

Here is the caller graph for this function:

◆ get_field_algo_common_keys()

template<int spacedim, class Value >
const Input::Type::Record & FieldAlgorithmBase< spacedim, Value >::get_field_algo_common_keys
static

Returns auxiliary record with keys common to all field algorithms.

Definition at line 91 of file field_algo_base.impl.hh.

◆ get_input_type()

template<int spacedim, class Value >
Input::Type::Abstract & FieldAlgorithmBase< spacedim, Value >::get_input_type
static

Returns whole tree of input types for FieldBase with all descendants based on element input type (namely for FieldConstant) given by element_input_type pointer.

Definition at line 66 of file field_algo_base.impl.hh.

◆ get_input_type_instance()

template<int spacedim, class Value >
const Input::Type::Instance & FieldAlgorithmBase< spacedim, Value >::get_input_type_instance ( Input::Type::Selection  value_selection = Input::Type::Selection())
static

Returns parameterized whole tree of input types for FieldBase with all descendants based on element input type (namely for FieldConstant) given by element_input_type pointer.

Definition at line 78 of file field_algo_base.impl.hh.

◆ init_from_input()

template<int spacedim, class Value >
void FieldAlgorithmBase< spacedim, Value >::init_from_input ( const Input::Record rec,
const struct FieldAlgoBaseInitData init_data 
)
virtual

Function can provide way to initialize itself from the input data.

TODO: make protected, should be called through function factory

Reimplemented in FieldTimeFunction< spacedim, Value >, FieldConstant< spacedim, Value >, FieldPython< spacedim, Value >, FieldFormula< spacedim, Value >, and FieldFE< spacedim, Value >.

Definition at line 112 of file field_algo_base.impl.hh.

Here is the caller graph for this function:

◆ init_unit_conversion_coefficient()

template<int spacedim, class Value >
void FieldAlgorithmBase< spacedim, Value >::init_unit_conversion_coefficient ( const Input::Record rec,
const struct FieldAlgoBaseInitData init_data 
)
protected

Init value of unit_conversion_coefficient_ from input.

Definition at line 154 of file field_algo_base.impl.hh.

Here is the caller graph for this function:

◆ is_constant_in_space()

template<int spacedim, class Value >
bool FieldAlgorithmBase< spacedim, Value >::is_constant_in_space ( ) const
inline

Return true if field is only dependent on time.

Definition at line 217 of file field_algo_base.hh.

◆ n_comp()

template<int spacedim, class Value >
unsigned int FieldAlgorithmBase< spacedim, Value >::n_comp

Returns number of rows, i.e. number of components for variable size vectors. For values of fixed size returns zero.

Definition at line 133 of file field_algo_base.impl.hh.

Here is the caller graph for this function:

◆ next_change_time()

template<int spacedim, class Value >
virtual double FieldAlgorithmBase< spacedim, Value >::next_change_time ( )
inlinevirtual

Method for getting some information about next time where the function change its character. Used to add appropriate TimeMarks. TODO: think what kind of information we may need, is the next time value enough?

Definition at line 199 of file field_algo_base.hh.

◆ set_component_idx()

template<int spacedim, class Value >
void FieldAlgorithmBase< spacedim, Value >::set_component_idx ( unsigned int  idx)
inline

Sets component_idx_

Definition at line 179 of file field_algo_base.hh.

◆ set_dependency()

template<int spacedim, class Value >
virtual std::vector<const FieldCommon *> FieldAlgorithmBase< spacedim, Value >::set_dependency ( FMT_UNUSED FieldSet field_set)
inlinevirtual

Set reference of FieldSet to FieldFormula instance.

Reimplemented in FieldModel< spacedim, Value, Fn, InputFields >.

Definition at line 224 of file field_algo_base.hh.

◆ set_mesh()

template<int spacedim, class Value >
void FieldAlgorithmBase< spacedim, Value >::set_mesh ( const Mesh mesh)
virtual

Is used only by some Field implementations, but can be used to check validity of incoming ElementAccessor in value methods.

Reimplemented in FieldFormula< spacedim, Value >, and FieldFE< spacedim, Value >.

Definition at line 127 of file field_algo_base.impl.hh.

◆ set_native_dh()

template<int spacedim, class Value >
virtual void FieldAlgorithmBase< spacedim, Value >::set_native_dh ( std::shared_ptr< DOFHandlerMultiDim )
inlinevirtual

Postponed setter of Dof handler for FieldFE. For other types of fields has no effect.

Definition at line 211 of file field_algo_base.hh.

◆ set_time()

template<int spacedim, class Value >
bool FieldAlgorithmBase< spacedim, Value >::set_time ( const TimeStep time)
virtual

Set new time value. Some Fields may and some may not implement time dependent values and possibly various types of interpolation. There can not be unified approach to interpolation (at least not on this abstraction level) since some fields (FieldFormula, FieldPython) provides naturally time dependent functions other fields like (FieldConstant, ...), however, can be equipped by various time interpolation schemes. In future, we obviously need time interpolation of higher order so that we can use ODE integrators of higher order.

The method returns true if the value of the field has changed in the new time step.

Reimplemented in FieldTimeFunction< spacedim, Value >, FieldFormula< spacedim, Value >, and FieldFE< spacedim, Value >.

Definition at line 119 of file field_algo_base.impl.hh.

◆ template_name()

template<int spacedim, class Value >
string FieldAlgorithmBase< spacedim, Value >::template_name
static

Returns template parameters as string in order to distinguish name of Abstracts for initialization of different instances of the FieldBase template.

Definition at line 59 of file field_algo_base.impl.hh.

◆ TYPEDEF_ERR_INFO()

template<int spacedim, class Value >
FieldAlgorithmBase< spacedim, Value >::TYPEDEF_ERR_INFO ( EI_Field  ,
std::string   
)

Member Data Documentation

◆ component_idx_

template<int spacedim, class Value >
unsigned int FieldAlgorithmBase< spacedim, Value >::component_idx_
protected

Specify if the field is part of a MultiField and which component it is.

Definition at line 245 of file field_algo_base.hh.

◆ field_result_

template<int spacedim, class Value >
FieldResult FieldAlgorithmBase< spacedim, Value >::field_result_
protected

Indicator of particular values (zero, one) constant over space.

Definition at line 243 of file field_algo_base.hh.

◆ is_constant_in_space_

template<int spacedim, class Value >
bool FieldAlgorithmBase< spacedim, Value >::is_constant_in_space_
protected

Flag detects that field is only dependent on time.

Definition at line 249 of file field_algo_base.hh.

◆ is_enum_valued

template<int spacedim, class Value >
constexpr bool FieldAlgorithmBase< spacedim, Value >::is_enum_valued = std::is_same<typename Value::element_type, FieldEnum>::value
staticconstexpr

Definition at line 110 of file field_algo_base.hh.

◆ r_value_

template<int spacedim, class Value >
Value::return_type FieldAlgorithmBase< spacedim, Value >::r_value_
protected

Definition at line 241 of file field_algo_base.hh.

◆ spacedim_

template<int spacedim, class Value >
const unsigned int FieldAlgorithmBase< spacedim, Value >::spacedim_ =spacedim
static

Definition at line 109 of file field_algo_base.hh.

◆ time_

template<int spacedim, class Value >
TimeStep FieldAlgorithmBase< spacedim, Value >::time_
protected

Actual time level; initial value is -infinity.

Definition at line 238 of file field_algo_base.hh.

◆ unit_conversion_coefficient_

template<int spacedim, class Value >
double FieldAlgorithmBase< spacedim, Value >::unit_conversion_coefficient_
protected

Coeficient of conversion of user-defined unit.

Definition at line 247 of file field_algo_base.hh.

◆ value_

template<int spacedim, class Value >
Value FieldAlgorithmBase< spacedim, Value >::value_
protected

Last value, prevents passing large values (vectors) by value.

Definition at line 240 of file field_algo_base.hh.


The documentation for this class was generated from the following files: