27 bool const use_stokes_brinkman_form)
29 std::array
const required_properties_liquid_phase = {
32 std::array
const required_properties_medium = {
37 auto const element_id = element->getID();
38 auto const& medium = *media_map.
getMedium(element_id);
40 if (use_stokes_brinkman_form)
47 auto const& liquid_phase = medium.phase(
"AqueousLiquid");
53 template <
int GlobalDim>
57 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
58 std::vector<ProcessVariable>
const& variables,
59 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
60 unsigned const integration_order,
62 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
67 DBUG(
"Create StokesFlowProcess.");
69 auto const coupling_scheme =
73 const bool use_monolithic_scheme = (coupling_scheme !=
"staggered");
79 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
92 auto const variable_v = collected_process_variables[0];
93 if (variable_v.get().getNumberOfGlobalComponents() != GlobalDim)
96 "Number of components of the process variable '{:s}' is different "
97 "from the global dimension: got {:d}, expected {:d}",
98 variable_v.get().getName(),
99 variable_v.get().getNumberOfGlobalComponents(),
103 auto const variable_p = collected_process_variables[1];
104 if (variable_p.get().getNumberOfGlobalComponents() != 1)
107 "Pressure process variable '{:s}' is not a scalar variable but has "
109 variable_p.get().getName(),
110 variable_p.get().getNumberOfGlobalComponents());
115 if (use_monolithic_scheme)
117 process_variables.push_back(std::move(collected_process_variables));
122 "The staggered coupling scheme for StokesFlowProcess is not "
127 Eigen::VectorXd specific_body_force = Eigen::VectorXd::Zero(GlobalDim);
131 if (b.size() != GlobalDim)
134 "The size of the specific body force vector does not match the "
135 "global dimension. Vector size is {:d}, global "
137 b.size(), GlobalDim);
139 std::copy_n(b.data(), b.size(), specific_body_force.data());
141 bool const use_stokes_brinkman_form =
148 DBUG(
"Check the media properties of StokesFlow process ...");
150 DBUG(
"Media properties verified.");
153 std::move(specific_body_force),
154 use_stokes_brinkman_form};
160 return std::make_unique<StokesFlowProcess<GlobalDim>>(
161 std::move(
name), mesh, std::move(jacobian_assembler), parameters,
162 integration_order, std::move(process_variables),
163 std::move(process_data), std::move(secondary_variables),
164 use_monolithic_scheme);
170 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
171 std::vector<ProcessVariable>
const& variables,
172 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
173 unsigned const integration_order,
175 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
void DBUG(char const *fmt, Args const &... args)
void checkConfigParameter(std::string const ¶m, T const &value) const
T getConfigParameter(std::string const ¶m) const
ConfigTree getConfigSubtree(std::string const &root) const
Medium * getMedium(std::size_t element_id)
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Handles configuration of several secondary variables from the project file.
std::unique_ptr< MaterialSpatialDistributionMap > createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium >> const &media, MeshLib::Mesh const &mesh)
void checkRequiredProperties(Component const &c, Container const &required_properties)
void checkMPLProperties(MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map, bool const use_stokes_brinkman_form)
std::unique_ptr< Process > createStokesFlowProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const ¶meters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createStokesFlowProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const ¶meters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
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)