Skip to content
Snippets Groups Projects
Commit 86323685 authored by wenqing's avatar wenqing Committed by Dmitri Naumov
Browse files

[LiquidFlow] Added a member of element_rotation_matrices to LiquidFlowData

parent 20886e26
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@
#include "MaterialLib/MPL/CheckMaterialSpatialDistributionMap.h"
#include "MaterialLib/MPL/CreateMaterialSpatialDistributionMap.h"
#include "MaterialLib/PhysicalConstant.h"
#include "MeshLib/Utils/GetElementRotationMatrices.h"
#include "MeshLib/Utils/GetSpaceDimension.h"
#include "ParameterLib/Utils.h"
#include "ProcessLib/Output/CreateSecondaryVariables.h"
#include "ProcessLib/Utils/ProcessUtils.h"
......@@ -83,12 +85,14 @@ std::unique_ptr<Process> createLiquidFlowProcess(
std::vector<double> const b =
//! \ogs_file_param{prj__processes__process__LIQUID_FLOW__specific_body_force}
config.getConfigParameter<std::vector<double>>("specific_body_force");
if (b.size() != mesh.getDimension())
int const mesh_space_dimension =
MeshLib::getSpaceDimension(mesh.getNodes());
if (static_cast<int>(b.size()) != mesh_space_dimension)
{
OGS_FATAL(
"specific body force (gravity vector) has {:d} components, mesh "
"dimension is {:d}",
b.size(), mesh.getDimension());
"specific body force (gravity vector) has {:d} components, but the "
"space dimension is {:d}.",
b.size(), mesh_space_dimension);
}
Eigen::VectorXd specific_body_force(b.size());
......@@ -115,8 +119,11 @@ std::unique_ptr<Process> createLiquidFlowProcess(
checkMPLProperties(mesh, *media_map);
DBUG("Media properties verified.");
LiquidFlowData process_data{std::move(media_map),
std::move(specific_body_force), has_gravity};
LiquidFlowData process_data{
std::move(media_map),
MeshLib::getElementRotationMatrices(
mesh_space_dimension, mesh.getDimension(), mesh.getElements()),
mesh_space_dimension, std::move(specific_body_force), has_gravity};
return std::make_unique<LiquidFlowProcess>(
std::move(name), mesh, std::move(jacobian_assembler), parameters,
......
......@@ -26,6 +26,12 @@ struct LiquidFlowData final
{
std::unique_ptr<MaterialPropertyLib::MaterialSpatialDistributionMap>
media_map;
/// A vector of the rotation matrices for all elements.
std::vector<Eigen::MatrixXd> const element_rotation_matrices;
int const mesh_space_dimension;
Eigen::VectorXd const specific_body_force;
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