Flow123d
release_3.0.0-973-g92f55e826
|
Go to the documentation of this file.
18 #ifndef GENERIC_FIELD_IMPL_HH_
19 #define GENERIC_FIELD_IMPL_HH_
37 template <
int spacedim>
40 region_id.
name(
"region_id");
44 RegionSet all_regions=mesh.region_db().get_region_set(
"ALL");
45 for(
Region reg : all_regions) {
46 auto field_algo=std::make_shared<FieldConstant<spacedim, DoubleScalar>>();
47 field_algo->set_value(reg.id());
56 template <
int spacedim>
63 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>( &mesh, &fe0, &fe1, &fe2, &fe3);
65 std::shared_ptr<DOFHandlerMultiDim> dh = dh_par.
sequential();
67 auto field_subdomain_data = mesh.get_part()->subdomain_id_field_data();
72 for (
auto cell : dh->own_range()) {
73 cell.get_loc_dof_indices(indices);
74 (*data_vec)[ indices[0] ] = (*field_subdomain_data)[i_ele];
77 std::shared_ptr< FieldFE<spacedim, DoubleScalar> > field_ptr = std::make_shared< FieldFE<spacedim, DoubleScalar> >();
78 field_ptr->set_fe_data(dh);
81 subdomain.
name(
"subdomain");
86 mesh.region_db().get_region_set(
"ALL"),
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
static UnitSI & dimensionless()
Returns dimensionless unit.
Declaration of class which provides the finite element for every mesh cell.
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.
Provides the numbering of the finite element degrees of freedom on the computational mesh.
void distribute_dofs(std::shared_ptr< DiscreteSpace > ds)
Distributes degrees of freedom on the mesh needed for the given discrete space.
static auto subdomain(Mesh &mesh) -> IndexField
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
std::shared_ptr< DOFHandlerMultiDim > sequential()
Returns sequential version of the current dof handler.
void set_field(const RegionSet &domain, FieldBasePtr field, double time=0.0)
static auto region_id(Mesh &mesh) -> IndexField
void set_mesh(const Mesh &mesh) override
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell.
Class template representing a field with values dependent on: point, element, and region.
FieldCommon & name(const string &name)