Flow123d  master-f44eb46
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
FieldFE< spacedim, Value > Class Template Reference

#include <field_fe.hh>

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

Classes

class  FEItem
 
class  NativeFactory
 
class  RegionValueErr
 

Public Types

enum  DataInterpolation { identic_msh , equivalent_msh , gauss_p0 , interp_p0 }
 
typedef FieldAlgorithmBase< spacedim, Value >::Point Point
 
typedef FieldAlgorithmBase< spacedim, ValueFactoryBaseType
 
typedef Field< spacedim, Value >::FactoryBase FieldFactoryBaseType
 
- Public Types inherited from FieldAlgorithmBase< spacedim, Value >
typedef Space< spacedim >::Point Point
 

Public Member Functions

 TYPEDEF_ERR_INFO (EI_Field, std::string)
 Declaration of exception. More...
 
 TYPEDEF_ERR_INFO (EI_File, std::string)
 
 TYPEDEF_ERR_INFO (EI_ElemIdx, unsigned int)
 
 TYPEDEF_ERR_INFO (EI_Region, std::string)
 
 DECLARE_EXCEPTION (ExcInvalidElemeDim,<< "Dimension of element in target mesh must be 0, 1 or 2! elm.idx() = "<< EI_ElemIdx::val<< ".\n")
 
 DECLARE_INPUT_EXCEPTION (ExcUndefElementValue,<< "FieldFE "<< EI_Field::qval<< " on region "<< EI_Region::qval<< " have invalid value .\n"<< "Provided by file "<< EI_File::qval<< " at element ID "<< EI_ElemIdx::val<< ".\n"<< "Please specify in default_value key.\n")
 
 FieldFE (unsigned int n_comp=0)
 
VectorMPI set_fe_data (std::shared_ptr< DOFHandlerMultiDim > dh, VectorMPI dof_values=VectorMPI::sequential(0), unsigned int block_index=FieldFE< spacedim, Value >::undef_uint)
 
void cache_update (FieldValueCache< typename Value::element_type > &data_cache, ElementCacheMap &cache_map, unsigned int region_patch_idx) override
 
void cache_reinit (const ElementCacheMap &cache_map) override
 
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) override
 
void native_data_to_cache (ElementDataCache< double > &output_data_cache)
 
unsigned int data_size () const
 
std::shared_ptr< DOFHandlerMultiDimget_dofhandler () const
 
VectorMPIvec ()
 
const VectorMPIvec () const
 
void local_to_ghost_data_scatter_begin ()
 Call begin scatter functions (local to ghost) on data vector. More...
 
void local_to_ghost_data_scatter_end ()
 Call end scatter functions (local to ghost) on data vector. More...
 
virtual ~FieldFE ()
 Destructor. More...
 
- 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)
 
void set_component_idx (unsigned int idx)
 
unsigned int n_comp () const
 
FieldResult field_result () const
 
virtual double next_change_time ()
 
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 const Input::Type::Selectionget_disc_selection_input_type ()
 
static const Input::Type::Selectionget_interp_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)
 

Static Public Attributes

static const unsigned int undef_uint = -1
 
- 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
 

Private Member Functions

void make_dof_handler (const MeshBase *mesh)
 Create DofHandler object. More...
 
void interpolate_gauss ()
 Interpolate data (use Gaussian distribution) over all elements of target mesh. More...
 
void interpolate_intersection ()
 Interpolate data (use intersection library) over all elements of target mesh. More...
 
void calculate_element_values ()
 Calculate data of equivalent_mesh interpolation or native data on input over all elements of target mesh. More...
 
template<unsigned int dim>
Quadrature init_quad (std::shared_ptr< EvalPoints > eval_points)
 Initialize FEValues object of given dimension. More...
 
Armor::ArmaMat< typename Value::element_type, Value::NRows_, Value::NCols_ > handle_fe_shape (unsigned int dim, unsigned int i_dof, unsigned int i_qp)
 
template<unsigned int dim>
void fill_fe_system_data (unsigned int block_index)
 
template<unsigned int dim>
void fill_fe_item ()
 
double get_scaled_value (int i_cache_el, unsigned int elm_idx, const std::string &region_name, RegionValueErr &actual_compute_region_error)
 
