50 template <
int spacedim,
class Value>
74 DECLARE_EXCEPTION( ExcInvalidElemeDim, <<
"Dimension of element in target mesh must be 0, 1 or 2! elm.idx() = " << EI_ElemIdx::val <<
".\n" );
76 <<
"FieldFE " << EI_Field::qval <<
" on region " << EI_Region::qval <<
" have invalid value .\n"
77 <<
"Provided by file " << EI_File::qval <<
" at element ID " << EI_ElemIdx::val <<
".\n"
78 <<
"Please specify in default_value key.\n");
258 template <
unsigned int dim>
262 unsigned int i_dof,
unsigned int i_qp)
265 for (
unsigned int c=0; c<Value::NRows_*Value::NCols_; ++c)
266 v(c/spacedim,c%spacedim) =
fe_values_[dim].shape_value_component(i_dof, i_qp, c);
267 if (Value::NRows_ == Value::NCols_)
273 template<
unsigned int dim>
275 auto fe_system_ptr = std::dynamic_pointer_cast<FESystem<dim>>(
dh_->ds()->fe()[
Dim<dim>{}] );
276 ASSERT(fe_system_ptr !=
nullptr).error(
"Wrong type, must be FESystem!\n");
277 this->
fe_item_[dim].comp_index_ = fe_system_ptr->function_space()->dof_indices()[block_index].component_offset;
278 this->
fe_item_[dim].range_begin_ = fe_system_ptr->fe_dofs(block_index)[0];
279 this->
fe_item_[dim].range_end_ = this->
fe_item_[dim].range_begin_ + fe_system_ptr->fe()[block_index]->n_dofs();
283 template<
unsigned int dim>
285 this->
fe_item_[dim].comp_index_ = 0;
286 this->
fe_item_[dim].range_begin_ = 0;
299 double get_scaled_value(
int i_cache_el,
unsigned int elm_idx,
const std::string ®ion_name, RegionValueErr &actual_compute_region_error);
306 template<
int elemdim>
310 static_assert(elemdim <= spacedim,
"Dimension of element must be less equal than spacedim.");
311 static const double weight_coefs[] = { 1., 1., 2., 6. };
313 QGauss qgauss(elemdim, order);
316 for(
unsigned i=0; i<qgauss.
size(); ++i) {
317 q_weights[i] = qgauss.
weight(i)*weight_coefs[elemdim];
321 return qgauss.
size();
326 std::shared_ptr<DOFHandlerMultiDim>
dh_;
376 template <
int spacedim,
class Value>
377 std::shared_ptr<FieldFE<spacedim, Value> >
create_field_fe(std::shared_ptr<DOFHandlerMultiDim> dh,
382 std::shared_ptr< FieldFE<spacedim, Value> > field_ptr = std::make_shared< FieldFE<spacedim, Value> >();
384 field_ptr->set_fe_data( dh, dh->create_vector(), block_index );
386 field_ptr->set_fe_data( dh, *
vec, block_index );
393 template <
int spacedim,
class Value>
397 std::shared_ptr<DOFHandlerMultiDim> dh_par = std::make_shared<DOFHandlerMultiDim>(mesh);
398 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>( &mesh, fe);
399 dh_par->distribute_dofs(ds);
401 return create_field_fe<spacedim,Value>(dh_par);
Directing class of FieldValueCache.
unsigned int n_comp() const
Space< spacedim >::Point Point
Common abstract parent of all Field<...> classes.
unsigned int range_begin_
Field< spacedim, Value >::FieldBasePtr create_field(Input::Record rec, const FieldCommon &field) override
std::shared_ptr< DOFHandlerMultiDim > conc_dof_handler_
NativeFactory(unsigned int index, std::shared_ptr< DOFHandlerMultiDim > conc_dof_handler, VectorMPI dof_vector=VectorMPI::sequential(0))
Constructor.
RegionValueErr(const std::string ®ion_name, unsigned int elm_id, double value)
Constructor, sets invalid region, element and value specification.
RegionValueErr()
Default constructor, sets valid region.
FieldAlgorithmBase< spacedim, Value >::Point Point
DECLARE_EXCEPTION(ExcInvalidElemeDim,<< "Dimension of element in target mesh must be 0, 1 or 2! elm.idx() = "<< EI_ElemIdx::val<< ".\n")
Armor::ArmaMat< typename Value::element_type, Value::NRows_, Value::NCols_ > handle_fe_shape(unsigned int dim, unsigned int i_dof, unsigned int i_qp)
double get_scaled_value(int i_cache_el, unsigned int elm_idx, const std::string ®ion_name, RegionValueErr &actual_compute_region_error)
MixedPtr< FiniteElement > fe_
FieldAlgorithmBase< spacedim, Value > FactoryBaseType
VectorMPI data_vec_
Store data of Field.
static const Input::Type::Selection & get_interp_selection_input_type()
unsigned int data_size() const
std::vector< RegionValueErr > region_value_err_
Set holds data of valid / invalid element values on all regions.
void local_to_ghost_data_scatter_begin()
Call begin scatter functions (local to ghost) on data vector.
TYPEDEF_ERR_INFO(EI_File, std::string)
void calculate_element_values()
Calculate data of equivalent_mesh interpolation or native data on input over all elements of target m...
virtual void init_from_input(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
virtual ~FieldFE()
Destructor.
Field< spacedim, Value >::FactoryBase FieldFactoryBaseType
@ interp_p0
P0 interpolation (with the use of calculation of intersections)
@ equivalent_msh
equivalent mesh (default value)
@ gauss_p0
P0 interpolation (with the use of Gaussian distribution)
@ identic_msh
identical mesh
void local_to_ghost_data_scatter_end()
Call end scatter functions (local to ghost) on data vector.
static const Input::Type::Record & get_input_type()
Implementation.
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)
std::vector< FEValues< spacedim > > fe_values_
List of FEValues objects of dimensions 0,1,2,3 used for value calculation.
void interpolate_gauss()
Interpolate data (use Gaussian distribution) over all elements of target mesh.
TYPEDEF_ERR_INFO(EI_Field, std::string)
Declaration of exception.
void make_dof_handler(const MeshBase *mesh)
Create DofHandler object.
Quadrature init_quad(std::shared_ptr< EvalPoints > eval_points)
Initialize FEValues object of given dimension.
OutputTime::DiscreteSpace discretization_
Specify section where to find the field data in input mesh file.
std::shared_ptr< DOFHandlerMultiDim > get_dofhandler() const
TYPEDEF_ERR_INFO(EI_Region, std::string)
FilePath reader_file_
mesh reader file
std::array< FEItem, 4 > fe_item_
Holds specific data of field evaluation over all dimensions.
TYPEDEF_ERR_INFO(EI_ElemIdx, unsigned int)
bool set_time(const TimeStep &time) override
static const int registrar
Registrar of class to factory.
void interpolate_intersection()
Interpolate data (use intersection library) over all elements of target mesh.
VectorMPI set_fe_data(std::shared_ptr< DOFHandlerMultiDim > dh, VectorMPI dof_values=VectorMPI::sequential(0), unsigned int block_index=FieldFE< spacedim, Value >::undef_uint)
double default_value_
Default value of element if not set in mesh data file.
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")
const VectorMPI & vec() const
void cache_update(FieldValueCache< typename Value::element_type > &data_cache, ElementCacheMap &cache_map, unsigned int region_patch_idx) override
bool boundary_domain_
Is set in set_mesh method. Value true means, that we accept only boundary element accessors in the va...
DataInterpolation interpolation_
Specify type of FE data interpolation.
Input::Record in_rec_
Accessor to Input::Record.
FieldFlag::Flags flags_
Field flags.
void native_data_to_cache(ElementDataCache< double > &output_data_cache)
std::string field_name_
field name read from input
FieldFE(unsigned int n_comp=0)
std::shared_ptr< DOFHandlerMultiDim > dh_
DOF handler object.
std::shared_ptr< EquivalentMeshMap > source_target_mesh_elm_map_
Maps element indices from computational mesh to the source (data).
void fill_fe_system_data(unsigned int block_index)
static const unsigned int undef_uint
static const Input::Type::Selection & get_disc_selection_input_type()
ElementDataCache< double >::CacheData input_data_cache_
Input ElementDataCache is stored in set_time and used in all evaluation and interpolation methods.
void cache_reinit(PatchInternals &patch_internals) override
void set_mesh(const Mesh *mesh) override
std::shared_ptr< FieldBaseType > FieldBasePtr
Dedicated class for storing path to input and output files.
static RealPoint project_unit_to_real(const BaryPoint &point, const ElementMap &map)
static ElementMap element_map(ElementAccessor< 3 > elm)
Base class for Mesh and BCMesh.
Symmetric Gauss-Legendre quadrature formulae on simplices.
Base class for quadrature rules on simplices in arbitrary dimensions.
unsigned int size() const
Returns number of quadrature points.
Armor::ArmaVec< double, point_dim > point(unsigned int i) const
Returns the ith quadrature point.
double weight(unsigned int i) const
Returns the ith weight.
Representation of one time step..
static VectorMPI sequential(unsigned int size)
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
Definitions of basic Lagrangean finite elements with polynomial shape functions.
Class FESystem for compound finite elements.
std::shared_ptr< FieldFE< spacedim, Value > > create_field_fe(std::shared_ptr< DOFHandlerMultiDim > dh, VectorMPI *vec=nullptr, unsigned int block_index=FieldFE< spacedim, Value >::undef_uint)
Abstract class for description of finite elements.
static constexpr bool value
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell.
typename arma::Mat< Type >::template fixed< nr, nc > ArmaMat
ArmaMat< double, N, M > mat
Implementation of range helper class.
Helper struct stores data for initizalize descentants of FieldAlgorithmBase.
Holds common data shared between GenericAssemblz and Assembly<dim> classes.