From 42988562db2f118bc57b0d53b04ff82f06ad1a6b Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Fri, 12 Jan 2024 16:21:03 +0100 Subject: [PATCH] [PL] Always remove _ip suffix in setIPDataICs From now on all functions using the generalized setIPDataInitialConditions must remove the _ip suffix in the local assembler's setIPDataInitialConditions. --- .../HydroMechanics/HydroMechanicsFEM-impl.h | 6 +++--- .../LargeDeformation/LargeDeformationProcess.cpp | 3 +-- .../RichardsMechanicsFEM-impl.h | 16 ++++++++-------- .../SmallDeformation/SmallDeformationProcess.cpp | 3 +-- ProcessLib/TH2M/TH2MProcess.cpp | 3 +-- .../ThermoHydroMechanicsFEM-impl.h | 4 ++-- .../ThermoMechanics/ThermoMechanicsFEM-impl.h | 6 +++--- .../ThermoRichardsFlowFEM-impl.h | 4 ++-- .../ThermoRichardsMechanicsProcess.cpp | 3 +-- ProcessLib/Utils/SetIPDataInitialConditions.h | 6 ++---- 10 files changed, 24 insertions(+), 30 deletions(-) diff --git a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h index a58161a5b47..7f4d723cdc1 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h +++ b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h @@ -1060,7 +1060,7 @@ std::size_t HydroMechanicsLocalAssembler< _element.getID()); } - if (name == "sigma_ip") + if (name == "sigma") { if (_process_data.initial_stress != nullptr) { @@ -1075,13 +1075,13 @@ std::size_t HydroMechanicsLocalAssembler< values, _ip_data, &IpData::sigma_eff); } - if (name == "epsilon_ip") + if (name == "epsilon") { return ProcessLib::setIntegrationPointKelvinVectorData( 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); diff --git a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp index c1abe5156c3..02a03237ac8 100644 --- a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp +++ b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp @@ -119,9 +119,8 @@ void LargeDeformationProcess::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( diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h index 3c081fc93e9..2cd2acbc576 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM-impl.h @@ -209,7 +209,7 @@ std::size_t RichardsMechanicsLocalAssembler< _element.getID()); } - if (name == "sigma_ip") + if (name == "sigma") { if (_process_data.initial_stress != nullptr) { @@ -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( values, _ip_data, &IpData::sigma_sw); } - if (name == "epsilon_ip") + if (name == "epsilon") { return ProcessLib::setIntegrationPointKelvinVectorData( 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. diff --git a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp index e90f3a85051..d6f2bfbe259 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp @@ -121,9 +121,8 @@ void SmallDeformationProcess::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( diff --git a/ProcessLib/TH2M/TH2MProcess.cpp b/ProcessLib/TH2M/TH2MProcess.cpp index 49e6ec8f1c8..c097a0d0a26 100644 --- a/ProcessLib/TH2M/TH2MProcess.cpp +++ b/ProcessLib/TH2M/TH2MProcess.cpp @@ -310,9 +310,8 @@ void TH2MProcess::initializeConcreteProcess( const_cast(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( diff --git a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h index a7b84efd8b4..9d91ed0ca9e 100644 --- a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h +++ b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h @@ -120,7 +120,7 @@ std::size_t ThermoHydroMechanicsLocalAssembler< _element.getID()); } - if (name == "sigma_ip") + if (name == "sigma") { if (_process_data.initial_stress != nullptr) { @@ -134,7 +134,7 @@ std::size_t ThermoHydroMechanicsLocalAssembler< return ProcessLib::setIntegrationPointKelvinVectorData( values, _ip_data, &IpData::sigma_eff); } - if (name == "epsilon_ip") + if (name == "epsilon") { return ProcessLib::setIntegrationPointKelvinVectorData( values, _ip_data, &IpData::eps); diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h index 61da2353a35..61187376a9a 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM-impl.h @@ -95,15 +95,15 @@ std::size_t ThermoMechanicsLocalAssembler:: _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); } diff --git a/ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowFEM-impl.h b/ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowFEM-impl.h index f2c61895f9b..a7b71707fe0 100644 --- a/ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowFEM-impl.h +++ b/ProcessLib/ThermoRichardsFlow/ThermoRichardsFlowFEM-impl.h @@ -94,12 +94,12 @@ std::size_t ThermoRichardsFlowLocalAssembler:: _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); diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp index 1b3c453ac6c..ed52b421283 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp @@ -187,9 +187,8 @@ void ThermoRichardsMechanicsProcess:: const_cast(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, diff --git a/ProcessLib/Utils/SetIPDataInitialConditions.h b/ProcessLib/Utils/SetIPDataInitialConditions.h index c6188389811..766d3a5a40b 100644 --- a/ProcessLib/Utils/SetIPDataInitialConditions.h +++ b/ProcessLib/Utils/SetIPDataInitialConditions.h @@ -35,8 +35,7 @@ void setIPDataInitialConditions( std::vector> 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) { @@ -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.