template<int elemdim>
unsigned int compute_fe_quadrature (std::vector< arma::vec::fixed< 3 >> &q_points, std::vector< double > &q_weights, const ElementAccessor< spacedim > &elm, unsigned int order=3)
 

Private Attributes

std::shared_ptr< DOFHandlerMultiDimdh_
 DOF handler object. More...
 
VectorMPI data_vec_
 Store data of Field. 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...
 
DataInterpolation interpolation_
 Specify type of FE data interpolation. 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...
 
std::vector< FEValues< spacedim > > fe_values_
 List of FEValues objects of dimensions 0,1,2,3 used for value calculation. More...
 
std::shared_ptr< EquivalentMeshMapsource_target_mesh_elm_map_
 Maps element indices from computational mesh to the source (data). More...
 
std::array< FEItem, 4 > fe_item_
 Holds specific data of field evaluation over all dimensions. More...
 
MixedPtr< FiniteElementfe_
 
std::vector< RegionValueErrregion_value_err_
 Set holds data of valid / invalid element values on all regions. More...
 
ElementDataCache< double >::CacheData input_data_cache_
 Input ElementDataCache is stored in set_time and used in all evaluation and interpolation methods. More...
 

Static Private Attributes

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

Additional Inherited Members

- 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 50 of file field_fe.hh.

Member Typedef Documentation

◆ FactoryBaseType

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

Definition at line 54 of file field_fe.hh.

◆ FieldFactoryBaseType

template<int spacedim, class Value >
typedef Field<spacedim, Value>::FactoryBase FieldFE< spacedim, Value >::FieldFactoryBaseType

Definition at line 55 of file field_fe.hh.

◆ Point

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

Definition at line 53 of file field_fe.hh.

Member Enumeration Documentation

◆ DataInterpolation

template<int spacedim, class Value >
enum FieldFE::DataInterpolation

Possible interpolations of input data.

Enumerator
identic_msh 

identical mesh

equivalent_msh 

equivalent mesh (default value)

gauss_p0 

P0 interpolation (with the use of Gaussian distribution)

interp_p0 

P0 interpolation (with the use of calculation of intersections)

Definition at line 60 of file field_fe.hh.

Constructor & Destructor Documentation

◆ FieldFE()

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

◆ ~FieldFE()

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

Destructor.

Definition at line 833 of file field_fe.cc.

Member Function Documentation

◆ cache_reinit()

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

Overload FieldAlgorithmBase::cache_reinit

Reinit fe_values_ data member.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 262 of file field_fe.cc.

◆ cache_update()

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

Overload FieldAlgorithmBase::cache_update

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 215 of file field_fe.cc.

◆ calculate_element_values()

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::calculate_element_values
private

Calculate data of equivalent_mesh interpolation or native data on input over all elements of target mesh.

Definition at line 635 of file field_fe.cc.

Here is the caller graph for this function:

◆ compute_fe_quadrature()

template<int spacedim, class Value >
template<int elemdim>
unsigned int FieldFE< spacedim, Value >::compute_fe_quadrature ( std::vector< arma::vec::fixed< 3 >> &  q_points,
std::vector< double > &  q_weights,
const ElementAccessor< spacedim > &  elm,
unsigned int  order = 3 
)
inlineprivate

Helper method. Compute real coordinates and weights (use QGauss) of given element.

Method is needs in Gauss interpolation.

Definition at line 305 of file field_fe.hh.

◆ data_size()

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

Return size of vector of data stored in Field

Definition at line 776 of file field_fe.cc.

◆ DECLARE_EXCEPTION()

template<int spacedim, class Value >
FieldFE< spacedim, Value >::DECLARE_EXCEPTION ( ExcInvalidElemeDim  ,
<< "Dimension of element in target mesh must be  0 
)

◆ DECLARE_INPUT_EXCEPTION()

template<int spacedim, class Value >
FieldFE< spacedim, Value >::DECLARE_INPUT_EXCEPTION ( ExcUndefElementValue  ,
<< "FieldFE< spacedim, Value > "<< EI_Field::qval<< " on region "<< EI_Region::qval<< " have invalid value .\n"<< "Provided by file "<< EI_File::qval<< " at element ID "<< EI_ElemIdx::val<< ".\n"<< "Please specify in default_value key.\n"   
)

