8 #ifndef GENERIC_FIELD_IMPL_HH_
9 #define GENERIC_FIELD_IMPL_HH_
17 template <
int spacedim>
20 region_id.
name(
"region_id");
24 RegionSet all_regions=mesh.region_db().get_region_set(
"ALL");
25 for(
Region reg : all_regions) {
26 auto field_algo=std::make_shared<FieldConstant<spacedim, IntegerScalar>>();
27 field_algo->set_value(reg.id());
38 template <
int spacedim>
40 auto field_subdomain_data= mesh.get_part()->subdomain_id_field_data();
43 subdomain.
name(
"subdomain");
48 mesh.region_db().get_region_set(
"ALL"),
49 make_shared< FieldElementwise<spacedim, FieldValue<3>::Integer> >(field_subdomain_data, 1),
static auto subdomain(Mesh &mesh) -> IndexField
Class template representing a field with values dependent on: point, element, and region...
Fields computed from the mesh data.
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
static auto region_id(Mesh &mesh) -> IndexField
void set_field(const RegionSet &domain, FieldBasePtr field, double time=0.0)
FieldCommon & name(const string &name)
void set_mesh(const Mesh &mesh) override
static UnitSI & dimensionless()
Returns dimensionless unit.