87{
89 config.checkConfigParameter("type", "RichardsComponentTransport");
90
91 DBUG(
"Create RichardsComponentTransportProcess.");
92
93 auto const coupling_scheme =
95 config.getConfigParameterOptional<std::string>("coupling_scheme");
96 const bool use_monolithic_scheme =
97 !(coupling_scheme && (*coupling_scheme == "staggered"));
98
100
102 auto const pv_config = config.getConfigSubtree("process_variables");
103
104 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
105 process_variables;
106 if (use_monolithic_scheme)
107 {
111 variables, pv_config,
112 {
113 "concentration",
115 "pressure"});
116 if (per_process_variables.size() > 2)
117 {
119 "By now RichardsComponentTransport process only supports "
120 "single component transport simulation.");
121 }
122 process_variables.push_back(std::move(per_process_variables));
123 }
124 else
125 {
126 OGS_FATAL(
"The staggered coupling scheme is not implemented.");
127 }
128
130
131 Eigen::VectorXd specific_body_force;
132 std::vector<double> const b =
134 config.getConfigParameter<std::vector<double>>("specific_body_force");
135 assert(!b.empty() && b.size() < 4);
137 {
139 "specific body force (gravity vector) has {:d} components, mesh "
140 "dimension is {:d}",
142 }
144 if (has_gravity)
145 {
146 specific_body_force.resize(b.size());
147 std::copy_n(b.data(), b.size(), specific_body_force.data());
148 }
149
150 auto media_map =
152
154 "Check the media properties of RichardsComponentTransport process ...");
156 DBUG(
"Media properties verified.");
157
158 RichardsComponentTransportProcessData process_data{
159 std::move(media_map), specific_body_force, has_gravity};
160
161 SecondaryVariableCollection secondary_variables;
162
164
165 return std::make_unique<RichardsComponentTransportProcess>(
166 std::move(name), mesh, std::move(jacobian_assembler), parameters,
167 integration_order, std::move(process_variables),
168 std::move(process_data), std::move(secondary_variables),
169 use_monolithic_scheme);
170}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
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)