◆ fill_fe_item()

template<int spacedim, class Value >
template<unsigned int dim>
void FieldFE< spacedim, Value >::fill_fe_item ( )
inlineprivate

Definition at line 282 of file field_fe.hh.

◆ fill_fe_system_data()

template<int spacedim, class Value >
template<unsigned int dim>
void FieldFE< spacedim, Value >::fill_fe_system_data ( unsigned int  block_index)
inlineprivate

Definition at line 272 of file field_fe.hh.

◆ get_disc_selection_input_type()

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

◆ get_dofhandler()

template<int spacedim, class Value >
std::shared_ptr<DOFHandlerMultiDim> FieldFE< spacedim, Value >::get_dofhandler ( ) const
inline

Definition at line 176 of file field_fe.hh.

Here is the caller graph for this function:

◆ get_input_type()

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

◆ get_interp_selection_input_type()

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

Return Input selection that allow to set interpolation of input data.

Definition at line 105 of file field_fe.cc.

◆ get_scaled_value()

template<int spacedim, class Value >
double FieldFE< spacedim, Value >::get_scaled_value ( int  i_cache_el,
unsigned int  elm_idx,
const std::string &  region_name,
RegionValueErr actual_compute_region_error 
)
private

Method computes value of given input cache element.

If computed value is invalid (e.g. NaN value) sets the data specifying error value.

Parameters
i_cache_elIndex of element of input ElementDataCache
elm_idxIdx of element of computational mesh
region_nameRegion of computational mesh
actual_compute_region_errorData object holding data of region with invalid value.

Definition at line 797 of file field_fe.cc.

Here is the caller graph for this function:

◆ handle_fe_shape()

template<int spacedim, class Value >
Armor::ArmaMat<typename Value::element_type, Value::NRows_, Value::NCols_> FieldFE< spacedim, Value >::handle_fe_shape ( unsigned int  dim,
unsigned int  i_dof,
unsigned int  i_qp 
)
inlineprivate

Definition at line 259 of file field_fe.hh.

Here is the caller graph for this function:

◆ init_from_input()

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

◆ init_quad()

template<int spacedim, class Value >
template<unsigned int dim>
Quadrature FieldFE< spacedim, Value >::init_quad ( std::shared_ptr< EvalPoints eval_points)
private

Initialize FEValues object of given dimension.

Definition at line 275 of file field_fe.cc.

◆ interpolate_gauss()

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::interpolate_gauss
private

Interpolate data (use Gaussian distribution) over all elements of target mesh.

Definition at line 436 of file field_fe.cc.

Here is the caller graph for this function:

◆ interpolate_intersection()

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::interpolate_intersection
private

Interpolate data (use intersection library) over all elements of target mesh.

Definition at line 532 of file field_fe.cc.

Here is the caller graph for this function:

◆ local_to_ghost_data_scatter_begin()

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::local_to_ghost_data_scatter_begin

Call begin scatter functions (local to ghost) on data vector.

Definition at line 783 of file field_fe.cc.

◆ local_to_ghost_data_scatter_end()

template<int spacedim, class Value >
void FieldFE< spacedim, Value >::local_to_ghost_data_scatter_end

Call end scatter functions (local to ghost) on data vector.

Definition at line 790 of file field_fe.cc.

◆ make_dof_handler()

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

Create DofHandler object.

Definition at line 345 of file field_fe.cc.

Here is the caller graph for this function:

◆ native_data_to_cache()

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

Copy data vector to given output ElementDataCache

Definition at line 757 of file field_fe.cc.

◆ set_fe_data()

template<int spacedim, class Value >
VectorMPI FieldFE< spacedim, Value >::set_fe_data ( std::shared_ptr< DOFHandlerMultiDim dh,
VectorMPI  dof_values = VectorMPI::sequential(0),
unsigned int  block_index = FieldFE<spacedim, Value>::undef_uint 
)

Setter for the finite element data.

Parameters
dhDof handler.
dof_valuesVector of dof values, optional (create own vector according to dofhandler).
block_indexIndex of block (in FESystem) or '-1' for FieldFE under simple DOF handler.
Returns
Data vector of dof values.

