49 template <
int spacedim,
class Value>
95 void set_fe_data(std::shared_ptr<DOFHandlerMultiDim> dh,
107 void set_native_dh(std::shared_ptr<DOFHandlerMultiDim> dh)
override;
135 void set_mesh(
const Mesh *mesh,
bool boundary_domain)
override;
188 std::shared_ptr<DOFHandlerMultiDim>
dh_;
262 template <
int spacedim,
class Value>
269 std::shared_ptr<DOFHandlerMultiDim> dh;
284 std::shared_ptr< FiniteElement<0> > fe0_ptr = std::make_shared< FE_P_disc<0> >(0);
285 std::shared_ptr< FiniteElement<1> > fe1_ptr = std::make_shared< FE_P_disc<1> >(0);
286 std::shared_ptr< FiniteElement<2> > fe2_ptr = std::make_shared< FE_P_disc<2> >(0);
287 std::shared_ptr< FiniteElement<3> > fe3_ptr = std::make_shared< FE_P_disc<3> >(0);
295 std::shared_ptr< FiniteElement<0> > fe0_ptr = std::make_shared< FE_P_disc<0> >(0);
296 std::shared_ptr< FiniteElement<1> > fe1_ptr = std::make_shared< FE_P_disc<1> >(0);
297 std::shared_ptr< FiniteElement<2> > fe2_ptr = std::make_shared< FE_P_disc<2> >(0);
298 std::shared_ptr< FiniteElement<3> > fe3_ptr = std::make_shared< FE_P_disc<3> >(0);
306 ASSERT(
false).error(
"Should not happen!\n");
311 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>( &mesh, fe0, fe1, fe2, fe3);
316 std::shared_ptr< FieldFE<spacedim, Value> > field_ptr = std::make_shared< FieldFE<spacedim, Value> >();
329 template <
int spacedim,
class Value>
332 auto dh = field_ptr->get_dofhandler();
333 unsigned int ndofs = dh->max_elem_dofs();
343 for (
auto ele : dh->mesh()->elements_range()) {
344 dh->get_dof_indices(ele, indices);
345 for(idof=0; idof<ndofs; idof++) (*field_ptr->get_data_vec())[ indices[idof] ] = (*vec_seq.
data_ptr())[ ndofs*ele.idx()+idof ];
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell...
std::shared_ptr< DOFHandlerMultiDim > sequential()
Returns sequential version of the current dof handler.
virtual ~FieldFE()
Destructor.
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
void interpolate_gauss(ElementDataCache< double >::ComponentDataPtr data_vec)
Interpolate data (use Gaussian distribution) over all elements of target mesh.
FEValueHandler< 0, spacedim, Value > value_handler0_
Value handler that allows get value of 0D elements.
std::shared_ptr< std::vector< T > > ComponentDataPtr
P0 interpolation (with the use of calculation of intersections)
std::string field_name_
field name read from input
std::shared_ptr< FieldFE< spacedim, Value > > create_field(VectorMPI &vec_seq, Mesh &mesh, unsigned int n_comp)
void fill_data_to_cache(ElementDataCache< double > &output_data_cache)
static VectorMPI * sequential(unsigned int size)
FEValueHandler< 2, spacedim, Value > value_handler2_
Value handler that allows get value of 2D elements.
void distribute_dofs(std::shared_ptr< DiscreteSpace > ds)
Distributes degrees of freedom on the mesh needed for the given discrete space.
FilePath reader_file_
mesh reader file
void set_fe_data(std::shared_ptr< DOFHandlerMultiDim > dh, MappingP1< 1, 3 > *map1, MappingP1< 2, 3 > *map2, MappingP1< 3, 3 > *map3, VectorMPI *data)
Helper struct stores data for initizalize descentants of FieldAlgorithmBase.
FieldAlgorithmBase< spacedim, Value >::Point Point
Class FESystem for compound finite elements.
VectorDataPtr data_ptr()
Getter for shared pointer of output data.
void fill_output_data(VectorMPI &vec_seq, std::shared_ptr< FieldFE< spacedim, Value > > field_ptr)
static const int registrar
Registrar of class to factory.
void set_mesh(const Mesh *mesh, bool boundary_domain) override
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
double default_value_
Default value of element if not set in mesh data file.
FEValueHandler< 3, spacedim, Value > value_handler3_
Value handler that allows get value of 3D elements.
bool set_time(const TimeStep &time) override
FiniteElement< 3 > * fe3_
Same as previous, but represents 3D element.
static const Input::Type::Selection & get_interp_selection_input_type()
std::shared_ptr< std::vector< LongIdx > > boundary_dofs_
void fill_boundary_dofs()
FieldAlgorithmBase< spacedim, Value > FactoryBaseType
unsigned int data_size() const
bool boundary_domain_
Is set in set_mesh method. Value true means, that we accept only boundary element accessors in the va...
void set_native_dh(std::shared_ptr< DOFHandlerMultiDim > dh) override
OutputTime::DiscreteSpace discretization_
Specify section where to find the field data in input mesh file.
std::shared_ptr< DOFHandlerMultiDim > dh_
DOF handler object.
static const Input::Type::Record & get_input_type()
Implementation.
DataInterpolation interpolation_
Specify type of FE data interpolation.
Compound finite element on dim dimensional simplex.
Definitions of basic Lagrangean finite elements with polynomial shape functions.
Provides the numbering of the finite element degrees of freedom on the computational mesh...
void interpolate_intersection(ElementDataCache< double >::ComponentDataPtr data_vec)
Interpolate data (use intersection library) over all elements of target mesh.
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)
Space< spacedim >::Point Point
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.
FEValueHandler< 1, spacedim, Value > value_handler1_
Value handler that allows get value of 1D elements.
Dedicated class for storing path to input and output files.
FiniteElement< 1 > * fe1_
Same as previous, but represents 1D element.
std::shared_ptr< DOFHandlerMultiDim > get_dofhandler() const
static const Input::Type::Selection & get_disc_selection_input_type()
FiniteElement< 2 > * fe2_
Same as previous, but represents 2D element.
VectorMPI * get_data_vec() const
VectorMPI * data_vec_
Store data of Field.
Input::Record in_rec_
Accessor to Input::Record.
FieldFE(unsigned int n_comp=0)
std::vector< LongIdx > dof_indices_
Array of indexes to data_vec_, used for get/set values.
FiniteElement< 0 > * fe0_
virtual void init_from_input(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
Abstract class for description of finite elements.
equivalent mesh (default value)
void calculate_native_values(ElementDataCache< double >::ComponentDataPtr data_cache)
Calculate native data over all elements of target mesh.
FieldFlag::Flags flags_
Field flags.
Representation of one time step..
void make_dof_handler(const Mesh *mesh)
Create DofHandler object.
Implementation of range helper class.
unsigned int size()
Return size of output data.
P0 interpolation (with the use of Gaussian distribution)
unsigned int n_comp() const