Skip to content

Commit

Permalink
[PL] Always remove _ip suffix in setIPDataICs
Browse files Browse the repository at this point in the history
From now on all functions using the generalized setIPDataInitialConditions
must remove the _ip suffix in the local assembler's setIPDataInitialConditions.
  • Loading branch information
endJunction committed Jan 18, 2024
1 parent 2c5b01f commit 4298856
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 30 deletions.
6 changes: 3 additions & 3 deletions ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ std::size_t HydroMechanicsLocalAssembler<
_element.getID());
}

if (name == "sigma_ip")
if (name == "sigma")
{
if (_process_data.initial_stress != nullptr)
{
Expand All @@ -1075,13 +1075,13 @@ std::size_t HydroMechanicsLocalAssembler<
values, _ip_data, &IpData::sigma_eff);
}

if (name == "epsilon_ip")
if (name == "epsilon")
{
return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
values, _ip_data, &IpData::eps);
}

if (name == "strain_rate_variable_ip")
if (name == "strain_rate_variable")
{
return ProcessLib::setIntegrationPointScalarData(
values, _ip_data, &IpData::strain_rate_variable);
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/LargeDeformation/LargeDeformationProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ void LargeDeformationProcess<DisplacementDim>::initializeConcreteProcess(
_process_data.solid_materials, _local_assemblers,
_integration_point_writer, integration_order);

bool const remove_name_suffix = true;
setIPDataInitialConditions(_integration_point_writer, mesh.getProperties(),
_local_assemblers, remove_name_suffix);
_local_assemblers);

// Initialize local assemblers after all variables have been set.
GlobalExecutor::executeMemberOnDereferenced(
Expand Down
16 changes: 8 additions & 8 deletions ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ std::size_t RichardsMechanicsLocalAssembler<
_element.getID());
}

if (name == "sigma_ip")
if (name == "sigma")
{
if (_process_data.initial_stress != nullptr)
{
Expand All @@ -223,34 +223,34 @@ std::size_t RichardsMechanicsLocalAssembler<
values, _ip_data, &IpData::sigma_eff);
}

if (name == "saturation_ip")
if (name == "saturation")
{
return ProcessLib::setIntegrationPointScalarData(values, _ip_data,
&IpData::saturation);
}
if (name == "porosity_ip")
if (name == "porosity")
{
return ProcessLib::setIntegrationPointScalarData(values, _ip_data,
&IpData::porosity);
}
if (name == "transport_porosity_ip")
if (name == "transport_porosity")
{
return ProcessLib::setIntegrationPointScalarData(
values, _ip_data, &IpData::transport_porosity);
}
if (name == "swelling_stress_ip")
if (name == "swelling_stress")
{
return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
values, _ip_data, &IpData::sigma_sw);
}
if (name == "epsilon_ip")
if (name == "epsilon")
{
return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
values, _ip_data, &IpData::eps);
}
if (name.starts_with("material_state_variable_") && name.ends_with("_ip"))
if (name.starts_with("material_state_variable_"))
{
std::string const variable_name = name.substr(24, name.size() - 24 - 3);
std::string const variable_name = name.substr(24, name.size() - 24);

// Using first ip data for solid material. TODO (naumov) move solid
// material into element, store only material state in IPs.
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/SmallDeformation/SmallDeformationProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ void SmallDeformationProcess<DisplacementDim>::initializeConcreteProcess(
_process_data.solid_materials, _local_assemblers,
_integration_point_writer, integration_order);

bool const remove_name_suffix = true;
setIPDataInitialConditions(_integration_point_writer, mesh.getProperties(),
_local_assemblers, remove_name_suffix);
_local_assemblers);

// Initialize local assemblers after all variables have been set.
GlobalExecutor::executeMemberOnDereferenced(
Expand Down
3 changes: 1 addition & 2 deletions ProcessLib/TH2M/TH2MProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,8 @@ void TH2MProcess<DisplacementDim>::initializeConcreteProcess(
const_cast<MeshLib::Mesh&>(mesh), "temperature_interpolated",
MeshLib::MeshItemType::Node, 1);

bool const remove_name_suffix = true;
setIPDataInitialConditions(_integration_point_writer, mesh.getProperties(),
local_assemblers_, remove_name_suffix);
local_assemblers_);

// Initialize local assemblers after all variables have been set.
GlobalExecutor::executeMemberOnDereferenced(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ std::size_t ThermoHydroMechanicsLocalAssembler<
_element.getID());
}

if (name == "sigma_ip")
if (name == "sigma")
{
if (_process_data.initial_stress != nullptr)
{
Expand All @@ -134,7 +134,7 @@ std::size_t ThermoHydroMechanicsLocalAssembler<
return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
values, _ip_data, &IpData::sigma_eff);
}
if (name == "epsilon_ip")
if (name == "epsilon")
{
return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
values, _ip_data, &IpData::eps);
Expand Down
6 changes: 3 additions & 3 deletions ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ std::size_t ThermoMechanicsLocalAssembler<ShapeFunction, DisplacementDim>::
_element.getID());
}

if (name == "sigma_ip")
if (name == "sigma")
{
return setSigma(values);
}
if (name == "epsilon_ip")
if (name == "epsilon")
{
return setEpsilon(values);
}
if (name == "epsilon_m_ip")
if (name == "epsilon_m")
{
return setEpsilonMechanical(values);
}
Expand Down
4 changes: 2 additions & 2 deletions ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowFEM-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ std::size_t ThermoRichardsFlowLocalAssembler<ShapeFunction, GlobalDim>::
_element.getID());
}

if (name == "saturation_ip")
if (name == "saturation")
{
return ProcessLib::setIntegrationPointScalarData(values, _ip_data,
&IpData::saturation);
}
if (name == "porosity_ip")
if (name == "porosity")
{
return ProcessLib::setIntegrationPointScalarData(values, _ip_data,
&IpData::porosity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ void ThermoRichardsMechanicsProcess<DisplacementDim, ConstitutiveTraits>::
const_cast<MeshLib::Mesh&>(mesh), "temperature_interpolated",
MeshLib::MeshItemType::Node, 1);

bool const remove_name_suffix = true;
setIPDataInitialConditions(_integration_point_writer, mesh.getProperties(),
local_assemblers_, remove_name_suffix);
local_assemblers_);

// Initialize local assemblers after all variables have been set.
GlobalExecutor::executeMemberOnDereferenced(&LocalAssemblerIF::initialize,
Expand Down
6 changes: 2 additions & 4 deletions ProcessLib/Utils/SetIPDataInitialConditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ void setIPDataInitialConditions(
std::vector<std::unique_ptr<MeshLib::IntegrationPointWriter>> const&
_integration_point_writer,
MeshLib::Properties const& mesh_properties,
LocalAssemblersVector& local_assemblers,
bool const remove_name_suffix = false)
LocalAssemblersVector& local_assemblers)
{
for (auto const& ip_writer : _integration_point_writer)
{
Expand Down Expand Up @@ -72,8 +71,7 @@ void setIPDataInitialConditions(

INFO("Setting initial integration point data for '{}'", name);

auto const& name_transformed =
remove_name_suffix ? removeIPFieldDataNameSuffix(name) : name;
auto const& name_transformed = removeIPFieldDataNameSuffix(name);

// Now we have a properly named vtk's field data array and the
// corresponding meta data.
Expand Down

0 comments on commit 4298856

Please sign in to comment.