81{
83 config.checkConfigParameter("type", "RichardsComponentTransport");
84
85 DBUG(
"Create RichardsComponentTransportProcess.");
86
87 auto const coupling_scheme =
89 config.getConfigParameterOptional<std::string>("coupling_scheme");
90 const bool use_monolithic_scheme =
91 !(coupling_scheme && (*coupling_scheme == "staggered"));
92
94
96 auto const pv_config = config.getConfigSubtree("process_variables");
97
98 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
99 process_variables;
100 if (use_monolithic_scheme)
101 {
105 variables, pv_config,
106 {
107 "concentration",
109 "pressure"});
110 if (per_process_variables.size() > 2)
111 {
113 "By now RichardsComponentTransport process only supports "
114 "single component transport simulation.");
115 }
116 process_variables.push_back(std::move(per_process_variables));
117 }
118 else
119 {
120 OGS_FATAL(
"The staggered coupling scheme is not implemented.");
121 }
122
124
125 Eigen::VectorXd specific_body_force;
126 std::vector<double> const b =
128 config.getConfigParameter<std::vector<double>>("specific_body_force");
129 assert(!b.empty() && b.size() < 4);
131 {
133 "specific body force (gravity vector) has {:d} components, mesh "
134 "dimension is {:d}",
136 }
138 if (has_gravity)
139 {
140 specific_body_force.resize(b.size());
141 std::copy_n(b.data(), b.size(), specific_body_force.data());
142 }
143
144 auto media_map =
146
148 "Check the media properties of RichardsComponentTransport process ...");
150 DBUG(
"Media properties verified.");
151
153 std::move(media_map), specific_body_force, has_gravity};
154
155 SecondaryVariableCollection secondary_variables;
156
158
159 return std::make_unique<RichardsComponentTransportProcess>(
160 std::move(name), mesh, std::move(jacobian_assembler), parameters,
161 integration_order, std::move(process_variables),
162 std::move(process_data), std::move(secondary_variables),
163 use_monolithic_scheme);
164}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
unsigned getDimension() const
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)