Skip to content

Commit

Permalink
Merge branch 'refactorings' into 'master'
Browse files Browse the repository at this point in the history
Refactored ProcessLib::getIntegrationPointMetaData

See merge request ogs/ogs!4026
  • Loading branch information
endJunction committed Mar 11, 2022
2 parents 2a5abcb + 96f5a7c commit 0017565
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 16 deletions.
3 changes: 2 additions & 1 deletion ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ void HydroMechanicsProcess<DisplacementDim>::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
9 changes: 4 additions & 5 deletions ProcessLib/Output/IntegrationPointWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ void addIntegrationPointDataToMesh(
}
}

IntegrationPointMetaData getIntegrationPointMetaData(MeshLib::Mesh const& mesh,
std::string const& name)
IntegrationPointMetaData getIntegrationPointMetaData(
MeshLib::Properties const& properties, std::string const& name)
{
if (!mesh.getProperties().existsPropertyVector<char>(
"IntegrationPointMetaData"))
if (!properties.existsPropertyVector<char>("IntegrationPointMetaData"))
{
OGS_FATAL(
"Integration point data '{:s}' is present in the vtk field data "
Expand All @@ -118,7 +117,7 @@ IntegrationPointMetaData getIntegrationPointMetaData(MeshLib::Mesh const& mesh,
name);
}
auto const& mesh_property_ip_meta_data =
*mesh.getProperties().template getPropertyVector<char>(
*properties.template getPropertyVector<char>(
"IntegrationPointMetaData");

if (mesh_property_ip_meta_data.getMeshItemType() !=
Expand Down
5 changes: 3 additions & 2 deletions ProcessLib/Output/IntegrationPointWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
namespace MeshLib
{
class Mesh;
class Properties;
}

namespace ProcessLib
Expand Down Expand Up @@ -92,6 +93,6 @@ struct IntegrationPointMetaData
/// Returns integration point meta data for the given field name.
///
/// The data is read from a JSON encoded string stored in field data array.
IntegrationPointMetaData getIntegrationPointMetaData(MeshLib::Mesh const& mesh,
std::string const& name);
IntegrationPointMetaData getIntegrationPointMetaData(
MeshLib::Properties const& properties, std::string const& name);
} // namespace ProcessLib
3 changes: 2 additions & 1 deletion ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ void RichardsMechanicsProcess<DisplacementDim>::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
3 changes: 2 additions & 1 deletion ProcessLib/SmallDeformation/SmallDeformationProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ void SmallDeformationProcess<DisplacementDim>::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ void SmallDeformationNonlocalProcess<DisplacementDim>::
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
3 changes: 2 additions & 1 deletion ProcessLib/TH2M/TH2MProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ void TH2MProcess<DisplacementDim>::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ void ThermoHydroMechanicsProcess<DisplacementDim>::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
3 changes: 2 additions & 1 deletion ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ void ThermoMechanicsProcess<DisplacementDim>::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
3 changes: 2 additions & 1 deletion ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void ThermoRichardsFlowProcess::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ void ThermoRichardsMechanicsProcess<DisplacementDim>::initializeConcreteProcess(
continue;
}

auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
auto const ip_meta_data =
getIntegrationPointMetaData(mesh.getProperties(), name);

// Check the number of components.
if (ip_meta_data.n_components !=
Expand Down

0 comments on commit 0017565

Please sign in to comment.