Skip to content
Snippets Groups Projects
Commit 306978e4 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[PL] Fix creation of specific body forces.

Correct checking of the size and proper error message.
parent 9241ef20
No related branches found
No related tags found
No related merge requests found
...@@ -163,12 +163,12 @@ std::unique_ptr<Process> createHydroMechanicsProcess( ...@@ -163,12 +163,12 @@ std::unique_ptr<Process> createHydroMechanicsProcess(
//! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS__specific_body_force} //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS__specific_body_force}
config.getConfigParameter<std::vector<double>>( config.getConfigParameter<std::vector<double>>(
"specific_body_force"); "specific_body_force");
if (specific_body_force.size() != DisplacementDim) if (b.size() != DisplacementDim)
OGS_FATAL( OGS_FATAL(
"The size of the specific body force vector does not match the " "The size of the specific body force vector does not match the "
"displacement dimension. Vector size is %d, displacement " "displacement dimension. Vector size is %d, displacement "
"dimension is %d", "dimension is %d",
specific_body_force.size(), DisplacementDim); b.size(), DisplacementDim);
std::copy_n(b.data(), b.size(), specific_body_force.data()); std::copy_n(b.data(), b.size(), specific_body_force.data());
} }
......
...@@ -185,12 +185,12 @@ std::unique_ptr<Process> createHydroMechanicsProcess( ...@@ -185,12 +185,12 @@ std::unique_ptr<Process> createHydroMechanicsProcess(
//! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__specific_body_force} //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__specific_body_force}
config.getConfigParameter<std::vector<double>>( config.getConfigParameter<std::vector<double>>(
"specific_body_force"); "specific_body_force");
if (specific_body_force.size() != GlobalDim) if (b.size() != GlobalDim)
OGS_FATAL( OGS_FATAL(
"The size of the specific body force vector does not match the " "The size of the specific body force vector does not match the "
"displacement dimension. Vector size is %d, displacement " "displacement dimension. Vector size is %d, displacement "
"dimension is %d", "dimension is %d",
specific_body_force.size(), GlobalDim); b.size(), GlobalDim);
std::copy_n(b.data(), b.size(), specific_body_force.data()); std::copy_n(b.data(), b.size(), specific_body_force.data());
} }
......
...@@ -155,12 +155,12 @@ std::unique_ptr<Process> createThermoMechanicsProcess( ...@@ -155,12 +155,12 @@ std::unique_ptr<Process> createThermoMechanicsProcess(
//! \ogs_file_param{prj__processes__process__THERMO_MECHANICS__specific_body_force} //! \ogs_file_param{prj__processes__process__THERMO_MECHANICS__specific_body_force}
config.getConfigParameter<std::vector<double>>( config.getConfigParameter<std::vector<double>>(
"specific_body_force"); "specific_body_force");
if (specific_body_force.size() != DisplacementDim) if (b.size() != DisplacementDim)
OGS_FATAL( OGS_FATAL(
"The size of the specific body force vector does not match the " "The size of the specific body force vector does not match the "
"displacement dimension. Vector size is %d, displacement " "displacement dimension. Vector size is %d, displacement "
"dimension is %d", "dimension is %d",
specific_body_force.size(), DisplacementDim); b.size(), DisplacementDim);
std::copy_n(b.data(), b.size(), specific_body_force.data()); std::copy_n(b.data(), b.size(), specific_body_force.data());
} }
......
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