From 0e5c9184df34048c94e2d329ceb2aba27c7ac155 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 23 Apr 2024 12:20:08 +0200 Subject: [PATCH 01/21] [PL] Added generic cell average output functionalty --- ProcessLib/Output/CellAverageData.cpp | 59 ++++++++++++++++++ ProcessLib/Output/CellAverageData.h | 87 +++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 ProcessLib/Output/CellAverageData.cpp create mode 100644 ProcessLib/Output/CellAverageData.h diff --git a/ProcessLib/Output/CellAverageData.cpp b/ProcessLib/Output/CellAverageData.cpp new file mode 100644 index 00000000000..1e46fa1a4cf --- /dev/null +++ b/ProcessLib/Output/CellAverageData.cpp @@ -0,0 +1,59 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#include "CellAverageData.h" + +#include "MeshLib/Utils/getOrCreateMeshProperty.h" + +namespace ProcessLib +{ +MeshLib::PropertyVector& CellAverageData::getOrCreatePropertyVector( + std::string const& name, unsigned const num_comp) +{ + if (auto const it = cell_averages_.find(name); it != cell_averages_.end()) + { + auto& prop_vec = *it->second; + auto const num_comp_mesh = prop_vec.getNumberOfGlobalComponents(); + if (num_comp_mesh == static_cast(num_comp)) + { + return prop_vec; + } + + OGS_FATAL( + "The requested property '{}' has {} components, but the one " + "present in the mesh has {} components.", + name, num_comp, num_comp_mesh); + } + + auto const name_in_mesh = name + "_avg"; + auto [it, emplaced] = cell_averages_.emplace( + name, MeshLib::getOrCreateMeshProperty( + const_cast(mesh_), name_in_mesh, + MeshLib::MeshItemType::Cell, num_comp)); + + if (!it->second) + { + OGS_FATAL("The cell property '{}' could not be added to the mesh.", + name_in_mesh); + } + + if (!emplaced) + { + OGS_FATAL( + "Internal logic error. Something very bad happened. The cell " + "property '{}' was not added to the list of cell averages to " + "compute. There is some very strange inconsistency in the " + "code. Trouble ahead!", + name_in_mesh); + } + + return *it->second; +} +} // namespace ProcessLib diff --git a/ProcessLib/Output/CellAverageData.h b/ProcessLib/Output/CellAverageData.h new file mode 100644 index 00000000000..3f8be132048 --- /dev/null +++ b/ProcessLib/Output/CellAverageData.h @@ -0,0 +1,87 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include "MeshLib/Mesh.h" +#include "MeshLib/PropertyVector.h" +#include "ProcessLib/Reflection/ReflectionIPData.h" + +namespace ProcessLib +{ +struct CellAverageData +{ + explicit CellAverageData(MeshLib::Mesh& mesh) : mesh_{mesh} {} + + template + void computeSecondaryVariable( + int const dim, + std::vector> const& local_assemblers) + { + auto const callback = + [this, &local_assemblers](std::string const& name, + unsigned const num_comp, + auto&& flattened_ip_data_accessor) + { + computeCellAverages(name, num_comp, flattened_ip_data_accessor, + local_assemblers); + }; + + if (dim == 2) + { + ProcessLib::Reflection:: + forEachReflectedFlattenedIPDataAccessor<2, LAIntf>( + LAIntf::getReflectionDataForOutput(), callback); + } + else if (dim == 3) + { + ProcessLib::Reflection:: + forEachReflectedFlattenedIPDataAccessor<3, LAIntf>( + LAIntf::getReflectionDataForOutput(), callback); + } + else + { + OGS_FATAL( + "Generic averaged output is only implemented for dimensions 2 " + "and 3 ATM. You requested dim = {}.", + dim); + } + } + +private: + MeshLib::PropertyVector& getOrCreatePropertyVector( + std::string const& name, unsigned const num_comp); + + void computeCellAverages(std::string const& name, + unsigned const num_comp, + auto&& flattened_ip_data_accessor, + auto const& local_assemblers) + { + auto& prop_vec = getOrCreatePropertyVector(name, num_comp); + + for (std::size_t i = 0; i < local_assemblers.size(); ++i) + { + auto const& loc_asm = *local_assemblers[i]; + auto const& ip_data = flattened_ip_data_accessor(loc_asm); + assert(ip_data.size() % num_comp == 0); + auto const num_ips = + static_cast(ip_data.size() / num_comp); + Eigen::Map ip_data_mapped{ip_data.data(), + num_comp, num_ips}; + + Eigen::Map{&prop_vec[i * num_comp], num_comp} = + ip_data_mapped.rowwise().mean(); + } + } + + MeshLib::Mesh const& mesh_; + std::map*> cell_averages_; +}; +} // namespace ProcessLib From fc772aa912e304e2b0aebc02025d0671b062a41e Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 23 Apr 2024 12:19:41 +0200 Subject: [PATCH 02/21] [PL/TRM] Use generic averaging in TRM --- .../ThermoRichardsMechanicsFEM-impl.h | 30 ------------------- .../ThermoRichardsMechanicsProcess.cpp | 26 ++-------------- .../ThermoRichardsMechanicsProcessData.h | 5 ---- 3 files changed, 3 insertions(+), 58 deletions(-) diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h index f76508b2bc1..3a9c9776320 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h @@ -541,14 +541,6 @@ void ThermoRichardsMechanicsLocalAssemblerintegration_method_.getNumberOfPoints(); - double saturation_avg = 0; - double porosity_avg = 0; - double liquid_density_avg = 0; - double viscosity_avg = 0; - - using KV = MathLib::KelvinVector::KelvinVectorType; - KV sigma_avg = KV::Zero(); - typename ConstitutiveTraits::ConstitutiveSetting constitutive_setting; auto models = ConstitutiveTraits::createConstitutiveModels( @@ -603,29 +595,7 @@ void ThermoRichardsMechanicsLocalAssemblerprev_states_[ip], this->material_states_[ip], tmp, output_data, CD); - - saturation_avg += std::get(current_state).S_L; - porosity_avg += std::get(current_state).phi; - - liquid_density_avg += std::get(output_data).rho_LR; - viscosity_avg += std::get(output_data).viscosity; - sigma_avg += ConstitutiveTraits::ConstitutiveSetting::statefulStress( - current_state); } - saturation_avg /= n_integration_points; - porosity_avg /= n_integration_points; - viscosity_avg /= n_integration_points; - liquid_density_avg /= n_integration_points; - sigma_avg /= n_integration_points; - - (*process_data.element_saturation)[e_id] = saturation_avg; - (*process_data.element_porosity)[e_id] = porosity_avg; - (*process_data.element_liquid_density)[e_id] = liquid_density_avg; - (*process_data.element_viscosity)[e_id] = viscosity_avg; - - Eigen::Map( - &(*process_data.element_stresses)[e_id * KV::RowsAtCompileTime]) = - MathLib::KelvinVector::kelvinVectorToSymmetricTensor(sigma_avg); NumLib::interpolateToHigherOrderNodes< ShapeFunction, typename ShapeFunctionDisplacement::MeshElement, diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp index b2961f64854..194cc0cc1b1 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp @@ -156,29 +156,6 @@ void ThermoRichardsMechanicsProcess:: process_data_.solid_materials, local_assemblers_, _integration_point_writer, integration_order); - process_data_.element_saturation = MeshLib::getOrCreateMeshProperty( - const_cast(mesh), "saturation_avg", - MeshLib::MeshItemType::Cell, 1); - - process_data_.element_porosity = MeshLib::getOrCreateMeshProperty( - const_cast(mesh), "porosity_avg", - MeshLib::MeshItemType::Cell, 1); - - process_data_.element_liquid_density = - MeshLib::getOrCreateMeshProperty( - const_cast(mesh), "liquid_density_avg", - MeshLib::MeshItemType::Cell, 1); - - process_data_.element_viscosity = MeshLib::getOrCreateMeshProperty( - const_cast(mesh), "viscosity_avg", - MeshLib::MeshItemType::Cell, 1); - - process_data_.element_stresses = MeshLib::getOrCreateMeshProperty( - const_cast(mesh), "stress_avg", - MeshLib::MeshItemType::Cell, - MathLib::KelvinVector::KelvinVectorType< - DisplacementDim>::RowsAtCompileTime); - process_data_.pressure_interpolated = MeshLib::getOrCreateMeshProperty( const_cast(mesh), "pressure_interpolated", @@ -309,6 +286,9 @@ void ThermoRichardsMechanicsProcess:: &LocalAssemblerIF::computeSecondaryVariable, local_assemblers_, pv.getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev, process_id); + + cell_average_data_.computeSecondaryVariable(DisplacementDim, + local_assemblers_); } template diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcessData.h b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcessData.h index b7933599c8f..b01f9d61280 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcessData.h +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcessData.h @@ -55,11 +55,6 @@ struct ThermoRichardsMechanicsProcessData InitializePorosityFromMediumProperty const initialize_porosity_from_medium_property; - MeshLib::PropertyVector* element_saturation = nullptr; - MeshLib::PropertyVector* element_porosity = nullptr; - MeshLib::PropertyVector* element_liquid_density = nullptr; - MeshLib::PropertyVector* element_viscosity = nullptr; - MeshLib::PropertyVector* element_stresses = nullptr; MeshLib::PropertyVector* temperature_interpolated = nullptr; MeshLib::PropertyVector* pressure_interpolated = nullptr; From 61b59f4efee924940a98e882bce90c8c8c80f591 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 23 Apr 2024 13:01:18 +0200 Subject: [PATCH 03/21] [PL] Store generic averager in generic Process --- ProcessLib/Process.cpp | 1 + ProcessLib/Process.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ProcessLib/Process.cpp b/ProcessLib/Process.cpp index 98ed6566750..9e9277e0169 100644 --- a/ProcessLib/Process.cpp +++ b/ProcessLib/Process.cpp @@ -54,6 +54,7 @@ Process::Process( : name(std::move(name_)), _mesh(mesh), _secondary_variables(std::move(secondary_variables)), + cell_average_data_(mesh), _jacobian_assembler(std::move(jacobian_assembler)), _global_assembler(*_jacobian_assembler), _use_monolithic_scheme(use_monolithic_scheme), diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h index 1816b836668..be39d2bcb13 100644 --- a/ProcessLib/Process.h +++ b/ProcessLib/Process.h @@ -21,6 +21,7 @@ #include "ParameterLib/Parameter.h" #include "ProcessLib/BoundaryConditionAndSourceTerm/BoundaryConditionCollection.h" #include "ProcessLib/BoundaryConditionAndSourceTerm/SourceTermCollection.h" +#include "ProcessLib/Output/CellAverageData.h" #include "ProcessLib/Output/ExtrapolatorData.h" #include "ProcessLib/Output/SecondaryVariable.h" #include "ProcessVariable.h" @@ -361,6 +362,8 @@ class Process SecondaryVariableCollection _secondary_variables; + CellAverageData cell_average_data_; + // TODO (CL) switch to the parallel vector matrix assembler here, once // feature complete, or use the assembly mixin and remove these two members. std::unique_ptr _jacobian_assembler; From 3557e292bd91b33c12c19219854c7f519bbd8fba Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 23 Apr 2024 17:07:26 +0200 Subject: [PATCH 04/21] [PL/LD] Use generic cell average output --- ProcessLib/LargeDeformation/LargeDeformationProcess.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp index f19707a2dc2..208ced81ebf 100644 --- a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp +++ b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp @@ -207,6 +207,9 @@ void LargeDeformationProcess::computeSecondaryVariableConcrete( GlobalExecutor::executeSelectedMemberOnDereferenced( &LocalAssemblerInterface::computeSecondaryVariable, _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id); + + cell_average_data_.computeSecondaryVariable(DisplacementDim, + _local_assemblers); } template class LargeDeformationProcess<2>; template class LargeDeformationProcess<3>; From a681d6cf1bae2cbf5eb7eda46e2ed6af3bbee84e Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 23 Apr 2024 17:08:00 +0200 Subject: [PATCH 05/21] [PL/SD] Use generic cell average output --- ProcessLib/SmallDeformation/SmallDeformationProcess.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp index 2b6223c5524..dc8412bdc60 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp @@ -216,6 +216,9 @@ void SmallDeformationProcess::computeSecondaryVariableConcrete( GlobalExecutor::executeSelectedMemberOnDereferenced( &LocalAssemblerInterface::computeSecondaryVariable, _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id); + + cell_average_data_.computeSecondaryVariable(DisplacementDim, + _local_assemblers); } template class SmallDeformationProcess<2>; template class SmallDeformationProcess<3>; From d080d9424934b124eeae660b432921d85d23f4cd Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 11:45:24 +0200 Subject: [PATCH 06/21] [PL/TH2M] Use generic cell average output --- ProcessLib/TH2M/TH2MFEM-impl.h | 13 ------------- ProcessLib/TH2M/TH2MProcess.cpp | 7 +++---- ProcessLib/TH2M/TH2MProcessData.h | 1 - 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/ProcessLib/TH2M/TH2MFEM-impl.h b/ProcessLib/TH2M/TH2MFEM-impl.h index 154248a716b..42d127276f9 100644 --- a/ProcessLib/TH2M/TH2MFEM-impl.h +++ b/ProcessLib/TH2M/TH2MFEM-impl.h @@ -1910,23 +1910,10 @@ void TH2MLocalAssemblerprocess_data_.temperature_interpolated); - unsigned const n_integration_points = - this->integration_method_.getNumberOfPoints(); - - double saturation_avg = 0; - ConstitutiveRelations::ConstitutiveModels const models{ this->solid_material_, *this->process_data_.phase_transition_model_}; updateConstitutiveVariables(local_x, local_x_prev, t, dt, models); - - for (unsigned ip = 0; ip < n_integration_points; ip++) - { - saturation_avg += this->current_states_[ip].S_L_data.S_L; - } - saturation_avg /= n_integration_points; - (*this->process_data_.element_saturation)[this->element_.getID()] = - saturation_avg; } } // namespace TH2M diff --git a/ProcessLib/TH2M/TH2MProcess.cpp b/ProcessLib/TH2M/TH2MProcess.cpp index b3289ca9d14..dc583602d1d 100644 --- a/ProcessLib/TH2M/TH2MProcess.cpp +++ b/ProcessLib/TH2M/TH2MProcess.cpp @@ -175,10 +175,6 @@ void TH2MProcess::initializeConcreteProcess( _process_data.solid_materials, local_assemblers_, _integration_point_writer, integration_order); - _process_data.element_saturation = MeshLib::getOrCreateMeshProperty( - const_cast(mesh), "saturation_avg", - MeshLib::MeshItemType::Cell, 1); - _process_data.gas_pressure_interpolated = MeshLib::getOrCreateMeshProperty( const_cast(mesh), "gas_pressure_interpolated", @@ -320,6 +316,9 @@ void TH2MProcess::computeSecondaryVariableConcrete( &LocalAssemblerInterface::computeSecondaryVariable, local_assemblers_, pv.getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev, process_id); + + cell_average_data_.computeSecondaryVariable(DisplacementDim, + local_assemblers_); } template diff --git a/ProcessLib/TH2M/TH2MProcessData.h b/ProcessLib/TH2M/TH2MProcessData.h index 8aa138d9758..e23f42d8cff 100644 --- a/ProcessLib/TH2M/TH2MProcessData.h +++ b/ProcessLib/TH2M/TH2MProcessData.h @@ -52,7 +52,6 @@ struct TH2MProcessData const bool use_TaylorHood_elements; - MeshLib::PropertyVector* element_saturation = nullptr; MeshLib::PropertyVector* gas_pressure_interpolated = nullptr; MeshLib::PropertyVector* capillary_pressure_interpolated = nullptr; MeshLib::PropertyVector* temperature_interpolated = nullptr; From 241a27373ff1d05097acf934145cd00db53fa190 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 09:08:42 +0200 Subject: [PATCH 07/21] [T] Added comments and made ctor private --- Tests/ProcessLib/TestReflectIPData.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index 5ace325219c..0c5519d905d 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -251,6 +251,7 @@ std::vector initKelvin(LocAsmIF& loc_asm, for (std::size_t ip = 0; ip < num_int_pts; ++ip) { ip_data_accessor(loc_asm, ip) = + // the local assembler stores Kelvin vector data... MathLib::KelvinVector::symmetricTensorToKelvinVector( Eigen::Vector::LinSpaced( kv_size, ip * kv_size + start_value, @@ -268,6 +269,7 @@ std::vector initKelvin(LocAsmIF& loc_asm, } // prepare reference data + // ... the reference data used in the tests is not Kelvin-mapped! std::vector vector_expected(num_int_pts * kv_size); iota(begin(vector_expected), end(vector_expected), start_value); return vector_expected; @@ -329,6 +331,10 @@ std::vector initMatrix(LocAsmIF& loc_asm, template struct ReferenceData { +private: + ReferenceData() = default; + +public: std::vector scalar; std::vector vector; std::vector kelvin; @@ -348,6 +354,8 @@ struct ReferenceData std::vector scalar2b; std::vector scalar3b; + // Computes reference data and initializes the internal (integration point) + // data of the passed \c loc_asm. static ReferenceData create(LocAsmIF& loc_asm, bool const for_read_test) { @@ -583,7 +591,8 @@ TYPED_TEST(ProcessLib_ReflectIPData, WriteTest) auto const ref = ReferenceData::create(loc_asm, false); - // data getters - used for checks ////////////////////////////////////////// + // set up data getters - used for checks /////////////////////////////////// + // that critically relies on the read test above being successful! std::map> map_name_to_num_comp_and_function; @@ -618,9 +627,13 @@ TYPED_TEST(ProcessLib_ReflectIPData, WriteTest) "failed for ip data with name '" << name << "'"; + // function under test ///////////////////////////////////////////////// + auto const size = ProcessLib::Reflection::reflectSetIPData( name, values_plain.data(), loc_asm.ip_data_level1); + // end function under test ///////////////////////////////////////////// + EXPECT_EQ(size_expected, size) << "Unexpected size obtained for ip data with name '" << name << "'"; From c2182f916443ea592885f6aef9c0726461916ff6 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 09:09:28 +0200 Subject: [PATCH 08/21] [T] Added cell average unit test --- Tests/ProcessLib/TestReflectIPData.cpp | 122 +++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index 0c5519d905d..94b3c17d2a7 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -14,6 +14,8 @@ #include #include +#include "MeshToolsLib/MeshGenerators/MeshGenerator.h" +#include "ProcessLib/Output/CellAverageData.h" #include "ProcessLib/Reflection/ReflectionIPData.h" #include "ProcessLib/Reflection/ReflectionSetIPData.h" @@ -130,6 +132,8 @@ struct LocAsmIF makeReflectionData(&LocAsmIF::ip_data_level1), makeReflectionData(&LocAsmIF::ip_data_level1b)}; } + + static auto getReflectionDataForOutput() { return reflect(); } }; template @@ -700,3 +704,121 @@ TYPED_TEST(ProcessLib_ReflectIPData, RawDataTypes) static_assert( !PRD::is_raw_data>::value); } + +TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) +{ + constexpr int dim = TypeParam::value; + auto constexpr kv_size = + MathLib::KelvinVector::kelvin_vector_dimensions(dim); + + using LocAsm = LocAsmIF; + + std::size_t const num_int_pts = 8; + std::vector> loc_asms; + loc_asms.push_back(std::make_unique(num_int_pts)); + auto& loc_asm = *loc_asms.front(); + + std::unique_ptr mesh{ + MeshToolsLib::MeshGenerator::generateLineMesh(1.0, 1)}; + + auto const ref = ReferenceData::create(*loc_asms.front(), true); + + // compute cell average reference data ///////////////////////////////////// + + std::map> map_name_to_cell_average; + + ProcessLib::Reflection::forEachReflectedFlattenedIPDataAccessor( + LocAsm::reflect(), + [&loc_asm, &map_name_to_cell_average](std::string const& name, + unsigned const num_comp, + auto&& double_vec_from_loc_asm) + { + auto [it, emplaced] = + map_name_to_cell_average.emplace(name, num_comp); + + EXPECT_TRUE(emplaced) + << '\'' << name + << "' seems to exist twice in the reflection data."; + + auto const& ip_data = double_vec_from_loc_asm(loc_asm); + ASSERT_EQ(num_int_pts * num_comp, ip_data.size()); + + // TODO this implementation in the unit test might be too close to + // the production code. In fact, it's almost the same code. + + // each integration point corresponds to a column in the mapped + // matrix, vector components/matrix entries are stored contiguously + // in memory. + Eigen::Map> + ip_data_mat{ip_data.data(), num_comp, num_int_pts}; + + Eigen::Map cell_avg_vec{it->second.data(), + num_comp}; + + cell_avg_vec = ip_data_mat.rowwise().mean(); + }); + + // function under test ///////////////////////////////////////////////////// + + ProcessLib::CellAverageData cell_average_data{*mesh}; + cell_average_data.computeSecondaryVariable(dim, loc_asms); + + // checks ////////////////////////////////////////////////////////////////// + + auto check = [&map_name_to_cell_average, &mesh]( + std::string const& name, unsigned const num_comp_expected) + { + auto const it = map_name_to_cell_average.find(name); + + ASSERT_NE(map_name_to_cell_average.end(), it) + << "No cell average reference data found for data with name '" + << name << "'"; + + auto const& cell_avg_expected = it->second; + + auto const& props = mesh->getProperties(); + + ASSERT_TRUE(props.existsPropertyVector(name + "_avg")) + << "Property vector '" << name + "_avg" + << "' does not exist in the mesh."; + + auto const& cell_avg_actual = + *props.getPropertyVector(name + "_avg"); + + ASSERT_EQ(MeshLib::MeshItemType::Cell, + cell_avg_actual.getMeshItemType()); + ASSERT_EQ(mesh->getNumberOfElements(), + cell_avg_actual.getNumberOfTuples()); + ASSERT_EQ(num_comp_expected, + cell_avg_actual.getNumberOfGlobalComponents()); + + EXPECT_THAT(cell_avg_actual, + testing::Pointwise(testing::DoubleEq(), cell_avg_expected)) + << "Values differ for cell average data with name '" << name << "'"; + }; + + // level 0 + check("scalar", 1); + check("vector", dim); + check("kelvin", kv_size); + + // level 1 + check("scalar1", 1); + check("vector1", dim); + check("kelvin1", kv_size); + + // level 3 + check("scalar3", 1); + check("vector3", dim); + check("kelvin3", kv_size); + check("matrix3", dim * 4); + check("matrix3_1", dim * 4); + check("matrix3_2", 4); + + // b levels + check("scalar1b", 1); + check("scalar2b", 1); + check("scalar3b", 1); +} From 41232b3e5961e758ed762589922e5f1645c96ac9 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 09:47:50 +0200 Subject: [PATCH 09/21] [T] Added a unit test for IP writers --- Tests/ProcessLib/TestReflectIPData.cpp | 73 ++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index 94b3c17d2a7..de6defddafe 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -16,6 +16,7 @@ #include "MeshToolsLib/MeshGenerators/MeshGenerator.h" #include "ProcessLib/Output/CellAverageData.h" +#include "ProcessLib/Reflection/ReflectionForIPWriters.h" #include "ProcessLib/Reflection/ReflectionIPData.h" #include "ProcessLib/Reflection/ReflectionSetIPData.h" @@ -705,6 +706,78 @@ TYPED_TEST(ProcessLib_ReflectIPData, RawDataTypes) !PRD::is_raw_data>::value); } +TYPED_TEST(ProcessLib_ReflectIPData, IPWriterTest) +{ + constexpr int dim = TypeParam::value; + + using LocAsm = LocAsmIF; + + std::size_t const num_int_pts = 8; + std::vector> loc_asms; + loc_asms.push_back(std::make_unique(num_int_pts)); + auto& loc_asm = *loc_asms.front(); + + std::unique_ptr mesh{ + MeshToolsLib::MeshGenerator::generateLineMesh(1.0, 1)}; + + auto const ref = ReferenceData::create(*loc_asms.front(), true); + + // function under test ///////////////////////////////////////////////////// + + std::vector> + integration_point_writers; + constexpr int integration_order = 0xc0ffee; // dummy value + ProcessLib::Reflection::addReflectedIntegrationPointWriters( + LocAsm::getReflectionDataForOutput(), integration_point_writers, + integration_order, loc_asms); + + // this finally invokes the IP writers + MeshLib::addIntegrationPointDataToMesh(*mesh, integration_point_writers); + + // checks ////////////////////////////////////////////////////////////////// + + auto check = [&loc_asm, &mesh](std::string const& name, + std::size_t const num_int_pts, + std::vector const& values_expected) + { + auto const& props = mesh->getProperties(); + + ASSERT_TRUE(props.existsPropertyVector(name + "_ip")) + << "Property vector '" << name + "_ip" + << "' does not exist in the mesh."; + + ASSERT_EQ(0, values_expected.size() % num_int_pts); + auto const num_comp = values_expected.size() / num_int_pts; + + auto const& ip_data_actual = + *props.getPropertyVector(name + "_ip"); + + ASSERT_EQ(MeshLib::MeshItemType::IntegrationPoint, + ip_data_actual.getMeshItemType()); + ASSERT_EQ(mesh->getNumberOfElements() * num_int_pts, + ip_data_actual.getNumberOfTuples()); + ASSERT_EQ(num_comp, ip_data_actual.getNumberOfGlobalComponents()); + + EXPECT_THAT(ip_data_actual, + testing::Pointwise(testing::DoubleEq(), values_expected)) + << "Values differ for ip data with name '" << name << "'"; + }; + + check("scalar1", num_int_pts, ref.scalar1); + check("vector1", num_int_pts, ref.vector1); + check("kelvin1", num_int_pts, ref.kelvin1); + + check("scalar3", num_int_pts, ref.scalar3); + check("vector3", num_int_pts, ref.vector3); + check("kelvin3", num_int_pts, ref.kelvin3); + check("matrix3", num_int_pts, ref.matrix3); + check("matrix3_1", num_int_pts, ref.matrix3_1); + check("matrix3_2", num_int_pts, ref.matrix3_2); + + check("scalar2b", num_int_pts, ref.scalar2b); + check("scalar3b", num_int_pts, ref.scalar3b); +} + TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) { constexpr int dim = TypeParam::value; From 9607b7616c51c7a235b19e83ab101e39aee5425a Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 10:54:29 +0200 Subject: [PATCH 10/21] [T] Code deduplication --- Tests/ProcessLib/TestReflectIPData.cpp | 153 +++++++++++-------------- 1 file changed, 67 insertions(+), 86 deletions(-) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index de6defddafe..22ec80bad35 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -497,6 +497,45 @@ struct ReferenceData } }; +template +void checkAll(ReferenceData const& ref, auto&& checker, + bool const check_level_0_data = true) +{ + auto constexpr kv_size = + MathLib::KelvinVector::kelvin_vector_dimensions(dim); + + // The storage of "level 0 data" (i.e., non-reflected data directly in the + // local assembler, e.g. a std::vector of integration point data of + // a scalar value) is not compatible with the implemented IP data input + // logic. Therefore we don't test level 0 data in that case. + // This incompatibility is not a problem in practice, as such data is not + // used ATM in OGS's local assemblers. + if (check_level_0_data) + { + checker("scalar", 1, ref.scalar); + checker("vector", dim, ref.vector); + checker("kelvin", kv_size, ref.kelvin); + } + + // level 1 + checker("scalar1", 1, ref.scalar1); + checker("vector1", dim, ref.vector1); + checker("kelvin1", kv_size, ref.kelvin1); + + // level 3 + checker("scalar3", 1, ref.scalar3); + checker("vector3", dim, ref.vector3); + checker("kelvin3", kv_size, ref.kelvin3); + checker("matrix3", dim * 4, ref.matrix3); + checker("matrix3_1", dim * 4, ref.matrix3_1); + checker("matrix3_2", 4, ref.matrix3_2); + + // b levels + checker("scalar1b", 1, ref.scalar1b); + checker("scalar2b", 1, ref.scalar2b); + checker("scalar3b", 1, ref.scalar3b); +} + template struct ProcessLib_ReflectIPData : ::testing::Test { @@ -512,8 +551,6 @@ TYPED_TEST_SUITE(ProcessLib_ReflectIPData, ProcessLib_ReflectIPData_TestCases); TYPED_TEST(ProcessLib_ReflectIPData, ReadTest) { constexpr int dim = TypeParam::value; - auto constexpr kv_size = - MathLib::KelvinVector::kelvin_vector_dimensions(dim); using LocAsm = LocAsmIF; @@ -561,28 +598,7 @@ TYPED_TEST(ProcessLib_ReflectIPData, ReadTest) << "Values differ for ip data with name '" << name << "'"; }; - // level 0 - check("scalar", 1, ref.scalar); - check("vector", dim, ref.vector); - check("kelvin", kv_size, ref.kelvin); - - // level 1 - check("scalar1", 1, ref.scalar1); - check("vector1", dim, ref.vector1); - check("kelvin1", kv_size, ref.kelvin1); - - // level 3 - check("scalar3", 1, ref.scalar3); - check("vector3", dim, ref.vector3); - check("kelvin3", kv_size, ref.kelvin3); - check("matrix3", dim * 4, ref.matrix3); - check("matrix3_1", dim * 4, ref.matrix3_1); - check("matrix3_2", 4, ref.matrix3_2); - - // b levels - check("scalar1b", 1, ref.scalar1b); - check("scalar2b", 1, ref.scalar2b); - check("scalar3b", 1, ref.scalar3b); + checkAll(ref, check); } TYPED_TEST(ProcessLib_ReflectIPData, WriteTest) @@ -617,7 +633,7 @@ TYPED_TEST(ProcessLib_ReflectIPData, WriteTest) // checks ////////////////////////////////////////////////////////////////// auto check = [&map_name_to_num_comp_and_function, &loc_asm]( - std::string const& name, std::size_t const size_expected, + std::string const& name, unsigned const num_comp, std::vector const& values_plain) { auto const it = map_name_to_num_comp_and_function.find(name); @@ -625,23 +641,34 @@ TYPED_TEST(ProcessLib_ReflectIPData, WriteTest) ASSERT_NE(map_name_to_num_comp_and_function.end(), it) << "No accessor found for ip data with name '" << name << "'"; - auto const& [num_comp, fct] = it->second; + auto const& [num_comp_2, fct] = it->second; + + // consistency checks + ASSERT_EQ(num_comp, num_comp_2); + ASSERT_EQ(0, values_plain.size() % num_comp); + auto const num_int_pts_expected = values_plain.size() / num_comp; EXPECT_THAT(fct(loc_asm), testing::Each(testing::IsNan())) - << "All values must be initialize to NaN in this unit test. Check " + << "All values must be initialized to NaN in this unit test. Check " "failed for ip data with name '" << name << "'"; // function under test ///////////////////////////////////////////////// - auto const size = ProcessLib::Reflection::reflectSetIPData( - name, values_plain.data(), loc_asm.ip_data_level1); + auto const num_int_pts_actual = + ProcessLib::Reflection::reflectSetIPData( + name, values_plain.data(), loc_asm.ip_data_level1); + auto const num_int_pts_actual_1 = + ProcessLib::Reflection::reflectSetIPData( + name, values_plain.data(), loc_asm.ip_data_level1b); // end function under test ///////////////////////////////////////////// - EXPECT_EQ(size_expected, size) - << "Unexpected size obtained for ip data with name '" << name - << "'"; + ASSERT_EQ(num_int_pts_expected, num_int_pts_actual) + << "Unexpected number of integration points obtained for ip data " + "with name '" + << name << "'"; + ASSERT_EQ(num_int_pts_expected, num_int_pts_actual_1); // check set values via round-trip with getter tested in previous unit // test @@ -651,19 +678,7 @@ TYPED_TEST(ProcessLib_ReflectIPData, WriteTest) << "'"; }; - check("scalar1", num_int_pts, ref.scalar1); - check("vector1", num_int_pts, ref.vector1); - check("kelvin1", num_int_pts, ref.kelvin1); - - check("scalar3", num_int_pts, ref.scalar3); - check("vector3", num_int_pts, ref.vector3); - check("kelvin3", num_int_pts, ref.kelvin3); - check("matrix3", num_int_pts, ref.matrix3); - check("matrix3_1", num_int_pts, ref.matrix3_1); - check("matrix3_2", num_int_pts, ref.matrix3_2); - - check("scalar2b", num_int_pts, ref.scalar2b); - check("scalar3b", num_int_pts, ref.scalar3b); + checkAll(ref, check, false); } TYPED_TEST(ProcessLib_ReflectIPData, RawDataTypes) @@ -737,7 +752,7 @@ TYPED_TEST(ProcessLib_ReflectIPData, IPWriterTest) // checks ////////////////////////////////////////////////////////////////// auto check = [&loc_asm, &mesh](std::string const& name, - std::size_t const num_int_pts, + unsigned const num_comp, std::vector const& values_expected) { auto const& props = mesh->getProperties(); @@ -746,8 +761,8 @@ TYPED_TEST(ProcessLib_ReflectIPData, IPWriterTest) << "Property vector '" << name + "_ip" << "' does not exist in the mesh."; - ASSERT_EQ(0, values_expected.size() % num_int_pts); - auto const num_comp = values_expected.size() / num_int_pts; + ASSERT_EQ(0, values_expected.size() % num_comp); + auto const num_int_pts = values_expected.size() / num_comp; auto const& ip_data_actual = *props.getPropertyVector(name + "_ip"); @@ -763,26 +778,12 @@ TYPED_TEST(ProcessLib_ReflectIPData, IPWriterTest) << "Values differ for ip data with name '" << name << "'"; }; - check("scalar1", num_int_pts, ref.scalar1); - check("vector1", num_int_pts, ref.vector1); - check("kelvin1", num_int_pts, ref.kelvin1); - - check("scalar3", num_int_pts, ref.scalar3); - check("vector3", num_int_pts, ref.vector3); - check("kelvin3", num_int_pts, ref.kelvin3); - check("matrix3", num_int_pts, ref.matrix3); - check("matrix3_1", num_int_pts, ref.matrix3_1); - check("matrix3_2", num_int_pts, ref.matrix3_2); - - check("scalar2b", num_int_pts, ref.scalar2b); - check("scalar3b", num_int_pts, ref.scalar3b); + checkAll(ref, check); } TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) { constexpr int dim = TypeParam::value; - auto constexpr kv_size = - MathLib::KelvinVector::kelvin_vector_dimensions(dim); using LocAsm = LocAsmIF; @@ -841,7 +842,8 @@ TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) // checks ////////////////////////////////////////////////////////////////// auto check = [&map_name_to_cell_average, &mesh]( - std::string const& name, unsigned const num_comp_expected) + std::string const& name, unsigned const num_comp_expected, + std::vector const& /*ip_data_expected*/) { auto const it = map_name_to_cell_average.find(name); @@ -872,26 +874,5 @@ TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) << "Values differ for cell average data with name '" << name << "'"; }; - // level 0 - check("scalar", 1); - check("vector", dim); - check("kelvin", kv_size); - - // level 1 - check("scalar1", 1); - check("vector1", dim); - check("kelvin1", kv_size); - - // level 3 - check("scalar3", 1); - check("vector3", dim); - check("kelvin3", kv_size); - check("matrix3", dim * 4); - check("matrix3_1", dim * 4); - check("matrix3_2", 4); - - // b levels - check("scalar1b", 1); - check("scalar2b", 1); - check("scalar3b", 1); + checkAll(ref, check); } From 77ff6ad8ecf8bb9824bc244f7a3ee6e0439cbb96 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 14:14:04 +0200 Subject: [PATCH 11/21] [T] Fixed MSVC compiler warning Warning was: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\memory(3382): warning C4244: 'argument': conversion from 'const uintptr_t' to 'const unsigned int', possible loss of data C:/Users/gitlab/gitlab/_b/bg4d5s_d/0/ogs/ogs/Tests/ProcessLib/TestReflectIPData.cpp(792): note: see reference to function template instantiation 'std::unique_ptr> std::make_unique(const size_t &)' being compiled --- Tests/ProcessLib/TestReflectIPData.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index 22ec80bad35..111e4ca245c 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -729,7 +729,17 @@ TYPED_TEST(ProcessLib_ReflectIPData, IPWriterTest) std::size_t const num_int_pts = 8; std::vector> loc_asms; - loc_asms.push_back(std::make_unique(num_int_pts)); + // emplace...new is a workaround for an MSVC compiler warning: + // C:\Program Files (x86)\Microsoft Visual + // Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\memory(3382): + // warning C4244: 'argument': conversion from 'const uintptr_t' to 'const + // unsigned int', possible loss of data + // C:/Users/gitlab/gitlab/_b/bg4d5s_d/0/ogs/ogs/Tests/ProcessLib/ + // TestReflectIPData.cpp(792): + // note: see reference to function template instantiation + // 'std::unique_ptr> + // std::make_unique(const size_t &)' being compiled + loc_asms.emplace_back(new LocAsm{num_int_pts}); auto& loc_asm = *loc_asms.front(); std::unique_ptr mesh{ @@ -789,7 +799,17 @@ TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) std::size_t const num_int_pts = 8; std::vector> loc_asms; - loc_asms.push_back(std::make_unique(num_int_pts)); + // emplace...new is a workaround for an MSVC compiler warning: + // C:\Program Files (x86)\Microsoft Visual + // Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\memory(3382): + // warning C4244: 'argument': conversion from 'const uintptr_t' to 'const + // unsigned int', possible loss of data + // C:/Users/gitlab/gitlab/_b/bg4d5s_d/0/ogs/ogs/Tests/ProcessLib/ + // TestReflectIPData.cpp(792): + // note: see reference to function template instantiation + // 'std::unique_ptr> + // std::make_unique(const size_t &)' being compiled + loc_asms.emplace_back(new LocAsm{num_int_pts}); auto& loc_asm = *loc_asms.front(); std::unique_ptr mesh{ From 80c87fc5110e9a547eed566a3181938c2ddb53fd Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 14:32:30 +0200 Subject: [PATCH 12/21] [T] Removed unused lambda capture --- Tests/ProcessLib/TestReflectIPData.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index 111e4ca245c..5c1b2535509 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -740,7 +740,6 @@ TYPED_TEST(ProcessLib_ReflectIPData, IPWriterTest) // 'std::unique_ptr> // std::make_unique(const size_t &)' being compiled loc_asms.emplace_back(new LocAsm{num_int_pts}); - auto& loc_asm = *loc_asms.front(); std::unique_ptr mesh{ MeshToolsLib::MeshGenerator::generateLineMesh(1.0, 1)}; @@ -761,9 +760,9 @@ TYPED_TEST(ProcessLib_ReflectIPData, IPWriterTest) // checks ////////////////////////////////////////////////////////////////// - auto check = [&loc_asm, &mesh](std::string const& name, - unsigned const num_comp, - std::vector const& values_expected) + auto check = [&mesh](std::string const& name, + unsigned const num_comp, + std::vector const& values_expected) { auto const& props = mesh->getProperties(); From 04a83d5b6ab53790b3818174b7b9a3c2930403c6 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 16 May 2024 14:46:46 +0200 Subject: [PATCH 13/21] [T] Simplified cell average test a bit --- Tests/ProcessLib/TestReflectIPData.cpp | 61 +++++++------------------- 1 file changed, 15 insertions(+), 46 deletions(-) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index 5c1b2535509..dbcfae35acc 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -809,50 +809,12 @@ TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) // 'std::unique_ptr> // std::make_unique(const size_t &)' being compiled loc_asms.emplace_back(new LocAsm{num_int_pts}); - auto& loc_asm = *loc_asms.front(); std::unique_ptr mesh{ MeshToolsLib::MeshGenerator::generateLineMesh(1.0, 1)}; auto const ref = ReferenceData::create(*loc_asms.front(), true); - // compute cell average reference data ///////////////////////////////////// - - std::map> map_name_to_cell_average; - - ProcessLib::Reflection::forEachReflectedFlattenedIPDataAccessor( - LocAsm::reflect(), - [&loc_asm, &map_name_to_cell_average](std::string const& name, - unsigned const num_comp, - auto&& double_vec_from_loc_asm) - { - auto [it, emplaced] = - map_name_to_cell_average.emplace(name, num_comp); - - EXPECT_TRUE(emplaced) - << '\'' << name - << "' seems to exist twice in the reflection data."; - - auto const& ip_data = double_vec_from_loc_asm(loc_asm); - ASSERT_EQ(num_int_pts * num_comp, ip_data.size()); - - // TODO this implementation in the unit test might be too close to - // the production code. In fact, it's almost the same code. - - // each integration point corresponds to a column in the mapped - // matrix, vector components/matrix entries are stored contiguously - // in memory. - Eigen::Map> - ip_data_mat{ip_data.data(), num_comp, num_int_pts}; - - Eigen::Map cell_avg_vec{it->second.data(), - num_comp}; - - cell_avg_vec = ip_data_mat.rowwise().mean(); - }); - // function under test ///////////////////////////////////////////////////// ProcessLib::CellAverageData cell_average_data{*mesh}; @@ -860,17 +822,24 @@ TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) // checks ////////////////////////////////////////////////////////////////// - auto check = [&map_name_to_cell_average, &mesh]( - std::string const& name, unsigned const num_comp_expected, - std::vector const& /*ip_data_expected*/) + auto check = [&mesh](std::string const& name, + unsigned const num_comp_expected, + std::vector const& ip_data) { - auto const it = map_name_to_cell_average.find(name); + ASSERT_EQ(num_int_pts * num_comp_expected, ip_data.size()); - ASSERT_NE(map_name_to_cell_average.end(), it) - << "No cell average reference data found for data with name '" - << name << "'"; + // TODO the implementation here in the unit test computing cell average + // reference data might be too similar to the production code. In fact, + // it's almost the same code. + + // each integration point corresponds to a column in the mapped + // matrix, vector components/matrix entries are stored contiguously + // in memory. + Eigen::Map> + ip_data_mat{ip_data.data(), num_comp_expected, num_int_pts}; - auto const& cell_avg_expected = it->second; + Eigen::VectorXd const cell_avg_expected = ip_data_mat.rowwise().mean(); auto const& props = mesh->getProperties(); From 9b36b38c0fb2a25712725b67d35799909371fe22 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Fri, 17 May 2024 09:20:46 +0200 Subject: [PATCH 14/21] [PL] Moved part of the averaging to a separate header file With that change, Process.h does not include the reflection code transitively anymore, meaning less code dependencies and (hopefully) better/more fine-grained incremental builds, since many other compilation units depend on Process.h. --- ProcessLib/Output/CellAverageAlgorithm.h | 80 ++++++++++++++++++++++++ ProcessLib/Output/CellAverageData.h | 60 +----------------- 2 files changed, 81 insertions(+), 59 deletions(-) create mode 100644 ProcessLib/Output/CellAverageAlgorithm.h diff --git a/ProcessLib/Output/CellAverageAlgorithm.h b/ProcessLib/Output/CellAverageAlgorithm.h new file mode 100644 index 00000000000..e9e06338185 --- /dev/null +++ b/ProcessLib/Output/CellAverageAlgorithm.h @@ -0,0 +1,80 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include "CellAverageData.h" +#include "ProcessLib/Reflection/ReflectionIPData.h" + +namespace ProcessLib +{ +namespace detail +{ +void computeCellAverages(CellAverageData& cell_average_data, + std::string const& name, unsigned const num_comp, + auto&& flattened_ip_data_accessor, + auto const& local_assemblers) +{ + auto& prop_vec = + cell_average_data.getOrCreatePropertyVector(name, num_comp); + + for (std::size_t i = 0; i < local_assemblers.size(); ++i) + { + auto const& loc_asm = *local_assemblers[i]; + auto const& ip_data = flattened_ip_data_accessor(loc_asm); + assert(ip_data.size() % num_comp == 0); + auto const num_ips = + static_cast(ip_data.size() / num_comp); + Eigen::Map ip_data_mapped{ip_data.data(), + num_comp, num_ips}; + + Eigen::Map{&prop_vec[i * num_comp], num_comp} = + ip_data_mapped.rowwise().mean(); + } +} +} // namespace detail + +template +void computeCellAverages( + CellAverageData& cell_average_data, + int const dim, + std::vector> const& local_assemblers) +{ + auto const callback = [&cell_average_data, &local_assemblers]( + std::string const& name, + unsigned const num_comp, + auto&& flattened_ip_data_accessor) + { + detail::computeCellAverages(cell_average_data, name, num_comp, + flattened_ip_data_accessor, + local_assemblers); + }; + + if (dim == 2) + { + ProcessLib::Reflection::forEachReflectedFlattenedIPDataAccessor<2, + LAIntf>( + LAIntf::getReflectionDataForOutput(), callback); + } + else if (dim == 3) + { + ProcessLib::Reflection::forEachReflectedFlattenedIPDataAccessor<3, + LAIntf>( + LAIntf::getReflectionDataForOutput(), callback); + } + else + { + OGS_FATAL( + "Generic averaged output is only implemented for dimensions 2 " + "and 3 ATM. You requested dim = {}.", + dim); + } +} +} // namespace ProcessLib diff --git a/ProcessLib/Output/CellAverageData.h b/ProcessLib/Output/CellAverageData.h index 3f8be132048..19dda7699d1 100644 --- a/ProcessLib/Output/CellAverageData.h +++ b/ProcessLib/Output/CellAverageData.h @@ -12,7 +12,6 @@ #include "MeshLib/Mesh.h" #include "MeshLib/PropertyVector.h" -#include "ProcessLib/Reflection/ReflectionIPData.h" namespace ProcessLib { @@ -20,67 +19,10 @@ struct CellAverageData { explicit CellAverageData(MeshLib::Mesh& mesh) : mesh_{mesh} {} - template - void computeSecondaryVariable( - int const dim, - std::vector> const& local_assemblers) - { - auto const callback = - [this, &local_assemblers](std::string const& name, - unsigned const num_comp, - auto&& flattened_ip_data_accessor) - { - computeCellAverages(name, num_comp, flattened_ip_data_accessor, - local_assemblers); - }; - - if (dim == 2) - { - ProcessLib::Reflection:: - forEachReflectedFlattenedIPDataAccessor<2, LAIntf>( - LAIntf::getReflectionDataForOutput(), callback); - } - else if (dim == 3) - { - ProcessLib::Reflection:: - forEachReflectedFlattenedIPDataAccessor<3, LAIntf>( - LAIntf::getReflectionDataForOutput(), callback); - } - else - { - OGS_FATAL( - "Generic averaged output is only implemented for dimensions 2 " - "and 3 ATM. You requested dim = {}.", - dim); - } - } - -private: MeshLib::PropertyVector& getOrCreatePropertyVector( std::string const& name, unsigned const num_comp); - void computeCellAverages(std::string const& name, - unsigned const num_comp, - auto&& flattened_ip_data_accessor, - auto const& local_assemblers) - { - auto& prop_vec = getOrCreatePropertyVector(name, num_comp); - - for (std::size_t i = 0; i < local_assemblers.size(); ++i) - { - auto const& loc_asm = *local_assemblers[i]; - auto const& ip_data = flattened_ip_data_accessor(loc_asm); - assert(ip_data.size() % num_comp == 0); - auto const num_ips = - static_cast(ip_data.size() / num_comp); - Eigen::Map ip_data_mapped{ip_data.data(), - num_comp, num_ips}; - - Eigen::Map{&prop_vec[i * num_comp], num_comp} = - ip_data_mapped.rowwise().mean(); - } - } - +private: MeshLib::Mesh const& mesh_; std::map*> cell_averages_; }; From 58fdbbd99531f6120d08904a38f2b9c0090a7590 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Fri, 17 May 2024 09:23:16 +0200 Subject: [PATCH 15/21] [PL/TRM] Adapted to moved cell averaging code --- .../ThermoRichardsMechanicsProcess.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp index 194cc0cc1b1..f5968678c4f 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp @@ -18,6 +18,7 @@ #include "MeshLib/Utils/getOrCreateMeshProperty.h" #include "NumLib/DOF/DOFTableUtil.h" #include "ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h" +#include "ProcessLib/Output/CellAverageAlgorithm.h" #include "ProcessLib/Process.h" #include "ProcessLib/Reflection/ReflectionForExtrapolation.h" #include "ProcessLib/Reflection/ReflectionForIPWriters.h" @@ -287,8 +288,7 @@ void ThermoRichardsMechanicsProcess:: pv.getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev, process_id); - cell_average_data_.computeSecondaryVariable(DisplacementDim, - local_assemblers_); + computeCellAverages(cell_average_data_, DisplacementDim, local_assemblers_); } template From 391e315aea66aff7db1c98ed8ba4ebe622f5ce4a Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Fri, 17 May 2024 09:48:17 +0200 Subject: [PATCH 16/21] [T] Adapted to moved cell averaging code --- Tests/ProcessLib/TestReflectIPData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index dbcfae35acc..01d076a7fd3 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -15,7 +15,7 @@ #include #include "MeshToolsLib/MeshGenerators/MeshGenerator.h" -#include "ProcessLib/Output/CellAverageData.h" +#include "ProcessLib/Output/CellAverageAlgorithm.h" #include "ProcessLib/Reflection/ReflectionForIPWriters.h" #include "ProcessLib/Reflection/ReflectionIPData.h" #include "ProcessLib/Reflection/ReflectionSetIPData.h" @@ -818,7 +818,7 @@ TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) // function under test ///////////////////////////////////////////////////// ProcessLib::CellAverageData cell_average_data{*mesh}; - cell_average_data.computeSecondaryVariable(dim, loc_asms); + computeCellAverages(cell_average_data, dim, loc_asms); // checks ////////////////////////////////////////////////////////////////// From 81a743686e1f971f8ec7b9d88ce43a2452b05fdb Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Fri, 17 May 2024 13:27:42 +0200 Subject: [PATCH 17/21] [PL/SD] Adapted to moved cell averaging code --- ProcessLib/SmallDeformation/SmallDeformationProcess.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp index dc8412bdc60..580abb2864b 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp @@ -15,6 +15,7 @@ #include "MeshLib/Utils/IntegrationPointWriter.h" #include "MeshLib/Utils/getOrCreateMeshProperty.h" #include "ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h" +#include "ProcessLib/Output/CellAverageAlgorithm.h" #include "ProcessLib/Process.h" #include "ProcessLib/Reflection/ReflectionForExtrapolation.h" #include "ProcessLib/Reflection/ReflectionForIPWriters.h" @@ -217,8 +218,7 @@ void SmallDeformationProcess::computeSecondaryVariableConcrete( &LocalAssemblerInterface::computeSecondaryVariable, _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id); - cell_average_data_.computeSecondaryVariable(DisplacementDim, - _local_assemblers); + computeCellAverages(cell_average_data_, DisplacementDim, _local_assemblers); } template class SmallDeformationProcess<2>; template class SmallDeformationProcess<3>; From 5e792ad5826cc2b7e4a8244bcf62daa9cecdff9e Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Fri, 17 May 2024 13:28:06 +0200 Subject: [PATCH 18/21] [PL/LD] Adapted to moved cell averaging code --- ProcessLib/LargeDeformation/LargeDeformationProcess.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp index 208ced81ebf..1effeb44002 100644 --- a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp +++ b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp @@ -18,6 +18,7 @@ #include "MeshLib/Utils/getOrCreateMeshProperty.h" #include "NumLib/DOF/DOFTableUtil.h" #include "ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h" +#include "ProcessLib/Output/CellAverageAlgorithm.h" #include "ProcessLib/Process.h" #include "ProcessLib/Reflection/ReflectionForExtrapolation.h" #include "ProcessLib/Reflection/ReflectionForIPWriters.h" @@ -208,8 +209,7 @@ void LargeDeformationProcess::computeSecondaryVariableConcrete( &LocalAssemblerInterface::computeSecondaryVariable, _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id); - cell_average_data_.computeSecondaryVariable(DisplacementDim, - _local_assemblers); + computeCellAverages(cell_average_data_, DisplacementDim, _local_assemblers); } template class LargeDeformationProcess<2>; template class LargeDeformationProcess<3>; From 1eec8516a6aeb3bba89411466d6d3c9d206a925a Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Fri, 17 May 2024 13:28:28 +0200 Subject: [PATCH 19/21] [PL/TH2M] Adapted to moved cell averaging code --- ProcessLib/TH2M/TH2MProcess.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProcessLib/TH2M/TH2MProcess.cpp b/ProcessLib/TH2M/TH2MProcess.cpp index dc583602d1d..007ae4fe623 100644 --- a/ProcessLib/TH2M/TH2MProcess.cpp +++ b/ProcessLib/TH2M/TH2MProcess.cpp @@ -19,6 +19,7 @@ #include "MeshLib/Utils/getOrCreateMeshProperty.h" #include "NumLib/DOF/DOFTableUtil.h" #include "ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h" +#include "ProcessLib/Output/CellAverageAlgorithm.h" #include "ProcessLib/Process.h" #include "ProcessLib/Reflection/ReflectionForExtrapolation.h" #include "ProcessLib/Reflection/ReflectionForIPWriters.h" @@ -317,8 +318,7 @@ void TH2MProcess::computeSecondaryVariableConcrete( local_assemblers_, pv.getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev, process_id); - cell_average_data_.computeSecondaryVariable(DisplacementDim, - local_assemblers_); + computeCellAverages(cell_average_data_, DisplacementDim, local_assemblers_); } template From 83ea939e85b275bc5c1ad9c37454e0899cc47559 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 28 May 2024 13:38:14 +0200 Subject: [PATCH 20/21] Changed dimension from argument to template parameter --- .../LargeDeformationProcess.cpp | 2 +- ProcessLib/Output/CellAverageAlgorithm.h | 25 +++---------------- .../SmallDeformationProcess.cpp | 2 +- ProcessLib/TH2M/TH2MProcess.cpp | 2 +- .../ThermoRichardsMechanicsProcess.cpp | 2 +- Tests/ProcessLib/TestReflectIPData.cpp | 2 +- 6 files changed, 9 insertions(+), 26 deletions(-) diff --git a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp index 1effeb44002..724f100c1ce 100644 --- a/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp +++ b/ProcessLib/LargeDeformation/LargeDeformationProcess.cpp @@ -209,7 +209,7 @@ void LargeDeformationProcess::computeSecondaryVariableConcrete( &LocalAssemblerInterface::computeSecondaryVariable, _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id); - computeCellAverages(cell_average_data_, DisplacementDim, _local_assemblers); + computeCellAverages(cell_average_data_, _local_assemblers); } template class LargeDeformationProcess<2>; template class LargeDeformationProcess<3>; diff --git a/ProcessLib/Output/CellAverageAlgorithm.h b/ProcessLib/Output/CellAverageAlgorithm.h index e9e06338185..1bb82cc45f4 100644 --- a/ProcessLib/Output/CellAverageAlgorithm.h +++ b/ProcessLib/Output/CellAverageAlgorithm.h @@ -41,10 +41,9 @@ void computeCellAverages(CellAverageData& cell_average_data, } } // namespace detail -template +template void computeCellAverages( CellAverageData& cell_average_data, - int const dim, std::vector> const& local_assemblers) { auto const callback = [&cell_average_data, &local_assemblers]( @@ -57,24 +56,8 @@ void computeCellAverages( local_assemblers); }; - if (dim == 2) - { - ProcessLib::Reflection::forEachReflectedFlattenedIPDataAccessor<2, - LAIntf>( - LAIntf::getReflectionDataForOutput(), callback); - } - else if (dim == 3) - { - ProcessLib::Reflection::forEachReflectedFlattenedIPDataAccessor<3, - LAIntf>( - LAIntf::getReflectionDataForOutput(), callback); - } - else - { - OGS_FATAL( - "Generic averaged output is only implemented for dimensions 2 " - "and 3 ATM. You requested dim = {}.", - dim); - } + ProcessLib::Reflection::forEachReflectedFlattenedIPDataAccessor( + LAIntf::getReflectionDataForOutput(), callback); } } // namespace ProcessLib diff --git a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp index 580abb2864b..d4147358251 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp @@ -218,7 +218,7 @@ void SmallDeformationProcess::computeSecondaryVariableConcrete( &LocalAssemblerInterface::computeSecondaryVariable, _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x, x_prev, process_id); - computeCellAverages(cell_average_data_, DisplacementDim, _local_assemblers); + computeCellAverages(cell_average_data_, _local_assemblers); } template class SmallDeformationProcess<2>; template class SmallDeformationProcess<3>; diff --git a/ProcessLib/TH2M/TH2MProcess.cpp b/ProcessLib/TH2M/TH2MProcess.cpp index 007ae4fe623..376369b107e 100644 --- a/ProcessLib/TH2M/TH2MProcess.cpp +++ b/ProcessLib/TH2M/TH2MProcess.cpp @@ -318,7 +318,7 @@ void TH2MProcess::computeSecondaryVariableConcrete( local_assemblers_, pv.getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev, process_id); - computeCellAverages(cell_average_data_, DisplacementDim, local_assemblers_); + computeCellAverages(cell_average_data_, local_assemblers_); } template diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp index f5968678c4f..f00e5791de9 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp @@ -288,7 +288,7 @@ void ThermoRichardsMechanicsProcess:: pv.getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev, process_id); - computeCellAverages(cell_average_data_, DisplacementDim, local_assemblers_); + computeCellAverages(cell_average_data_, local_assemblers_); } template diff --git a/Tests/ProcessLib/TestReflectIPData.cpp b/Tests/ProcessLib/TestReflectIPData.cpp index 01d076a7fd3..ad6fbe060b6 100644 --- a/Tests/ProcessLib/TestReflectIPData.cpp +++ b/Tests/ProcessLib/TestReflectIPData.cpp @@ -818,7 +818,7 @@ TYPED_TEST(ProcessLib_ReflectIPData, CellAverageTest) // function under test ///////////////////////////////////////////////////// ProcessLib::CellAverageData cell_average_data{*mesh}; - computeCellAverages(cell_average_data, dim, loc_asms); + computeCellAverages(cell_average_data, loc_asms); // checks ////////////////////////////////////////////////////////////////// From 18e678533447a8f43fdd34bdee9079daee4040c6 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 28 May 2024 16:10:03 +0200 Subject: [PATCH 21/21] [T/TRM] Added ctest for cell-averaged stress Note: No reference data has been added, but existing data has been renamed and used. --- .../RichardsFlow2D/RichardsFlow_2d_small.prj | 7 +++++++ .../RichardsFlow_2d_small_ts_0_t_0.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_104_t_2000.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_19_t_318.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_1_t_1.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_29_t_518.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_2_t_3.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_39_t_718.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_3_t_8.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_49_t_918.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_4_t_18.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_59_t_1118.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_5_t_38.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_69_t_1318.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_6_t_58.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_79_t_1518.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_7_t_78.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_89_t_1718.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_8_t_98.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_99_t_1918.000000.vtu | 2 +- .../RichardsFlow_2d_small_ts_9_t_118.000000.vtu | 2 +- 21 files changed, 27 insertions(+), 20 deletions(-) diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small.prj b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small.prj index 02b646e0280..ae7609e2109 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small.prj +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small.prj @@ -205,6 +205,7 @@ NodalForces pressure_interpolated saturation_avg + sigma_avg _ts_{:timestep}_t_{:time} @@ -354,6 +355,12 @@ 1e-8 0 + + RichardsFlow_2d_small_ts_.*.vtu + sigma_avg + 2.8e-12 + 0 + RichardsFlow_2d_small_ts_.*.vtu epsilon diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_0_t_0.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_0_t_0.000000.vtu index ce7d33c10c9..b9dd3ced866 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_0_t_0.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_0_t_0.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_104_t_2000.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_104_t_2000.000000.vtu index 91e4affb979..784c259c3e4 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_104_t_2000.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_104_t_2000.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_19_t_318.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_19_t_318.000000.vtu index a9f53bc77b8..339fa819ca5 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_19_t_318.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_19_t_318.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_1_t_1.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_1_t_1.000000.vtu index 703fec56f30..83ab412ef92 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_1_t_1.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_1_t_1.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_29_t_518.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_29_t_518.000000.vtu index b6202102d14..8cd523c95c1 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_29_t_518.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_29_t_518.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_2_t_3.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_2_t_3.000000.vtu index 264abfd4282..8d6a382bdfa 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_2_t_3.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_2_t_3.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_39_t_718.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_39_t_718.000000.vtu index cce79dd592d..39c90e840f4 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_39_t_718.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_39_t_718.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_3_t_8.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_3_t_8.000000.vtu index 47475355ff2..03367285fba 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_3_t_8.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_3_t_8.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_49_t_918.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_49_t_918.000000.vtu index 6f67c0b5486..19d052c3012 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_49_t_918.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_49_t_918.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_4_t_18.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_4_t_18.000000.vtu index a993960c709..ea244a19a65 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_4_t_18.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_4_t_18.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_59_t_1118.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_59_t_1118.000000.vtu index 6a6c5a26731..22d5a98f6bd 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_59_t_1118.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_59_t_1118.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_5_t_38.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_5_t_38.000000.vtu index 89bef788e68..4ee3963156d 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_5_t_38.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_5_t_38.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_69_t_1318.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_69_t_1318.000000.vtu index 38a1c9d9cd6..879a21c0feb 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_69_t_1318.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_69_t_1318.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_6_t_58.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_6_t_58.000000.vtu index 99d0546d156..0848e3a65dd 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_6_t_58.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_6_t_58.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_79_t_1518.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_79_t_1518.000000.vtu index f27991cbb38..f4f39ef92a8 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_79_t_1518.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_79_t_1518.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_7_t_78.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_7_t_78.000000.vtu index 287a168431e..017f00e2fab 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_7_t_78.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_7_t_78.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_89_t_1718.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_89_t_1718.000000.vtu index e71fddbc39c..d012b085e7a 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_89_t_1718.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_89_t_1718.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_8_t_98.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_8_t_98.000000.vtu index 0b00240c916..bd511e3f761 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_8_t_98.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_8_t_98.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_99_t_1918.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_99_t_1918.000000.vtu index 69eacf9c7f6..df0b16698e0 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_99_t_1918.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_99_t_1918.000000.vtu @@ -27,7 +27,7 @@ - + diff --git a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_9_t_118.000000.vtu b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_9_t_118.000000.vtu index 8add72d94db..47c3c4b5601 100644 --- a/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_9_t_118.000000.vtu +++ b/Tests/Data/ThermoRichardsMechanics/RichardsFlow2D/RichardsFlow_2d_small_ts_9_t_118.000000.vtu @@ -27,7 +27,7 @@ - +