Flow123d  JS_before_hm-1819-gb167879ec
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Attributes | List of all members
FieldConstant< spacedim, Value > Class Template Reference

#include <field_constant.hh>

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

Public Types

typedef FieldAlgorithmBase< spacedim, Value >::Point Point
 
typedef FieldAlgorithmBase< spacedim, ValueFactoryBaseType
 
- Public Types inherited from FieldAlgorithmBase< spacedim, Value >
typedef Space< spacedim >::Point Point
 

Public Member Functions

 FieldConstant (unsigned int n_comp=0)
 
FieldConstant< spacedim, Value > & set_value (const typename Value::return_type &val)
 
virtual void init_from_input (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data) override
 
virtual const Value::return_type & value (const Point &p, const ElementAccessor< spacedim > &elm) override
 
virtual void value_list (const Armor::array &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) override
 
void cache_update (FieldValueCache< typename Value::element_type > &data_cache, ElementCacheMap &cache_map, unsigned int region_patch_idx) override
 
virtual ~FieldConstant ()
 
- Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
 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 bool set_time (const TimeStep &time)
 
virtual void set_mesh (const Mesh *mesh, bool boundary_domain)
 
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 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 const Input::Type::Recordget_input_type ()
 Implementation. More...
 
- Static Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
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)
 

Protected Member Functions

void check_field_limits (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
 Compare field value with given minimal and maximal limits. More...
 
- Protected Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
void init_unit_conversion_coefficient (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
 Init value of unit_conversion_coefficient_ from input. More...
 

Static Private Attributes

static const int registrar
 Registrar of class to factory. More...
 

Additional Inherited Members

- Static Public Attributes inherited from FieldAlgorithmBase< spacedim, Value >
static const unsigned int spacedim_ =spacedim
 
static constexpr bool is_enum_valued = std::is_same<typename Value::element_type, FieldEnum>::value
 
- Protected Attributes inherited from FieldAlgorithmBase< spacedim, Value >
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 FieldConstant< spacedim, Value >

Class representing spatially constant fields.

Definition at line 43 of file field_constant.hh.

Member Typedef Documentation

◆ FactoryBaseType

template<int spacedim, class Value >
typedef FieldAlgorithmBase<spacedim, Value> FieldConstant< spacedim, Value >::FactoryBaseType

Definition at line 47 of file field_constant.hh.

◆ Point

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

Definition at line 46 of file field_constant.hh.

Constructor & Destructor Documentation

◆ FieldConstant()

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

Default constructor, optionally we need number of components n_comp in the case of Vector valued fields.

Definition at line 58 of file field_constant.cc.

◆ ~FieldConstant()

template<int spacedim, class Value >
FieldConstant< spacedim, Value >::~FieldConstant
virtual

Definition at line 175 of file field_constant.cc.

Member Function Documentation

◆ cache_update()

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

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 147 of file field_constant.cc.

◆ check_field_limits()

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

Compare field value with given minimal and maximal limits.

Definition at line 159 of file field_constant.cc.

◆ get_input_type()

template<int spacedim, class Value >
const Input::Type::Record & FieldConstant< spacedim, Value >::get_input_type
static

Implementation.

Return Record for initialization of FieldConstant that is derived from Abstract given by a_type and the individual elements of the possible Value (vector, tensor) have Input::Type eit.

Definition at line 33 of file field_constant.cc.

◆ init_from_input()

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

This method initialize actual value of the field given from the given Input::Record rec.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Reimplemented in FieldTimeFunction< spacedim, Value >.

Definition at line 75 of file field_constant.cc.

◆ set_value()

template<int spacedim, class Value >
FieldConstant< spacedim, Value > & FieldConstant< spacedim, Value >::set_value ( const typename Value::return_type &  val)

Smart setter from the given value to return.

Definition at line 66 of file field_constant.cc.

◆ value()

template<int spacedim, class Value >
const Value::return_type & FieldConstant< spacedim, Value >::value ( const Point p,
const ElementAccessor< spacedim > &  elm 
)
overridevirtual

Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.

Implements FieldAlgorithmBase< spacedim, Value >.

Definition at line 118 of file field_constant.cc.

◆ value_list()

template<int spacedim, class Value >
void FieldConstant< spacedim, Value >::value_list ( const Armor::array point_list,
const ElementAccessor< spacedim > &  elm,
std::vector< typename Value::return_type > &  value_list 
)
overridevirtual

Returns std::vector of scalar values in several points at once.

Implements FieldAlgorithmBase< spacedim, Value >.

Definition at line 129 of file field_constant.cc.

Member Data Documentation

◆ registrar

template<int spacedim, class Value >
const int FieldConstant< spacedim, Value >::registrar
staticprivate
Initial value:
=
Input::register_class< FieldConstant<spacedim, Value>, unsigned int >("FieldConstant") +

Registrar of class to factory.

Definition at line 96 of file field_constant.hh.


The documentation for this class was generated from the following files:
FieldConstant
Definition: field_constant.hh:43