Flow123d  release_3.0.0-506-g34af125
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
FieldFE< spacedim, Value > Class Template Reference

#include <field.hh>

Inheritance diagram for FieldFE< spacedim, Value >:
Inheritance graph
[legend]
Collaboration diagram for FieldFE< 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

 FieldFE (unsigned int n_comp=0)
 
void set_fe_data (std::shared_ptr< DOFHandlerMultiDim > dh, MappingP1< 1, 3 > *map1, MappingP1< 2, 3 > *map2, MappingP1< 3, 3 > *map3, VectorSeqDouble *data)
 
void set_native_dh (std::shared_ptr< DOFHandlerMultiDim > dh) override
 
virtual Value::return_type const & value (const Point &p, const ElementAccessor< spacedim > &elm)
 
virtual void value_list (const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
 
virtual void init_from_input (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
 
bool set_time (const TimeStep &time) override
 
void set_mesh (const Mesh *mesh, bool boundary_domain) override
 
void fill_data_to_cache (ElementDataCache< double > &output_data_cache)
 
unsigned int data_size () const
 
virtual ~FieldFE ()
 Destructor. More...
 
- Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
 FieldAlgorithmBase (unsigned int n_comp=0)
 
void set_component_idx (unsigned int idx)
 
unsigned int n_comp () const
 
FieldResult field_result () const
 
virtual double next_change_time ()
 
bool is_constant_in_space () const
 
virtual ~FieldAlgorithmBase ()
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 Implementation. More...
 
static const Input::Type::Selectionget_disc_selection_input_type ()
 
- 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)
 

Private Member Functions

void make_dof_handler (const Mesh *mesh)
 Create DofHandler object. More...
 
void interpolate (ElementDataCache< double >::ComponentDataPtr data_vec)
 Interpolate data over all elements of target mesh. More...
 
void calculate_native_values (ElementDataCache< double >::ComponentDataPtr data_cache)
 Calculate native data over all elements of target mesh. More...
 
void reinit_fe_data (MappingP1< 1, 3 > *map1, MappingP1< 2, 3 > *map2, MappingP1< 3, 3 > *map3)
 Ensure data setting of methods set_fe_data and set_native_dh. More...
 

Private Attributes

std::shared_ptr< DOFHandlerMultiDimdh_
 DOF handler object. More...
 
VectorSeqDoubledata_vec_
 Store data of Field. More...
 
std::vector< LongIdxdof_indices_
 Array of indexes to data_vec_, used for get/set values. More...
 
FEValueHandler< 0, spacedim, Valuevalue_handler0_
 Value handler that allows get value of 0D elements. More...
 
FEValueHandler< 1, spacedim, Valuevalue_handler1_
 Value handler that allows get value of 1D elements. More...
 
FEValueHandler< 2, spacedim, Valuevalue_handler2_
 Value handler that allows get value of 2D elements. More...
 
FEValueHandler< 3, spacedim, Valuevalue_handler3_
 Value handler that allows get value of 3D elements. More...
 
FiniteElement< 0 > * fe0_
 
FiniteElement< 1 > * fe1_
 Same as previous, but represents 1D element. More...
 
FiniteElement< 2 > * fe2_
 Same as previous, but represents 2D element. More...
 
FiniteElement< 3 > * fe3_
 Same as previous, but represents 3D element. More...
 
FilePath reader_file_
 mesh reader file More...
 
std::string field_name_
 field name read from input More...
 
OutputTime::DiscreteSpace discretization_
 Specify section where to find the field data in input mesh file. More...
 
FieldFlag::Flags flags_
 Field flags. More...
 
double default_value_
 Default value of element if not set in mesh data file. More...
 
Input::Record in_rec_
 Accessor to Input::Record. More...
 
bool boundary_domain_
 Is set in set_mesh method. Value true means, that we accept only boundary element accessors in the value method. More...
 
bool has_compatible_mesh_
 Flag that determines if source mesh and target mesh are compatible. More...
 

Static Private Attributes

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

Friends

class VectorSeqDouble
 

Additional Inherited Members

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

Class representing fields given by finite element approximation.

Definition at line 56 of file field.hh.

Member Typedef Documentation

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

Definition at line 49 of file field_fe.hh.

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

Definition at line 48 of file field_fe.hh.

Constructor & Destructor Documentation

template<int spacedim, class Value >
FieldFE< spacedim, Value >::FieldFE ( 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 91 of file field_fe.cc.

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

Destructor.

Definition at line 458 of file field_fe.cc.

Member Function Documentation

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::calculate_native_values ( ElementDataCache< double >::ComponentDataPtr  data_cache)
private

Calculate native data over all elements of target mesh.

Definition at line 405 of file field_fe.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
unsigned int FieldFE< spacedim, Value >::data_size ( ) const
inline

Return size of vector of data stored in Field

Definition at line 451 of file field_fe.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::fill_data_to_cache ( ElementDataCache< double > &  output_data_cache)

Copy data vector to given output ElementDataCache

Definition at line 431 of file field_fe.cc.

template<int spacedim, class Value >
const Input::Type::Selection & FieldFE< spacedim, Value >::get_disc_selection_input_type ( )
static

Return Input selection for discretization type (determines the section of VTK file).

Definition at line 72 of file field_fe.cc.

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

Implementation.

Return Record for initialization of FieldFE that is derived from Abstract

Definition at line 47 of file field_fe.cc.

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

Initialization from the input interface.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 207 of file field_fe.cc.

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::interpolate ( ElementDataCache< double >::ComponentDataPtr  data_vec)
private

Interpolate data over all elements of target mesh.

Definition at line 349 of file field_fe.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::make_dof_handler ( const Mesh mesh)
private

Create DofHandler object.

Definition at line 240 of file field_fe.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::reinit_fe_data ( MappingP1< 1, 3 > *  map1,
MappingP1< 2, 3 > *  map2,
MappingP1< 3, 3 > *  map3 
)
private

Ensure data setting of methods set_fe_data and set_native_dh.

Definition at line 125 of file field_fe.cc.

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::set_fe_data ( std::shared_ptr< DOFHandlerMultiDim dh,
MappingP1< 1, 3 > *  map1,
MappingP1< 2, 3 > *  map2,
MappingP1< 3, 3 > *  map3,
VectorSeqDouble data 
)

Setter for the finite element data. The mappings are required for computation of local coordinates.

Parameters
dhDof handler.
map11D mapping.
map22D mapping.
map33D mapping.
dataVector of dof values.

Definition at line 102 of file field_fe.cc.

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::set_mesh ( const Mesh mesh,
bool  boundary_domain 
)
overridevirtual

Set target mesh.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 227 of file field_fe.cc.

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::set_native_dh ( std::shared_ptr< DOFHandlerMultiDim dh)
overridevirtual

Postponed setter of Dof handler.

Allow to set native Dof handler after set_mesh.

Parameters
dhDof handler.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 116 of file field_fe.cc.

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

Update time and possibly update data from GMSH file.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 304 of file field_fe.cc.

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

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 157 of file field_fe.cc.

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::value_list ( const std::vector< Point > &  point_list,
const ElementAccessor< spacedim > &  elm,
std::vector< typename Value::return_type > &  value_list 
)
virtual

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

Implements FieldAlgorithmBase< spacedim, Value >.

Definition at line 181 of file field_fe.cc.

Friends And Related Function Documentation

template<int spacedim, class Value >
friend class VectorSeqDouble
friend

Definition at line 203 of file field_fe.hh.

Member Data Documentation

template<int spacedim, class Value >
bool FieldFE< spacedim, Value >::boundary_domain_
private

Is set in set_mesh method. Value true means, that we accept only boundary element accessors in the value method.

Definition at line 195 of file field_fe.hh.

template<int spacedim, class Value >
VectorSeqDouble* FieldFE< spacedim, Value >::data_vec_
private

Store data of Field.

Definition at line 150 of file field_fe.hh.

template<int spacedim, class Value >
double FieldFE< spacedim, Value >::default_value_
private

Default value of element if not set in mesh data file.

Definition at line 189 of file field_fe.hh.

template<int spacedim, class Value >
std::shared_ptr<DOFHandlerMultiDim> FieldFE< spacedim, Value >::dh_
private

DOF handler object.

Definition at line 148 of file field_fe.hh.

template<int spacedim, class Value >
OutputTime::DiscreteSpace FieldFE< spacedim, Value >::discretization_
private

Specify section where to find the field data in input mesh file.

Definition at line 183 of file field_fe.hh.

template<int spacedim, class Value >
std::vector<LongIdx> FieldFE< spacedim, Value >::dof_indices_
private

Array of indexes to data_vec_, used for get/set values.

Definition at line 152 of file field_fe.hh.

template<int spacedim, class Value >
FiniteElement<0>* FieldFE< spacedim, Value >::fe0_
private

Used in DOFHandler::distribute_dofs method. Represents 0D element.

For correct functionality must be created proper descendant of FiniteElement class.

Definition at line 168 of file field_fe.hh.

template<int spacedim, class Value >
FiniteElement<1>* FieldFE< spacedim, Value >::fe1_
private

Same as previous, but represents 1D element.

Definition at line 170 of file field_fe.hh.

template<int spacedim, class Value >
FiniteElement<2>* FieldFE< spacedim, Value >::fe2_
private

Same as previous, but represents 2D element.

Definition at line 172 of file field_fe.hh.

template<int spacedim, class Value >
FiniteElement<3>* FieldFE< spacedim, Value >::fe3_
private

Same as previous, but represents 3D element.

Definition at line 174 of file field_fe.hh.

template<int spacedim, class Value >
std::string FieldFE< spacedim, Value >::field_name_
private

field name read from input

Definition at line 180 of file field_fe.hh.

template<int spacedim, class Value >
FieldFlag::Flags FieldFE< spacedim, Value >::flags_
private

Field flags.

Definition at line 186 of file field_fe.hh.

template<int spacedim, class Value >
bool FieldFE< spacedim, Value >::has_compatible_mesh_
private

Flag that determines if source mesh and target mesh are compatible.

Definition at line 198 of file field_fe.hh.

template<int spacedim, class Value >
Input::Record FieldFE< spacedim, Value >::in_rec_
private

Accessor to Input::Record.

Definition at line 192 of file field_fe.hh.

template<int spacedim, class Value >
FilePath FieldFE< spacedim, Value >::reader_file_
private

mesh reader file

Definition at line 177 of file field_fe.hh.

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

Registrar of class to factory.

Definition at line 201 of file field_fe.hh.

template<int spacedim, class Value >
FEValueHandler<0, spacedim, Value> FieldFE< spacedim, Value >::value_handler0_
private

Value handler that allows get value of 0D elements.

Definition at line 155 of file field_fe.hh.

template<int spacedim, class Value >
FEValueHandler<1, spacedim, Value> FieldFE< spacedim, Value >::value_handler1_
private

Value handler that allows get value of 1D elements.

Definition at line 157 of file field_fe.hh.

template<int spacedim, class Value >
FEValueHandler<2, spacedim, Value> FieldFE< spacedim, Value >::value_handler2_
private

Value handler that allows get value of 2D elements.

Definition at line 159 of file field_fe.hh.

template<int spacedim, class Value >
FEValueHandler<3, spacedim, Value> FieldFE< spacedim, Value >::value_handler3_
private

Value handler that allows get value of 3D elements.

Definition at line 161 of file field_fe.hh.


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