26 template <
int spacedim,
class Value>
33 if ( (
dh_ ==
nullptr) || (
dh_->mesh()->n_elements() != mesh.
n_elements()) ) {
43 std::shared_ptr< FiniteElement<0> > fe0_ptr = std::make_shared< FE_P_disc<0> >(0);
44 std::shared_ptr< FiniteElement<1> > fe1_ptr = std::make_shared< FE_P_disc<1> >(0);
45 std::shared_ptr< FiniteElement<2> > fe2_ptr = std::make_shared< FE_P_disc<2> >(0);
46 std::shared_ptr< FiniteElement<3> > fe3_ptr = std::make_shared< FE_P_disc<3> >(0);
54 std::shared_ptr< FiniteElement<0> > fe0_ptr = std::make_shared< FE_P_disc<0> >(0);
55 std::shared_ptr< FiniteElement<1> > fe1_ptr = std::make_shared< FE_P_disc<1> >(0);
56 std::shared_ptr< FiniteElement<2> > fe2_ptr = std::make_shared< FE_P_disc<2> >(0);
57 std::shared_ptr< FiniteElement<3> > fe3_ptr = std::make_shared< FE_P_disc<3> >(0);
65 ASSERT(
false).error(
"Should not happen!\n");
68 dh_ = std::make_shared<DOFHandlerMultiDim>(mesh);
70 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>( &mesh,
fe0_,
fe1_,
fe2_,
fe3_);
71 dh_->distribute_dofs(ds,
true);
76 std::shared_ptr< FieldFE<spacedim, Value> > field_ptr = std::make_shared< FieldFE<spacedim, Value> >();
77 field_ptr->set_fe_data(
dh_, &map1, &map2, &map3, data_vec);
81 template <
int spacedim,
class Value>
85 unsigned int ndofs =
dh_->max_elem_dofs();
89 for (
auto ele :
dh_->mesh()->elements_range()) {
90 dh_->get_dof_indices(ele, indices);
91 for(idof=0; idof<ndofs; idof++) (*field_ptr->data_vec_)[ indices[idof] ] = (*data_ptr_)[ ndofs*ele.idx()+idof ];
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell...
FiniteElement< 1 > * fe1_
FiniteElement< 0 > * fe0_
Finite element objects (allow to create DOF handler)
Class FESystem for compound finite elements.
VectorSeqDouble()
Constructor.
std::shared_ptr< FieldFE< spacedim, Value > > create_field(Mesh &mesh, unsigned int n_comp)
Create and return shared pointer to FieldFE object.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
void fill_output_data(std::shared_ptr< FieldFE< spacedim, Value > > field_ptr)
unsigned int size()
Getter for shared pointer of output data.
Compound finite element on dim dimensional simplex.
FiniteElement< 3 > * fe3_
Definitions of basic Lagrangean finite elements with polynomial shape functions.
void resize(unsigned int size)
Create shared pointer and PETSC vector with given size.
virtual unsigned int n_elements(bool boundary=false) const
Returns count of boundary or bulk elements.
FiniteElement< 2 > * fe2_
std::shared_ptr< DOFHandlerMultiDim > dh_
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)