18 #ifndef GENERIC_FIELD_IMPL_HH_ 19 #define GENERIC_FIELD_IMPL_HH_ 27 template <
int spacedim>
30 region_id.
name(
"region_id");
34 RegionSet all_regions=mesh.region_db().get_region_set(
"ALL");
35 for(
Region reg : all_regions) {
36 auto field_algo=std::make_shared<FieldConstant<spacedim, IntegerScalar>>();
37 field_algo->set_value(reg.id());
46 template <
int spacedim>
48 auto field_subdomain_data= mesh.get_part()->subdomain_id_field_data();
51 subdomain.
name(
"subdomain");
56 mesh.region_db().get_region_set(
"ALL"),
57 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.