Definition at line 175 of file field_fe.cc.

◆ set_mesh()

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

Set target mesh.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 309 of file field_fe.cc.

◆ set_time()

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

◆ TYPEDEF_ERR_INFO() [1/4]

template<int spacedim, class Value >
FieldFE< spacedim, Value >::TYPEDEF_ERR_INFO ( EI_ElemIdx  ,
unsigned int   
)

◆ TYPEDEF_ERR_INFO() [2/4]

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

Declaration of exception.

◆ TYPEDEF_ERR_INFO() [3/4]

template<int spacedim, class Value >
FieldFE< spacedim, Value >::TYPEDEF_ERR_INFO ( EI_File  ,
std::string   
)

◆ TYPEDEF_ERR_INFO() [4/4]

template<int spacedim, class Value >
FieldFE< spacedim, Value >::TYPEDEF_ERR_INFO ( EI_Region  ,
std::string   
)

◆ vec() [1/2]

template<int spacedim, class Value >
VectorMPI& FieldFE< spacedim, Value >::vec ( )
inline

Definition at line 180 of file field_fe.hh.

Here is the caller graph for this function:

◆ vec() [2/2]

template<int spacedim, class Value >
const VectorMPI& FieldFE< spacedim, Value >::vec ( ) const
inline

Definition at line 184 of file field_fe.hh.

Member Data Documentation

◆ boundary_domain_

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 350 of file field_fe.hh.

◆ data_vec_

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

Store data of Field.

Definition at line 326 of file field_fe.hh.

◆ default_value_

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 344 of file field_fe.hh.

◆ dh_

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

DOF handler object.

Definition at line 324 of file field_fe.hh.

◆ discretization_

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 335 of file field_fe.hh.

◆ fe_

template<int spacedim, class Value >
MixedPtr<FiniteElement> FieldFE< spacedim, Value >::fe_
private

Definition at line 360 of file field_fe.hh.

◆ fe_item_

template<int spacedim, class Value >
std::array<FEItem, 4> FieldFE< spacedim, Value >::fe_item_
private

Holds specific data of field evaluation over all dimensions.

Definition at line 359 of file field_fe.hh.

◆ fe_values_

template<int spacedim, class Value >
std::vector<FEValues<spacedim> > FieldFE< spacedim, Value >::fe_values_
private

List of FEValues objects of dimensions 0,1,2,3 used for value calculation.

Definition at line 353 of file field_fe.hh.

◆ field_name_

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

field name read from input

Definition at line 332 of file field_fe.hh.

◆ flags_

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

Field flags.

Definition at line 341 of file field_fe.hh.

◆ in_rec_

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

Accessor to Input::Record.

Definition at line 347 of file field_fe.hh.

◆ input_data_cache_

template<int spacedim, class Value >
ElementDataCache<double>::CacheData FieldFE< spacedim, Value >::input_data_cache_
private

Input ElementDataCache is stored in set_time and used in all evaluation and interpolation methods.

Definition at line 366 of file field_fe.hh.

◆ interpolation_

template<int spacedim, class Value >
DataInterpolation FieldFE< spacedim, Value >::interpolation_
private

Specify type of FE data interpolation.

Definition at line 338 of file field_fe.hh.

◆ reader_file_

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

mesh reader file

Definition at line 329 of file field_fe.hh.

◆ region_value_err_

template<int spacedim, class Value >
std::vector<RegionValueErr> FieldFE< spacedim, Value >::region_value_err_
private

Set holds data of valid / invalid element values on all regions.

Definition at line 363 of file field_fe.hh.

◆ registrar

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 369 of file field_fe.hh.

◆ source_target_mesh_elm_map_

template<int spacedim, class Value >
std::shared_ptr<EquivalentMeshMap> FieldFE< spacedim, Value >::source_target_mesh_elm_map_
private

Maps element indices from computational mesh to the source (data).

Definition at line 356 of file field_fe.hh.

◆ undef_uint

template<int spacedim, class Value >
const unsigned int FieldFE< spacedim, Value >::undef_uint = -1
static

Definition at line 81 of file field_fe.hh.


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