Skip to content
Snippets Groups Projects
Commit 5bead473 authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/HT] Change handling of body force vector.

parent 66a63aa1
No related branches found
No related tags found
No related merge requests found
...@@ -135,14 +135,22 @@ std::unique_ptr<Process> createHTProcess( ...@@ -135,14 +135,22 @@ std::unique_ptr<Process> createHTProcess(
thermal_conductivity_fluid.name.c_str()); thermal_conductivity_fluid.name.c_str());
// Specific body force parameter. // Specific body force parameter.
Eigen::Vector3d specific_body_force; Eigen::VectorXd specific_body_force;
std::vector<double> const b = std::vector<double> const b =
//! \ogs_file_param{prj__processes__process__HT__specific_body_force} //! \ogs_file_param{prj__processes__process__HT__specific_body_force}
config.getConfigParameter<std::vector<double>>("specific_body_force"); config.getConfigParameter<std::vector<double>>("specific_body_force");
assert(!b.empty() && b.size() < 4); assert(b.size() > 0 && b.size() < 4);
if (b.size() < mesh.getDimension())
OGS_FATAL(
"specific body force (gravity vector) has %d components, mesh "
"dimension is %d",
b.size(), mesh.getDimension());
bool const has_gravity = MathLib::toVector(b).norm() > 0; bool const has_gravity = MathLib::toVector(b).norm() > 0;
if (has_gravity) if (has_gravity)
{
specific_body_force.resize(b.size());
std::copy_n(b.data(), b.size(), specific_body_force.data()); std::copy_n(b.data(), b.size(), specific_body_force.data());
}
HTProcessData process_data{ HTProcessData process_data{
std::move(porous_media_properties), std::move(porous_media_properties),
......
...@@ -146,7 +146,7 @@ public: ...@@ -146,7 +146,7 @@ public:
auto p_nodal_values = auto p_nodal_values =
Eigen::Map<const NodalVectorType>(&local_x[num_nodes], num_nodes); Eigen::Map<const NodalVectorType>(&local_x[num_nodes], num_nodes);
auto const & b = _process_data.specific_body_force.head(GlobalDim); auto const& b = _process_data.specific_body_force;
MaterialLib::Fluid::FluidProperty::ArrayType vars; MaterialLib::Fluid::FluidProperty::ArrayType vars;
......
...@@ -39,7 +39,7 @@ struct HTProcessData ...@@ -39,7 +39,7 @@ struct HTProcessData
ProcessLib::Parameter<double> const& specific_heat_capacity_fluid_, ProcessLib::Parameter<double> const& specific_heat_capacity_fluid_,
ProcessLib::Parameter<double> const& thermal_conductivity_solid_, ProcessLib::Parameter<double> const& thermal_conductivity_solid_,
ProcessLib::Parameter<double> const& thermal_conductivity_fluid_, ProcessLib::Parameter<double> const& thermal_conductivity_fluid_,
Eigen::Vector3d specific_body_force_, Eigen::VectorXd specific_body_force_,
bool const has_gravity_) bool const has_gravity_)
: porous_media_properties(std::move(porous_media_properties_)), : porous_media_properties(std::move(porous_media_properties_)),
viscosity_model(std::move(viscosity_model_)), viscosity_model(std::move(viscosity_model_)),
...@@ -96,7 +96,7 @@ struct HTProcessData ...@@ -96,7 +96,7 @@ struct HTProcessData
Parameter<double> const& thermal_dispersivity_transversal; Parameter<double> const& thermal_dispersivity_transversal;
Parameter<double> const& thermal_conductivity_solid; Parameter<double> const& thermal_conductivity_solid;
Parameter<double> const& thermal_conductivity_fluid; Parameter<double> const& thermal_conductivity_fluid;
Eigen::Vector3d const specific_body_force; Eigen::VectorXd const specific_body_force;
bool const has_gravity; bool const has_gravity;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment