90 config.checkConfigParameter(
"type",
"RichardsComponentTransport");
92 DBUG(
"Create RichardsComponentTransportProcess.");
94 auto const coupling_scheme =
96 config.getConfigParameterOptional<std::string>(
"coupling_scheme");
97 const bool use_monolithic_scheme =
98 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
103 auto const pv_config = config.getConfigSubtree(
"process_variables");
105 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
107 if (use_monolithic_scheme)
110 variables, pv_config,
115 if (per_process_variables.size() > 2)
118 "By now RichardsComponentTransport process only supports "
119 "single component transport simulation.");
121 process_variables.push_back(std::move(per_process_variables));
125 OGS_FATAL(
"The staggered coupling scheme is not implemented.");
129 Eigen::VectorXd specific_body_force;
130 std::vector<double>
const b =
132 config.getConfigParameter<std::vector<double>>(
"specific_body_force");
133 assert(!b.empty() && b.size() < 4);
137 "specific body force (gravity vector) has {:d} components, mesh "
144 specific_body_force.resize(b.size());
145 std::copy_n(b.data(), b.size(), specific_body_force.data());
152 "Check the media properties of RichardsComponentTransport process ...");
154 DBUG(
"Media properties verified.");
156 RichardsComponentTransportProcessData process_data{
157 std::move(media_map), specific_body_force, has_gravity};
159 SecondaryVariableCollection secondary_variables;
163 return std::make_unique<RichardsComponentTransportProcess>(
164 std::move(
name), mesh, std::move(jacobian_assembler), parameters,
165 integration_order, std::move(process_variables),
166 std::move(process_data), std::move(secondary_variables),
167 use_monolithic_scheme);
void DBUG(char const *fmt, Args const &... args)
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
std::unique_ptr< MaterialSpatialDistributionMap > createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium >> const &media, MeshLib::Mesh const &mesh)
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
void checkMPLProperties(MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)