From cf8b5600767e3f18d6066aece1f40fef992c93fd Mon Sep 17 00:00:00 2001 From: Jonathan Nuttall Date: Thu, 6 Oct 2022 11:07:55 +0200 Subject: [PATCH 01/27] Added first implementation of phreatic multi-line --- ...t_phreatic_multi_line_pressure_process.hpp | 294 +++ ...atic_multi_line_pressure_table_process.hpp | 198 ++ .../add_custom_processes_to_python.cpp | 18 + .../apply_scalar_constraint_table_process.py | 21 +- .../ProjectParameters.json | 4 +- ...nclinded_phreatic_line_time_dependent.mdpa | 5 + .../MaterialParameters.json | 27 + .../ProjectParameters.json | 166 ++ ...ed_phreatic_multi_line_time_dependent.mdpa | 1765 +++++++++++++++++ .../MaterialParameters.json | 27 + .../ProjectParameters.json | 166 ++ .../test_inclined_phreatic_multi_line.mdpa | 1757 ++++++++++++++++ .../MaterialParameters.json | 27 + .../ProjectParameters.json | 166 ++ .../test_inclined_phreatic_multi_line.mdpa | 1757 ++++++++++++++++ .../tests/test_water_pressure.py | 548 ++--- 16 files changed, 6713 insertions(+), 233 deletions(-) create mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp create mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp create mode 100644 applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/MaterialParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/ProjectParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/test_inclinded_phreatic_multi_line_time_dependent.mdpa create mode 100644 applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/MaterialParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/test_inclined_phreatic_multi_line.mdpa create mode 100644 applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/MaterialParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/test_inclined_phreatic_multi_line.mdpa diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp new file mode 100644 index 000000000000..5cc3b896b695 --- /dev/null +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -0,0 +1,294 @@ +// KRATOS___ +// // ) ) +// // ___ ___ +// // ____ //___) ) // ) ) +// // / / // // / / +// ((____/ / ((____ ((___/ / MECHANICS +// +// License: geo_mechanics_application/license.txt +// +// Main authors: Vahid Galavi +// Jonathan Nuttall + +#if !defined(KRATOS_GEO_APPLY_CONSTANT_PHREATIC_MULTI_LINE_PRESSURE_PROCESS ) +#define KRATOS_GEO_APPLY_CONSTANT_PHREATIC_MULTI_LINE_PRESSURE_PROCESS + +#include +#include "includes/kratos_flags.h" +#include "includes/kratos_parameters.h" +#include "processes/process.h" + +#include "geo_mechanics_application_variables.h" + +namespace Kratos +{ + +class ApplyConstantPhreaticMultiLinePressureProcess : public Process +{ + +public: + + KRATOS_CLASS_POINTER_DEFINITION(ApplyConstantPhreaticMultiLinePressureProcess); + +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + /// Constructor + ApplyConstantPhreaticMultiLinePressureProcess(ModelPart& model_part, + Parameters rParameters + ) : Process(Flags()) , mrModelPart(model_part) + { + KRATOS_TRY + + //only include validation with c++11 since raw_literals do not exist in c++03 + Parameters default_parameters( R"( + { + "model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME", + "variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME", + "is_fixed": false, + "is_seepage": false, + "gravity_direction": 1, + "out_of_plane_direction": 2, + "x_coordinates": [0.0,1.0], + "y_coordinates": [1.0,0.5], + "z_coordinates": [0.0,0.0], + "specific_weight" : 10000.0, + "pressure_tension_cut_off" : 0.0, + "table" : [0,1] + } )" ); + + // Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them + // So that an error is thrown if they don't exist + rParameters["x_coordinates"]; + rParameters["y_coordinates"]; + rParameters["z_coordinates"]; + rParameters["variable_name"]; + rParameters["model_part_name"]; + + // Now validate agains defaults -- this also ensures no type mismatch + rParameters.ValidateAndAssignDefaults(default_parameters); + + mVariableName = rParameters["variable_name"].GetString(); + mIsFixed = rParameters["is_fixed"].GetBool(); + mIsSeepage = rParameters["is_seepage"].GetBool(); + mGravityDirection = rParameters["gravity_direction"].GetInt(); + mOutOfPlaneDirection = rParameters["out_of_plane_direction"].GetInt(); + if (mGravityDirection == mOutOfPlaneDirection) + KRATOS_ERROR << "Gravity direction cannot be the same as Out-of-Plane directions" + << rParameters + << std::endl; + + mHorizontalDirection = 0; + for (unsigned int i=0; i 0) { + const Variable &var = KratosComponents< Variable >::Get(mVariableName); + + if (mIsSeepage) { + block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { + const double pressure = CalculatePressure(rNode); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { + rNode.FastGetSolutionStepValue(var) = pressure; + if (mIsFixed) rNode.Fix(var); + } else { + rNode.Free(var); + } + }); + } else { + block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { + if (mIsFixed) rNode.Fix(var); + else rNode.Free(var); + const double pressure = CalculatePressure(rNode); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { + rNode.FastGetSolutionStepValue(var) = pressure; + } else { + rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; + } + }); + } + } + + KRATOS_CATCH("") + } + + /// Turn back information as a string. + std::string Info() const override + { + return "ApplyConstantPhreaticMultiLinePressureProcess"; + } + + /// Print information about this object. + void PrintInfo(std::ostream& rOStream) const override + { + rOStream << "ApplyConstantPhreaticMultiLinePressureProcess"; + } + + /// Print object's data. + void PrintData(std::ostream& rOStream) const override + { + } + +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +protected: + + /// Member Variables + + ModelPart& mrModelPart; + std::string mVariableName; + bool mIsFixed; + bool mIsSeepage; + unsigned int mGravityDirection; + double mSpecificWeight; + unsigned int mOutOfPlaneDirection; + unsigned int mHorizontalDirection; + Vector mHorizontalDirectionCoordinates; + Vector mGravityDirectionCoordinates; + Vector mXCoordinates; + Vector mYCoordinates; + Vector mZCoordinates; + + double mMinHorizontalCoordinate; + double mMaxHorizontalCoordinate; + double mPressureTensionCutOff; + + int findIndex(const Node<3>& rNode) const + { + int index = 0; + for(index; index < mHorizontalDirectionCoordinates.size(); index++) + { + if (mHorizontalDirectionCoordinates[index] > rNode.Coordinates()[mHorizontalDirection]) + { + break; + } + } + if (index == 0) + { + return 0; + } + else + { + return index - 1; + } + } + + double CalculatePressure(const Node<3> &rNode) const + { + double height = 0.0; + int firstPointIndex; + int secondPointIndex; + double slope; + + // find nodes in horizontalDirectionCoordinates + + firstPointIndex = findIndex(rNode); + secondPointIndex = firstPointIndex + 1; + + slope = (mGravityDirectionCoordinates[secondPointIndex] - mGravityDirectionCoordinates[firstPointIndex]) / + (mHorizontalDirectionCoordinates[secondPointIndex] - mHorizontalDirectionCoordinates[firstPointIndex]); + + height = slope * (rNode.Coordinates()[mHorizontalDirection] - mHorizontalDirectionCoordinates[firstPointIndex]) + mGravityDirectionCoordinates[firstPointIndex]; + + const double distance = height - rNode.Coordinates()[mGravityDirection]; + const double pressure = - PORE_PRESSURE_SIGN_FACTOR * mSpecificWeight * distance; + return pressure; + } +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +private: + + /// Assignment operator. + ApplyConstantPhreaticLinePressureProcess& operator=(ApplyConstantPhreaticMultiLinePressureProcess const& rOther); + + /// Copy constructor. + //ApplyConstantPhreaticLinePressureProcess(ApplyConstantPhreaticMultiLinePressureProcess const& rOther); + +}; // Class ApplyConstantPhreaticMultiLinePressureProcess + +/// input stream function +inline std::istream& operator >> (std::istream& rIStream, + ApplyConstantPhreaticMultiLinePressureProcess& rThis); + +/// output stream function +inline std::ostream& operator << (std::ostream& rOStream, + const ApplyConstantPhreaticMultiLinePressureProcess& rThis) +{ + rThis.PrintInfo(rOStream); + rOStream << std::endl; + rThis.PrintData(rOStream); + + return rOStream; +} + +} // namespace Kratos. + +#endif /* KRATOS_GEO_APPLY_CONSTANT_PHREATIC_MULTI_LINE_PRESSURE_PROCESS defined */ diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp new file mode 100644 index 000000000000..27c62b5ba892 --- /dev/null +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -0,0 +1,198 @@ +// KRATOS___ +// // ) ) +// // ___ ___ +// // ____ //___) ) // ) ) +// // / / // // / / +// ((____/ / ((____ ((___/ / MECHANICS +// +// License: geo_mechanics_application/license.txt +// +// Main authors: Vahid Galavi +// + +#if !defined(KRATOS_GEO_APPLY_PHREATIC_MULTI_LINE_PRESSURE_TABLE_PROCESS ) +#define KRATOS_GEO_APPLY_PHREATIC_MULTI_LINE_PRESSURE_TABLE_PROCESS + +#include "includes/table.h" + +#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp" +#include "geo_mechanics_application_variables.h" + +namespace Kratos +{ + +class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticMultiLinePressureProcess +{ + +public: + + KRATOS_CLASS_POINTER_DEFINITION(ApplyPhreaticMultiLinePressureTableProcess); + + /// Defining a table with double argument and result type as table type. + typedef Table TableType; + +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + /// Constructor + ApplyPhreaticMultiLinePressureTableProcess(ModelPart& model_part, + Parameters rParameters + ) : ApplyConstantPhreaticMultiLinePressureProcess(model_part, rParameters) + { + KRATOS_TRY + + for(unsigned int TableId: rParameters["table"].GetVector()) + { + if (TableId > 0) { + auto pTable = model_part.pGetTable(TableId); + mpTable.push_back(pTable); + } else { + mpTable.push_back(nullptr); + } + } + + mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER]; + + KRATOS_CATCH(""); + } + + ///------------------------------------------------------------------------------------ + + /// Destructor + ~ApplyPhreaticMultiLinePressureTableProcess() override {} + +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + /// Execute method is used to execute the ApplyPhreaticMultiLinePressureTableProcess algorithms. + void Execute() override + { + } + + /// this function will be executed at every time step BEFORE performing the solve phase + void ExecuteInitializeSolutionStep() override + { + KRATOS_TRY + + if (mrModelPart.NumberOfNodes() > 0) { + const Variable &var = KratosComponents< Variable >::Get(mVariableName); + + const double Time = mrModelPart.GetProcessInfo()[TIME]/mTimeUnitConverter; + std::vector deltaH; + for (unsigned int i=0; i < mpTable.size(); ++i) { + if (!mpTable[i]) { + deltaH.push_back(0.0); + } else { + deltaH.push_back(mpTable[i]->GetValue(Time)); + } + } + + if (mIsSeepage) { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { + const double pressure = CalculatePressure(rNode, deltaH); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { + rNode.FastGetSolutionStepValue(var) = pressure; + if (mIsFixed) rNode.Fix(var); + } else { + rNode.Free(var); + } + }); + } else { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { + const double pressure = CalculatePressure(rNode, deltaH); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { + rNode.FastGetSolutionStepValue(var) = pressure; + } else { + rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; + } + }); + } + } + + KRATOS_CATCH(""); + } + + /// Turn back information as a string. + std::string Info() const override + { + return "ApplyPhreaticMultiLinePressureTableProcess"; + } + + /// Print information about this object. + void PrintInfo(std::ostream& rOStream) const override + { + rOStream << "ApplyPhreaticMultiLinePressureTableProcess"; + } + + /// Print object's data. + void PrintData(std::ostream& rOStream) const override + { + } + +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +protected: + + /// Member Variables + + std::vector mpTable; + double mTimeUnitConverter; + + double CalculatePressure(const Node<3> &rNode, std::vector &deltaH) const + { + + double height = 0.0; + int firstPointIndex; + int secondPointIndex; + double slope; + array_1d y; + + // find nodes in horizontalDirectionCoordinates + + firstPointIndex = findIndex(rNode); + secondPointIndex = firstPointIndex + 1; + + y[0] = deltaH[firstPointIndex] + mGravityDirectionCoordinates[firstPointIndex]; + y[1] = deltaH[secondPointIndex] + mGravityDirectionCoordinates[secondPointIndex]; + + slope = (y[1] - y[0]) + / (mHorizontalDirectionCoordinates[secondPointIndex] - mHorizontalDirectionCoordinates[firstPointIndex]); + + + height = slope * (rNode.Coordinates()[mHorizontalDirection] - mHorizontalDirectionCoordinates[firstPointIndex]) + y[0]; + + const double distance = height - rNode.Coordinates()[mGravityDirection]; + const double pressure = - PORE_PRESSURE_SIGN_FACTOR * mSpecificWeight * distance; + return pressure; + } + +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +private: + + /// Assignment operator. + ApplyPhreaticMultiLinePressureTableProcess& operator=(ApplyPhreaticMultiLinePressureTableProcess const& rOther); + + /// Copy constructor. + //ApplyPhreaticMultiLinePressureTableProcess(ApplyPhreaticMultiLinePressureTableProcess const& rOther); +}; // Class ApplyPhreaticMultiLinePressureTableProcess + +/// input stream function +inline std::istream& operator >> (std::istream& rIStream, + ApplyPhreaticMultiLinePressureTableProcess& rThis); + +/// output stream function +inline std::ostream& operator << (std::ostream& rOStream, + const ApplyPhreaticMultiLinePressureTableProcess& rThis) +{ + rThis.PrintInfo(rOStream); + rOStream << std::endl; + rThis.PrintData(rOStream); + + return rOStream; +} + + +} // namespace Kratos. + +#endif /* KRATOS_GEO_APPLY_PHREATIC_MULTI_LINE_PRESSURE_TABLE_PROCESS defined */ \ No newline at end of file diff --git a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp index d3c77549a870..4fa7ef85dbd8 100644 --- a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp +++ b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp @@ -26,7 +26,9 @@ #include "custom_processes/apply_constant_boundary_hydrostatic_pressure_process.hpp" #include "custom_processes/apply_boundary_hydrostatic_pressure_table_process.hpp" #include "custom_processes/apply_constant_phreatic_line_pressure_process.hpp" +#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp" #include "custom_processes/apply_phreatic_line_pressure_table_process.hpp" +#include "custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp" #include "custom_processes/apply_constant_boundary_phreatic_line_pressure_process.hpp" #include "custom_processes/apply_boundary_phreatic_line_pressure_table_process.hpp" #include "custom_processes/apply_constant_phreatic_surface_pressure_process.hpp" @@ -88,6 +90,14 @@ void AddCustomProcessesToPython(pybind11::module& m) (m, "ApplyPhreaticLinePressureTableProcess") .def(py::init < ModelPart&, Parameters>()); + py::class_ + (m, "ApplyConstantPhreaticMultiLinePressureProcess") + .def(init < ModelPart&, Parameters>()); + + py::class_ + (m, "ApplyConstantInterpolateLinePressureProcess") + .def(init < ModelPart&, Parameters>()); + py::class_ (m, "ApplyBoundaryPhreaticLinePressureTableProcess") .def(py::init < ModelPart&, Parameters>()); @@ -100,6 +110,14 @@ void AddCustomProcessesToPython(pybind11::module& m) (m, "ApplyConstantPhreaticSurfacePressureProcess") .def(py::init < ModelPart&, Parameters>()); + py::class_ + (m, "ApplyPhreaticMultiLinePressureTableProcess") + .def(init < ModelPart&, Parameters>()); + + py::class_ + (m, "ApplyBoundaryPhreaticLinePressureTableProcess") + .def(init < ModelPart&, Parameters>()); + py::class_ (m, "ApplyPhreaticSurfacePressureTableProcess") .def(py::init < ModelPart&, Parameters>()); diff --git a/applications/GeoMechanicsApplication/python_scripts/apply_scalar_constraint_table_process.py b/applications/GeoMechanicsApplication/python_scripts/apply_scalar_constraint_table_process.py index e3fae418ae2a..98e7746d0601 100644 --- a/applications/GeoMechanicsApplication/python_scripts/apply_scalar_constraint_table_process.py +++ b/applications/GeoMechanicsApplication/python_scripts/apply_scalar_constraint_table_process.py @@ -58,11 +58,30 @@ def __init__(self, Model, settings ): if settings.Has("is_seepage"): self.params.AddValue("is_seepage",settings["is_seepage"]) - if settings["table"][0].GetInt() == 0 and settings["table"][1].GetInt() == 0: + if all(i.GetInt() == 0 for i in settings["table"]): self.process = KratosGeo.ApplyConstantPhreaticLinePressureProcess(self.model_part, self.params) else: self.params.AddValue("table",settings["table"]) self.process = KratosGeo.ApplyPhreaticLinePressureTableProcess(self.model_part, self.params) + elif settings["fluid_pressure_type"].GetString() == "Phreatic_Multi_Line": + self.params.AddValue("gravity_direction",settings["gravity_direction"]) + self.params.AddValue("out_of_plane_direction",settings["out_of_plane_direction"]) + self.params.AddValue("x_coordinates",settings["x_coordinates"]) + self.params.AddValue("y_coordinates",settings["y_coordinates"]) + self.params.AddValue("z_coordinates",settings["z_coordinates"]) + self.params.AddValue("specific_weight",settings["specific_weight"]) + + if settings.Has("pressure_tension_cut_off"): + self.params.AddValue("pressure_tension_cut_off",settings["pressure_tension_cut_off"]) + + if settings.Has("is_seepage"): + self.params.AddValue("is_seepage",settings["is_seepage"]) + + if all(i.GetInt() == 0 for i in settings["table"]): + self.process = KratosGeo.ApplyConstantPhreaticMultiLinePressureProcess(self.model_part, self.params) + else: + self.params.AddValue("table",settings["table"]) + self.process = KratosGeo.ApplyPhreaticMultiLinePressureTableProcess(self.model_part, self.params) elif settings["fluid_pressure_type"].GetString() == "Interpolate_Line": self.params.AddValue("gravity_direction",settings["gravity_direction"]) self.params.AddValue("out_of_plane_direction",settings["out_of_plane_direction"]) diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json index 466e0b41a0fe..48435dbb41e6 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json @@ -87,7 +87,7 @@ "gidpost_flags": { "WriteDeformedMeshFlag": "WriteUndeformed", "WriteConditionsFlag": "WriteElementsOnly", - "GiDPostMode": "GiD_PostBinary", + "GiDPostMode": "GiD_PostAscii", "MultiFileFlag": "SingleFile" }, "file_label": "step", @@ -151,7 +151,7 @@ "variable_name": "WATER_PRESSURE", "is_fixed": true, "value": 0.0, - "table": 1, + "table": [1,2], "fluid_pressure_type": "Phreatic_Line", "gravity_direction": 1, "out_of_plane_direction": 2, diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/test_inclinded_phreatic_line_time_dependent.mdpa b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/test_inclinded_phreatic_line_time_dependent.mdpa index e7f9cc30f224..318942fb653e 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/test_inclinded_phreatic_line_time_dependent.mdpa +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/test_inclinded_phreatic_line_time_dependent.mdpa @@ -3,6 +3,10 @@ Begin Table 1 TIME WATER_PRESSURE 1.0 0.5 End Table +Begin Table 2 TIME WATER_PRESSURE + 0.0 0.0 + 1.0 0.0 +End Table Begin Properties 1 End Properties @@ -1501,6 +1505,7 @@ End SubModelPart Begin SubModelPart Fluid_Pressure-auto-1 Begin SubModelPartTables 1 + 2 End SubModelPartTables Begin SubModelPartNodes 1 diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/MaterialParameters.json new file mode 100644 index 000000000000..7794c8263b80 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/MaterialParameters.json @@ -0,0 +1,27 @@ +{ + "properties": [{ + "model_part_name": "PorousDomain.Soil_drained-auto-1", + "properties_id": 1, + "Material": { + "constitutive_law": { + "name" : "GeoLinearElasticPlaneStrain2DLaw" + }, + "Variables": { + "IGNORE_UNDRAINED" : true, + "YOUNG_MODULUS" : 3.0e7, + "POISSON_RATIO" : 0.2, + "DENSITY_SOLID" : 2.0e3, + "DENSITY_WATER" : 1.0e3, + "POROSITY" : 0.3, + "BULK_MODULUS_SOLID" : 1.0e12, + "BULK_MODULUS_FLUID" : 2.0e-30, + "PERMEABILITY_XX" : 4.5e-30, + "PERMEABILITY_YY" : 4.5e-30, + "PERMEABILITY_XY" : 0.0, + "DYNAMIC_VISCOSITY" : 1.0e-3, + "THICKNESS" : 1.0 + }, + "Tables": {} + } + }] +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/ProjectParameters.json new file mode 100644 index 000000000000..7cf0ef206f65 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/ProjectParameters.json @@ -0,0 +1,166 @@ +{ + "problem_data": { + "problem_name": "test_inclinded_phreatic_multi_line_time_dependent", + "start_time": 0.0, + "end_time": 4.0, + "echo_level": 1, + "parallel_type": "OpenMP", + "number_of_threads": 1 + }, + "solver_settings": { + "solver_type": "U_Pw", + "model_part_name": "PorousDomain", + "domain_size": 2, + "start_time": 0.0, + "model_import_settings": { + "input_type": "mdpa", + "input_filename": "test_inclinded_phreatic_multi_line_time_dependent" + }, + "material_import_settings": { + "materials_filename": "MaterialParameters.json" + }, + "time_stepping": { + "time_step": 0.25 + }, + "buffer_size": 2, + "echo_level": 1, + "clear_storage": false, + "compute_reactions": false, + "move_mesh_flag": true, + "reform_dofs_at_each_step": false, + "nodal_smoothing": false, + "block_builder": true, + "solution_type": "Quasi-Static", + "scheme_type": "Newmark", + "newmark_beta": 0.25, + "newmark_gamma": 0.5, + "newmark_theta": 0.5, + "rayleigh_m": 0.0, + "rayleigh_k": 0.0, + "strategy_type": "newton_raphson", + "convergence_criterion": "displacement_criterion", + "displacement_relative_tolerance": 1.0E-4, + "displacement_absolute_tolerance": 1.0E-9, + "residual_relative_tolerance": 1.0E-4, + "residual_absolute_tolerance": 1.0E-9, + "min_iterations": 2, + "max_iterations": 15, + "number_cycles": 100, + "reduction_factor": 0.5, + "increase_factor": 2.0, + "realised_factor": 0.9999, + "desired_iterations": 4, + "max_radius_factor": 10.0, + "min_radius_factor": 0.1, + "calculate_reactions": true, + "max_line_search_iterations": 5, + "first_alpha_value": 0.5, + "second_alpha_value": 1.0, + "min_alpha": 0.1, + "max_alpha": 2.0, + "line_search_tolerance": 0.5, + "rotation_dofs": true, + "linear_solver_settings": { + "solver_type": "amgcl", + "smoother_type": "ilu0", + "krylov_type": "gmres", + "coarsening_type": "aggregation", + "max_iteration": 100, + "verbosity": 0, + "tolerance": 1.0e-6, + "scaling": false + }, + "problem_domain_sub_model_part_list": ["Soil_drained-auto-1"], + "processes_sub_model_part_list": ["Solid_Displacement-auto-1","Solid_Displacement-auto-2","Solid_Displacement-auto-3","Fluid_Pressure-auto-1"], + "body_domain_sub_model_part_list": ["Soil_drained-auto-1"] + }, + "output_processes": { + "gid_output": [{ + "python_module": "gid_output_process", + "kratos_module": "KratosMultiphysics", + "process_name": "GiDOutputProcess", + "Parameters": { + "model_part_name": "PorousDomain.porous_computational_model_part", + "output_name": "test_inclinded_phreatic_multi_line_time_dependent", + "postprocess_parameters": { + "result_file_configuration": { + "gidpost_flags": { + "WriteDeformedMeshFlag": "WriteUndeformed", + "WriteConditionsFlag": "WriteElementsOnly", + "GiDPostMode": "GiD_PostAscii", + "MultiFileFlag": "SingleFile" + }, + "file_label": "step", + "output_control_type": "step", + "output_interval": 1, + "body_output": true, + "node_output": false, + "skin_output": false, + "plane_output": [], + "nodal_results": ["DISPLACEMENT","WATER_PRESSURE"], + "gauss_point_results": ["GREEN_LAGRANGE_STRAIN_TENSOR","CAUCHY_STRESS_TENSOR","TOTAL_STRESS_TENSOR","VON_MISES_STRESS","FLUID_FLUX_VECTOR"] + }, + "point_data_configuration": [] + } + } + }] + }, + "processes": { + "constraints_process_list": [{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-1", + "variable_name": "DISPLACEMENT", + "active": [true,false,false], + "is_fixed": [true,false,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-2", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-3", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_scalar_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyScalarConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Fluid_Pressure-auto-1", + "variable_name": "WATER_PRESSURE", + "is_fixed": true, + "value": 0.0, + "table": [0, 1, 0], + "fluid_pressure_type": "Phreatic_Multi_Line", + "gravity_direction": 1, + "out_of_plane_direction": 2, + "x_coordinates" : [0.0,0.5,1.0], + "y_coordinates": [0.5,0.5,0.5], + "z_coordinates": [0.0,0.0,0.0], + "specific_weight": 10000.0 + } + }], + "loads_process_list": [] + } +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/test_inclinded_phreatic_multi_line_time_dependent.mdpa b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/test_inclinded_phreatic_multi_line_time_dependent.mdpa new file mode 100644 index 000000000000..080ba2866c34 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/test_inclinded_phreatic_multi_line_time_dependent.mdpa @@ -0,0 +1,1765 @@ +Begin Table 1 TIME WATER_PRESSURE + 0.0 0.0 + 1.0 0.5 + 2.0 0.0 + 3.0 -0.5 + 4.0 0.0 +End Table + +Begin Properties 1 +End Properties + + +Begin Nodes + 1 0.0000000000 0.0000000000 0.0000000000 + 2 0.0000000000 0.0714285714 0.0000000000 + 3 0.0714285714 0.0000000000 0.0000000000 + 4 0.0776346270 0.0988478008 0.0000000000 + 5 0.1428571429 0.0000000000 0.0000000000 + 6 0.0000000000 0.1428571429 0.0000000000 + 7 0.1520793486 0.0680781786 0.0000000000 + 8 0.0907159317 0.1726464868 0.0000000000 + 9 0.1515839106 0.1380764253 0.0000000000 + 10 0.2142857143 0.0000000000 0.0000000000 + 11 0.0000000000 0.2142857143 0.0000000000 + 12 0.2124518894 0.1035063639 0.0000000000 + 13 0.1510884725 0.2080746720 0.0000000000 + 14 0.0902204937 0.2426447335 0.0000000000 + 15 0.2119564514 0.1735046106 0.0000000000 + 16 0.2733198683 0.0689363025 0.0000000000 + 17 0.2857142857 0.0000000000 0.0000000000 + 18 0.0000000000 0.2857142857 0.0000000000 + 19 0.2728244303 0.1389345492 0.0000000000 + 20 0.1505930345 0.2780729187 0.0000000000 + 21 0.2114610134 0.2435028573 0.0000000000 + 22 0.0897250556 0.3126429802 0.0000000000 + 23 0.2723289923 0.2089327959 0.0000000000 + 24 0.3375182442 0.0986367809 0.0000000000 + 25 0.3571428571 0.0000000000 0.0000000000 + 26 0.0000000000 0.3571428571 0.0000000000 + 27 0.3331969711 0.1743627344 0.0000000000 + 28 0.2109655754 0.3135011040 0.0000000000 + 29 0.1500975965 0.3480711654 0.0000000000 + 30 0.2718335542 0.2789310426 0.0000000000 + 31 0.0892296176 0.3826412269 0.0000000000 + 32 0.3945603880 0.0697944263 0.0000000000 + 33 0.3327015331 0.2443609811 0.0000000000 + 34 0.3940649500 0.1397926730 0.0000000000 + 35 0.4285714286 0.0000000000 0.0000000000 + 36 0.0000000000 0.4285714286 0.0000000000 + 37 0.2104701374 0.3834993507 0.0000000000 + 38 0.2713381162 0.3489292893 0.0000000000 + 39 0.1496021585 0.4180694121 0.0000000000 + 40 0.3935695120 0.2097909197 0.0000000000 + 41 0.3322060951 0.3143592278 0.0000000000 + 42 0.0887341796 0.4526394736 0.0000000000 + 43 0.4504567725 0.0993518841 0.0000000000 + 44 0.3930740740 0.2797891664 0.0000000000 + 45 0.4544374909 0.1752208582 0.0000000000 + 46 0.2708426782 0.4189275360 0.0000000000 + 47 0.2099746993 0.4534975974 0.0000000000 + 48 0.5000000000 0.0000000000 0.0000000000 + 49 0.0000000000 0.5000000000 0.0000000000 + 50 0.3317106570 0.3843574743 0.0000000000 + 51 0.1491067205 0.4880676588 0.0000000000 + 52 0.4539420528 0.2452191049 0.0000000000 + 53 0.5158009078 0.0706525501 0.0000000000 + 54 0.3925786357 0.3497874127 0.0000000000 + 55 0.0882387416 0.5226377203 0.0000000000 + 56 0.5153054697 0.1406507968 0.0000000000 + 57 0.4534466145 0.3152173510 0.0000000000 + 58 0.5148100317 0.2106490435 0.0000000000 + 59 0.2703472404 0.4889257827 0.0000000000 + 60 0.3312152192 0.4543557210 0.0000000000 + 61 0.2094792613 0.5234958441 0.0000000000 + 62 0.5714285714 0.0000000000 0.0000000000 + 63 0.0000000000 0.5714285714 0.0000000000 + 64 0.3920831979 0.4197856594 0.0000000000 + 65 0.1486112825 0.5580659055 0.0000000000 + 66 0.5753000629 0.1000669874 0.0000000000 + 67 0.5143145937 0.2806472902 0.0000000000 + 68 0.4529511767 0.3852155978 0.0000000000 + 69 0.0877433036 0.5926359670 0.0000000000 + 70 0.5756780106 0.1760789821 0.0000000000 + 71 0.3307197811 0.5243539682 0.0000000000 + 72 0.2698518022 0.5589240294 0.0000000000 + 73 0.5138191550 0.3506455369 0.0000000000 + 74 0.5751825726 0.2460772288 0.0000000000 + 75 0.3915877600 0.4897839066 0.0000000000 + 76 0.2089838233 0.5934940908 0.0000000000 + 77 0.6370414278 0.0715106742 0.0000000000 + 78 0.4524557380 0.4552138444 0.0000000000 + 79 0.6428571429 0.0000000000 0.0000000000 + 80 0.0000000000 0.6428571429 0.0000000000 + 81 0.1481158457 0.6280641506 0.0000000000 + 82 0.6365459899 0.1415089210 0.0000000000 + 83 0.5746871342 0.3160754760 0.0000000000 + 84 0.5133237171 0.4206437834 0.0000000000 + 85 0.0872478660 0.6626342106 0.0000000000 + 86 0.6360505518 0.2115071679 0.0000000000 + 87 0.3302243426 0.5943522149 0.0000000000 + 88 0.3910923221 0.5597821533 0.0000000000 + 89 0.2693563640 0.6289222760 0.0000000000 + 90 0.5741916959 0.3860737220 0.0000000000 + 91 0.4519603009 0.5252120918 0.0000000000 + 92 0.6355551133 0.2815054146 0.0000000000 + 93 0.2084883857 0.6634923374 0.0000000000 + 94 0.7001433534 0.1007820910 0.0000000000 + 95 0.5128282786 0.4906420301 0.0000000000 + 96 0.1476204060 0.6980623973 0.0000000000 + 97 0.7142857143 0.0000000000 0.0000000000 + 98 0.0000000000 0.7142857143 0.0000000000 + 99 0.6969185306 0.1769371066 0.0000000000 + 100 0.6350596749 0.3515036612 0.0000000000 + 101 0.5736962577 0.4560719691 0.0000000000 + 102 0.0867524267 0.7326324579 0.0000000000 + 103 0.6964230920 0.2469353532 0.0000000000 + 104 0.3905968836 0.6297804001 0.0000000000 + 105 0.3297289033 0.6643504612 0.0000000000 + 106 0.4514648630 0.5952103385 0.0000000000 + 107 0.2688609243 0.6989205222 0.0000000000 + 108 0.5123328418 0.5606402769 0.0000000000 + 109 0.7582819479 0.0723687987 0.0000000000 + 110 0.6345642367 0.4215019076 0.0000000000 + 111 0.2079929457 0.7334905840 0.0000000000 + 112 0.6959276538 0.3169335998 0.0000000000 + 113 0.7577865096 0.1423670454 0.0000000000 + 114 0.5732008201 0.5260702143 0.0000000000 + 115 0.1471249672 0.7680606437 0.0000000000 + 116 0.7857142857 0.0000000000 0.0000000000 + 117 0.0000000000 0.7857142857 0.0000000000 + 118 0.7572860102 0.2123746795 0.0000000000 + 119 0.6954322157 0.3869318465 0.0000000000 + 120 0.3901014431 0.6997786459 0.0000000000 + 121 0.6340687986 0.4915001543 0.0000000000 + 122 0.4509694216 0.6652085838 0.0000000000 + 123 0.3292334646 0.7343487078 0.0000000000 + 124 0.0862569880 0.8026307045 0.0000000000 + 125 0.7567969679 0.2823701526 0.0000000000 + 126 0.5118374039 0.6306385236 0.0000000000 + 127 0.2683654869 0.7689187686 0.0000000000 + 128 0.8193591446 0.0872021784 0.0000000000 + 129 0.5727053828 0.5960684621 0.0000000000 + 130 0.2074975077 0.8034888295 0.0000000000 + 131 0.6949367775 0.4569300929 0.0000000000 + 132 0.7563059607 0.3523684526 0.0000000000 + 133 0.8181499369 0.1777973059 0.0000000000 + 134 0.6335733613 0.5614983995 0.0000000000 + 135 0.1466295286 0.8380588904 0.0000000000 + 136 0.8176627030 0.2477959626 0.0000000000 + 137 0.8571428571 0.0000000000 0.0000000000 + 138 0.0000000000 0.8571428571 0.0000000000 + 139 0.4504739844 0.7352068305 0.0000000000 + 140 0.3896060057 0.7697768924 0.0000000000 + 141 0.7558057104 0.4223635832 0.0000000000 + 142 0.5113419629 0.7006367683 0.0000000000 + 143 0.3287380273 0.8043469545 0.0000000000 + 144 0.6944402915 0.5269298688 0.0000000000 + 145 0.8171718080 0.3177945936 0.0000000000 + 146 0.0857615493 0.8726289513 0.0000000000 + 147 0.5722103607 0.6660667414 0.0000000000 + 148 0.2678700483 0.8389170152 0.0000000000 + 149 0.8799109224 0.0739567803 0.0000000000 + 150 0.8785275524 0.1439253187 0.0000000000 + 151 0.6330782106 0.6314963928 0.0000000000 + 152 0.7553077665 0.4923601335 0.0000000000 + 153 0.2054987581 0.8779407470 0.0000000000 + 154 0.8785275524 0.2132175384 0.0000000000 + 155 0.8166681241 0.3877899638 0.0000000000 + 156 0.6939466362 0.5969279783 0.0000000000 + 157 0.1461340900 0.9080571371 0.0000000000 + 158 0.4499785468 0.8052050773 0.0000000000 + 159 0.8780384510 0.2832214669 0.0000000000 + 160 0.5108465257 0.7706350151 0.0000000000 + 161 0.3891105682 0.8397751391 0.0000000000 + 162 0.0000000000 0.9285714286 0.0000000000 + 163 0.9285714286 0.0000000000 0.0000000000 + 164 0.5717145005 0.7360649328 0.0000000000 + 165 0.3282425891 0.8743452000 0.0000000000 + 166 0.8161726575 0.4577880342 0.0000000000 + 167 0.7548133486 0.5623559903 0.0000000000 + 168 0.6325824083 0.7014945307 0.0000000000 + 169 0.9389178239 0.1084828019 0.0000000000 + 170 0.8775329145 0.3532199938 0.0000000000 + 171 0.0892362707 0.9418515034 0.0000000000 + 172 0.9393782217 0.1785714286 0.0000000000 + 173 0.6934502934 0.6669245192 0.0000000000 + 174 0.2065066306 0.9434853229 0.0000000000 + 175 0.2583547433 0.9356372868 0.0000000000 + 176 0.9389178239 0.2486600552 0.0000000000 + 177 0.8156812462 0.5277858896 0.0000000000 + 178 0.8770401967 0.4232175552 0.0000000000 + 179 0.5103510877 0.8406332634 0.0000000000 + 180 0.4494831082 0.8752033241 0.0000000000 + 181 0.7543181403 0.6323542259 0.0000000000 + 182 0.5712190709 0.8060632062 0.0000000000 + 183 0.9384067878 0.3186595991 0.0000000000 + 184 0.6320871142 0.7714932043 0.0000000000 + 185 0.3277471506 0.9443434467 0.0000000000 + 186 1.0000000000 0.0000000000 0.0000000000 + 187 0.0000000000 1.0000000000 0.0000000000 + 188 1.0000000000 0.0714285714 0.0000000000 + 189 0.0714285714 1.0000000000 0.0000000000 + 190 0.3898979103 0.9255526687 0.0000000000 + 191 0.8765454154 0.4932157626 0.0000000000 + 192 1.0000000000 0.1428571429 0.0000000000 + 193 0.1428571429 1.0000000000 0.0000000000 + 194 0.8151859727 0.5977839324 0.0000000000 + 195 0.6929549044 0.7369227396 0.0000000000 + 196 0.9379078372 0.3886469037 0.0000000000 + 197 1.0000000000 0.2142857143 0.0000000000 + 198 0.2142857143 1.0000000000 0.0000000000 + 199 0.7538229694 0.7023524736 0.0000000000 + 200 1.0000000000 0.2857142857 0.0000000000 + 201 0.2857142857 1.0000000000 0.0000000000 + 202 0.8760533420 0.5632132129 0.0000000000 + 203 0.9374130699 0.4586451524 0.0000000000 + 204 0.5098556487 0.9106315102 0.0000000000 + 205 0.5707239399 0.8760615506 0.0000000000 + 206 0.4489876705 0.9452015708 0.0000000000 + 207 0.6315920134 0.8414914622 0.0000000000 + 208 0.8146908143 0.6677821779 0.0000000000 + 209 1.0000000000 0.3571428571 0.0000000000 + 210 0.3571428571 1.0000000000 0.0000000000 + 211 0.6924598483 0.8069211296 0.0000000000 + 212 0.9369182740 0.5286434009 0.0000000000 + 213 0.7533280008 0.7723510893 0.0000000000 + 214 0.8755588664 0.6332114152 0.0000000000 + 215 1.0000000000 0.4285714286 0.0000000000 + 216 0.4285714286 1.0000000000 0.0000000000 + 217 0.8141956465 0.7377804263 0.0000000000 + 218 0.5702281628 0.9460598503 0.0000000000 + 219 0.6310965106 0.9114897323 0.0000000000 + 220 0.9364253293 0.5986409720 0.0000000000 + 221 0.6919647133 0.8769193807 0.0000000000 + 222 1.0000000000 0.5000000000 0.0000000000 + 223 0.5000000000 1.0000000000 0.0000000000 + 224 0.8750638238 0.7032097672 0.0000000000 + 225 0.7528332282 0.8423493425 0.0000000000 + 226 0.8137008832 0.8077787070 0.0000000000 + 227 0.9359314630 0.6686389474 0.0000000000 + 228 1.0000000000 0.5714285714 0.0000000000 + 229 0.5714285714 1.0000000000 0.0000000000 + 230 0.8745686042 0.7732081323 0.0000000000 + 231 0.6914692701 0.9469177118 0.0000000000 + 232 1.0000000000 0.6428571429 0.0000000000 + 233 0.6428571429 1.0000000000 0.0000000000 + 234 0.9354363083 0.7386375863 0.0000000000 + 235 0.7517405304 0.9273912656 0.0000000000 + 236 0.8132061034 0.8777769589 0.0000000000 + 237 0.8740737271 0.8432063903 0.0000000000 + 238 1.0000000000 0.7142857143 0.0000000000 + 239 0.7142857143 1.0000000000 0.0000000000 + 240 0.9349414289 0.8086358374 0.0000000000 + 241 0.8162765415 0.9436745703 0.0000000000 + 242 0.8735789308 0.9132046269 0.0000000000 + 243 1.0000000000 0.7857142857 0.0000000000 + 244 0.7857142857 1.0000000000 0.0000000000 + 245 0.9344465927 0.8786340148 0.0000000000 + 246 1.0000000000 0.8571428571 0.0000000000 + 247 0.8571428571 1.0000000000 0.0000000000 + 248 0.9339517917 0.9486322651 0.0000000000 + 249 1.0000000000 0.9285714286 0.0000000000 + 250 0.9285714286 1.0000000000 0.0000000000 + 251 1.0000000000 1.0000000000 0.0000000000 +End Nodes + + +Begin Elements UPwSmallStrainElement2D3N + 1 1 1 3 2 + 2 1 192 197 172 + 3 1 172 197 176 + 4 1 192 172 169 + 5 1 176 197 200 + 6 1 172 176 154 + 7 1 169 172 150 + 8 1 154 176 159 + 9 1 159 176 183 + 10 1 154 159 136 + 11 1 183 176 200 + 12 1 183 200 209 + 13 1 159 183 170 + 14 1 136 159 145 + 15 1 154 136 133 + 16 1 159 170 145 + 17 1 145 170 155 + 18 1 136 145 125 + 19 1 133 136 118 + 20 1 155 170 178 + 21 1 125 145 132 + 22 1 118 136 125 + 23 1 155 178 166 + 24 1 132 145 155 + 25 1 132 155 141 + 26 1 166 178 191 + 27 1 155 166 141 + 28 1 191 178 203 + 29 1 141 166 152 + 30 1 203 178 196 + 31 1 191 203 212 + 32 1 152 166 177 + 33 1 196 178 170 + 34 1 203 196 215 + 35 1 203 215 222 + 36 1 212 203 222 + 37 1 212 222 228 + 38 1 177 166 191 + 39 1 196 170 183 + 40 1 196 183 209 + 41 1 196 209 215 + 42 1 177 191 202 + 43 1 202 191 212 + 44 1 177 202 194 + 45 1 202 212 220 + 46 1 194 202 214 + 47 1 177 194 167 + 48 1 220 212 228 + 49 1 220 228 232 + 50 1 214 202 220 + 51 1 167 194 181 + 52 1 177 167 152 + 53 1 214 220 227 + 54 1 181 194 208 + 55 1 152 167 144 + 56 1 227 220 232 + 57 1 227 232 238 + 58 1 208 194 214 + 59 1 181 208 199 + 60 1 144 167 156 + 61 1 208 214 224 + 62 1 199 208 217 + 63 1 181 199 173 + 64 1 156 167 181 + 65 1 217 208 224 + 66 1 181 173 156 + 67 1 217 224 230 + 68 1 156 173 151 + 69 1 217 230 226 + 70 1 151 173 168 + 71 1 226 230 237 + 72 1 217 226 213 + 73 1 168 173 195 + 74 1 237 230 240 + 75 1 213 226 225 + 76 1 195 173 199 + 77 1 240 230 234 + 78 1 225 226 236 + 79 1 195 199 213 + 80 1 234 230 224 + 81 1 236 226 237 + 82 1 213 199 217 + 83 1 195 213 211 + 84 1 236 237 242 + 85 1 211 213 225 + 86 1 195 211 184 + 87 1 242 237 245 + 88 1 184 211 207 + 89 1 195 184 168 + 90 1 245 237 240 + 91 1 207 211 221 + 92 1 168 184 164 + 93 1 245 240 246 + 94 1 245 246 249 + 95 1 221 211 225 + 96 1 164 184 182 + 97 1 221 225 235 + 98 1 182 184 207 + 99 1 164 182 160 + 100 1 235 225 236 + 101 1 182 207 205 + 102 1 160 182 179 + 103 1 235 236 241 + 104 1 205 207 219 + 105 1 179 182 205 + 106 1 160 179 158 + 107 1 241 236 242 + 108 1 219 207 221 + 109 1 158 179 180 + 110 1 160 158 139 + 111 1 219 221 231 + 112 1 180 179 204 + 113 1 139 158 140 + 114 1 160 139 142 + 115 1 231 221 235 + 116 1 204 179 205 + 117 1 140 158 161 + 118 1 142 139 122 + 119 1 231 235 239 + 120 1 204 205 218 + 121 1 161 158 180 + 122 1 122 139 120 + 123 1 218 205 219 + 124 1 204 218 223 + 125 1 161 180 190 + 126 1 120 139 140 + 127 1 218 219 233 + 128 1 190 180 206 + 129 1 161 190 165 + 130 1 120 140 123 + 131 1 206 180 204 + 132 1 190 216 210 + 133 1 165 190 185 + 134 1 123 140 143 + 135 1 206 204 223 + 136 1 185 190 210 + 137 1 185 210 201 + 138 1 185 201 175 + 139 1 175 201 198 + 140 1 185 175 165 + 141 1 143 140 161 + 142 1 143 161 165 + 143 1 143 165 148 + 144 1 148 165 175 + 145 1 143 148 127 + 146 1 127 148 130 + 147 1 143 127 123 + 148 1 130 148 153 + 149 1 123 127 107 + 150 1 153 148 175 + 151 1 130 153 135 + 152 1 107 127 111 + 153 1 123 107 105 + 154 1 135 153 157 + 155 1 130 135 115 + 156 1 111 127 130 + 157 1 157 153 174 + 158 1 130 115 111 + 159 1 174 153 175 + 160 1 174 175 198 + 161 1 174 198 193 + 162 1 157 174 193 + 163 1 111 115 96 + 164 1 96 115 102 + 165 1 111 96 93 + 166 1 102 115 124 + 167 1 93 96 81 + 168 1 111 93 107 + 169 1 124 115 135 + 170 1 81 96 85 + 171 1 107 93 89 + 172 1 85 96 102 + 173 1 89 93 76 + 174 1 107 89 105 + 175 1 76 93 81 + 176 1 89 76 72 + 177 1 105 89 87 + 178 1 72 76 61 + 179 1 89 72 87 + 180 1 61 76 65 + 181 1 87 72 71 + 182 1 65 76 81 + 183 1 61 65 51 + 184 1 71 72 59 + 185 1 51 65 55 + 186 1 61 51 47 + 187 1 59 72 61 + 188 1 55 65 69 + 189 1 47 51 39 + 190 1 59 61 47 + 191 1 69 65 81 + 192 1 39 51 42 + 193 1 69 81 85 + 194 1 42 51 55 + 195 1 39 42 31 + 196 1 69 85 80 + 197 1 42 55 49 + 198 1 31 42 36 + 199 1 124 135 146 + 200 1 146 135 157 + 201 1 124 146 138 + 202 1 146 157 171 + 203 1 171 157 193 + 204 1 146 171 162 + 205 1 47 39 37 + 206 1 37 39 29 + 207 1 47 37 46 + 208 1 29 39 31 + 209 1 37 29 28 + 210 1 46 37 38 + 211 1 29 31 22 + 212 1 37 28 38 + 213 1 22 31 26 + 214 1 38 28 30 + 215 1 30 28 21 + 216 1 38 30 41 + 217 1 21 28 20 + 218 1 30 21 23 + 219 1 41 30 33 + 220 1 20 28 29 + 221 1 23 21 15 + 222 1 33 30 23 + 223 1 20 29 22 + 224 1 15 21 13 + 225 1 20 22 14 + 226 1 13 21 20 + 227 1 15 13 9 + 228 1 14 22 18 + 229 1 13 20 14 + 230 1 9 13 8 + 231 1 13 14 8 + 232 1 9 8 4 + 233 1 8 14 11 + 234 1 4 8 6 + 235 1 9 4 7 + 236 1 7 4 3 + 237 1 9 7 12 + 238 1 12 7 10 + 239 1 9 12 15 + 240 1 15 12 19 + 241 1 19 12 16 + 242 1 15 19 23 + 243 1 16 12 10 + 244 1 19 16 24 + 245 1 23 19 27 + 246 1 24 16 25 + 247 1 27 19 24 + 248 1 23 27 33 + 249 1 27 24 34 + 250 1 33 27 40 + 251 1 34 24 32 + 252 1 40 27 34 + 253 1 33 40 44 + 254 1 32 24 25 + 255 1 40 34 45 + 256 1 44 40 52 + 257 1 45 34 43 + 258 1 40 45 52 + 259 1 43 34 32 + 260 1 52 45 58 + 261 1 43 32 35 + 262 1 58 45 56 + 263 1 52 58 67 + 264 1 56 45 43 + 265 1 58 56 70 + 266 1 67 58 74 + 267 1 56 43 53 + 268 1 70 56 66 + 269 1 74 58 70 + 270 1 53 43 35 + 271 1 66 56 53 + 272 1 66 53 62 + 273 1 47 46 59 + 274 1 59 46 60 + 275 1 60 46 50 + 276 1 59 60 71 + 277 1 50 46 38 + 278 1 60 50 64 + 279 1 71 60 75 + 280 1 50 38 41 + 281 1 64 50 54 + 282 1 75 60 64 + 283 1 54 50 41 + 284 1 64 54 68 + 285 1 54 41 44 + 286 1 68 54 57 + 287 1 44 41 33 + 288 1 54 44 57 + 289 1 57 44 52 + 290 1 57 52 67 + 291 1 57 67 73 + 292 1 73 67 83 + 293 1 57 73 68 + 294 1 83 67 74 + 295 1 68 73 84 + 296 1 83 74 92 + 297 1 84 73 90 + 298 1 68 84 78 + 299 1 92 74 86 + 300 1 90 73 83 + 301 1 78 84 95 + 302 1 86 74 70 + 303 1 90 83 100 + 304 1 95 84 101 + 305 1 86 70 82 + 306 1 100 83 92 + 307 1 101 84 90 + 308 1 82 70 66 + 309 1 101 90 110 + 310 1 82 66 77 + 311 1 110 90 100 + 312 1 101 110 121 + 313 1 77 66 62 + 314 1 110 100 119 + 315 1 121 110 131 + 316 1 119 100 112 + 317 1 110 119 131 + 318 1 112 100 92 + 319 1 131 119 141 + 320 1 112 92 103 + 321 1 141 119 132 + 322 1 131 141 152 + 323 1 103 92 86 + 324 1 132 119 112 + 325 1 103 86 99 + 326 1 132 112 125 + 327 1 99 86 82 + 328 1 125 112 103 + 329 1 99 82 94 + 330 1 94 82 77 + 331 1 99 94 113 + 332 1 113 94 109 + 333 1 99 113 118 + 334 1 109 94 97 + 335 1 99 118 103 + 336 1 103 118 125 + 337 1 71 75 88 + 338 1 88 75 91 + 339 1 71 88 87 + 340 1 91 75 78 + 341 1 88 91 106 + 342 1 87 88 104 + 343 1 78 75 64 + 344 1 106 91 108 + 345 1 104 88 106 + 346 1 108 91 95 + 347 1 106 108 126 + 348 1 95 91 78 + 349 1 108 95 114 + 350 1 126 108 129 + 351 1 114 95 101 + 352 1 108 114 129 + 353 1 114 101 121 + 354 1 129 114 134 + 355 1 114 121 134 + 356 1 129 134 151 + 357 1 134 121 144 + 358 1 151 134 156 + 359 1 129 151 147 + 360 1 144 121 131 + 361 1 156 134 144 + 362 1 147 151 168 + 363 1 147 168 164 + 364 1 147 164 142 + 365 1 142 164 160 + 366 1 147 142 126 + 367 1 126 142 122 + 368 1 147 126 129 + 369 1 87 104 105 + 370 1 105 104 120 + 371 1 120 104 122 + 372 1 105 120 123 + 373 1 122 104 106 + 374 1 122 106 126 + 375 1 144 131 152 + 376 1 224 214 227 + 377 1 224 227 234 + 378 1 234 227 238 + 379 1 234 238 243 + 380 1 240 234 243 + 381 1 240 243 246 + 382 1 242 245 248 + 383 1 248 245 249 + 384 1 248 249 251 + 385 1 242 248 247 + 386 1 102 124 117 + 387 1 113 109 128 + 388 1 128 109 116 + 389 1 113 128 133 + 390 1 133 128 150 + 391 1 133 150 154 + 392 1 154 150 172 + 393 1 150 128 149 + 394 1 149 128 137 + 395 1 150 149 169 + 396 1 169 149 163 + 397 1 113 133 118 + 398 1 235 241 244 + 399 1 244 241 247 + 400 1 247 241 242 + 401 1 68 78 64 + 402 1 94 77 97 + 403 1 55 69 63 + 404 1 219 231 233 + 405 1 85 102 98 + 406 1 192 169 188 + 407 1 239 233 231 + 408 1 239 235 244 + 409 1 63 49 55 + 410 1 62 79 77 + 411 1 193 189 171 + 412 1 171 189 162 + 413 1 17 25 16 + 414 1 17 16 10 + 415 1 216 190 206 + 416 1 216 206 223 + 417 1 18 11 14 + 418 1 137 163 149 + 419 1 251 250 248 + 420 1 248 250 247 + 421 1 138 117 124 + 422 1 5 10 7 + 423 1 5 7 3 + 424 1 229 223 218 + 425 1 229 218 233 + 426 1 36 26 31 + 427 1 97 116 109 + 428 1 187 162 189 + 429 1 35 48 53 + 430 1 6 2 4 + 431 1 186 188 163 + 432 1 98 80 85 + 433 1 49 36 42 + 434 1 79 97 77 + 435 1 25 35 32 + 436 1 11 6 8 + 437 1 117 98 102 + 438 1 26 18 22 + 439 1 116 137 128 + 440 1 162 138 146 + 441 1 48 62 53 + 442 1 80 63 69 + 443 1 188 169 163 + 444 1 4 2 3 +End Elements + + + +Begin SubModelPart Soil_drained-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 6 + 11 + 18 + 26 + 36 + 49 + 63 + 80 + 98 + 117 + 138 + 162 + 186 + 187 + 188 + 192 + 197 + 200 + 209 + 215 + 222 + 228 + 232 + 238 + 243 + 246 + 249 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-2 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 3 + 5 + 10 + 17 + 25 + 35 + 48 + 62 + 79 + 97 + 116 + 137 + 163 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-3 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Fluid_Pressure-auto-1 + Begin SubModelPartTables + 1 + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/MaterialParameters.json new file mode 100644 index 000000000000..7794c8263b80 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/MaterialParameters.json @@ -0,0 +1,27 @@ +{ + "properties": [{ + "model_part_name": "PorousDomain.Soil_drained-auto-1", + "properties_id": 1, + "Material": { + "constitutive_law": { + "name" : "GeoLinearElasticPlaneStrain2DLaw" + }, + "Variables": { + "IGNORE_UNDRAINED" : true, + "YOUNG_MODULUS" : 3.0e7, + "POISSON_RATIO" : 0.2, + "DENSITY_SOLID" : 2.0e3, + "DENSITY_WATER" : 1.0e3, + "POROSITY" : 0.3, + "BULK_MODULUS_SOLID" : 1.0e12, + "BULK_MODULUS_FLUID" : 2.0e-30, + "PERMEABILITY_XX" : 4.5e-30, + "PERMEABILITY_YY" : 4.5e-30, + "PERMEABILITY_XY" : 0.0, + "DYNAMIC_VISCOSITY" : 1.0e-3, + "THICKNESS" : 1.0 + }, + "Tables": {} + } + }] +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json new file mode 100644 index 000000000000..6205be5f7a82 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json @@ -0,0 +1,166 @@ +{ + "problem_data": { + "problem_name": "test_inclined_phreatic_multi_line", + "start_time": 0.0, + "end_time": 1.0, + "echo_level": 1, + "parallel_type": "OpenMP", + "number_of_threads": 1 + }, + "solver_settings": { + "solver_type": "U_Pw", + "model_part_name": "PorousDomain", + "domain_size": 2, + "start_time": 0.0, + "model_import_settings": { + "input_type": "mdpa", + "input_filename": "test_inclined_phreatic_multi_line" + }, + "material_import_settings": { + "materials_filename": "MaterialParameters.json" + }, + "time_stepping": { + "time_step": 0.25 + }, + "buffer_size": 2, + "echo_level": 1, + "clear_storage": false, + "compute_reactions": false, + "move_mesh_flag": true, + "reform_dofs_at_each_step": false, + "nodal_smoothing": false, + "block_builder": true, + "solution_type": "Quasi-Static", + "scheme_type": "Newmark", + "newmark_beta": 0.25, + "newmark_gamma": 0.5, + "newmark_theta": 0.5, + "rayleigh_m": 0.0, + "rayleigh_k": 0.0, + "strategy_type": "newton_raphson", + "convergence_criterion": "displacement_criterion", + "displacement_relative_tolerance": 1.0E-4, + "displacement_absolute_tolerance": 1.0E-9, + "residual_relative_tolerance": 1.0E-4, + "residual_absolute_tolerance": 1.0E-9, + "min_iterations": 6, + "max_iterations": 15, + "number_cycles": 100, + "reduction_factor": 0.5, + "increase_factor": 2.0, + "realised_factor": 0.9999, + "desired_iterations": 4, + "max_radius_factor": 10.0, + "min_radius_factor": 0.1, + "calculate_reactions": true, + "max_line_search_iterations": 5, + "first_alpha_value": 0.5, + "second_alpha_value": 1.0, + "min_alpha": 0.1, + "max_alpha": 2.0, + "line_search_tolerance": 0.5, + "rotation_dofs": true, + "linear_solver_settings": { + "solver_type": "amgcl", + "smoother_type": "ilu0", + "krylov_type": "gmres", + "coarsening_type": "aggregation", + "max_iteration": 100, + "verbosity": 0, + "tolerance": 1.0e-6, + "scaling": false + }, + "problem_domain_sub_model_part_list": ["Soil_drained-auto-1"], + "processes_sub_model_part_list": ["Solid_Displacement-auto-1","Solid_Displacement-auto-2","Solid_Displacement-auto-3","Fluid_Pressure-auto-1"], + "body_domain_sub_model_part_list": ["Soil_drained-auto-1"] + }, + "output_processes": { + "gid_output": [{ + "python_module": "gid_output_process", + "kratos_module": "KratosMultiphysics", + "process_name": "GiDOutputProcess", + "Parameters": { + "model_part_name": "PorousDomain.porous_computational_model_part", + "output_name": "test_inclinded_phreatic_line", + "postprocess_parameters": { + "result_file_configuration": { + "gidpost_flags": { + "WriteDeformedMeshFlag": "WriteUndeformed", + "WriteConditionsFlag": "WriteElementsOnly", + "GiDPostMode": "GiD_PostBinary", + "MultiFileFlag": "SingleFile" + }, + "file_label": "step", + "output_control_type": "step", + "output_interval": 1, + "body_output": true, + "node_output": false, + "skin_output": false, + "plane_output": [], + "nodal_results": ["DISPLACEMENT","WATER_PRESSURE"], + "gauss_point_results": ["GREEN_LAGRANGE_STRAIN_TENSOR","CAUCHY_STRESS_TENSOR","TOTAL_STRESS_TENSOR","VON_MISES_STRESS","FLUID_FLUX_VECTOR"] + }, + "point_data_configuration": [] + } + } + }] + }, + "processes": { + "constraints_process_list": [{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-1", + "variable_name": "DISPLACEMENT", + "active": [true,false,false], + "is_fixed": [true,false,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-2", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-3", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_scalar_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyScalarConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Fluid_Pressure-auto-1", + "variable_name": "WATER_PRESSURE", + "is_fixed": true, + "value": 0.0, + "table": [0, 0], + "fluid_pressure_type": "Phreatic_Multi_Line", + "gravity_direction": 1, + "out_of_plane_direction": 2, + "x_coordinates" : [0.0,1.0], + "y_coordinates": [1.0,0.5], + "z_coordinates": [0.0,0.0], + "specific_weight": 10000.0 + } + }], + "loads_process_list": [] + } +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/test_inclined_phreatic_multi_line.mdpa b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/test_inclined_phreatic_multi_line.mdpa new file mode 100644 index 000000000000..6e57631c3459 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/test_inclined_phreatic_multi_line.mdpa @@ -0,0 +1,1757 @@ + +Begin Properties 1 +End Properties + + +Begin Nodes + 1 0.0000000000 0.0000000000 0.0000000000 + 2 0.0000000000 0.0714285714 0.0000000000 + 3 0.0714285714 0.0000000000 0.0000000000 + 4 0.0776346270 0.0988478008 0.0000000000 + 5 0.1428571429 0.0000000000 0.0000000000 + 6 0.0000000000 0.1428571429 0.0000000000 + 7 0.1520793486 0.0680781786 0.0000000000 + 8 0.0907159317 0.1726464868 0.0000000000 + 9 0.1515839106 0.1380764253 0.0000000000 + 10 0.2142857143 0.0000000000 0.0000000000 + 11 0.0000000000 0.2142857143 0.0000000000 + 12 0.2124518894 0.1035063639 0.0000000000 + 13 0.1510884725 0.2080746720 0.0000000000 + 14 0.0902204937 0.2426447335 0.0000000000 + 15 0.2119564514 0.1735046106 0.0000000000 + 16 0.2733198683 0.0689363025 0.0000000000 + 17 0.2857142857 0.0000000000 0.0000000000 + 18 0.0000000000 0.2857142857 0.0000000000 + 19 0.2728244303 0.1389345492 0.0000000000 + 20 0.1505930345 0.2780729187 0.0000000000 + 21 0.2114610134 0.2435028573 0.0000000000 + 22 0.0897250556 0.3126429802 0.0000000000 + 23 0.2723289923 0.2089327959 0.0000000000 + 24 0.3375182442 0.0986367809 0.0000000000 + 25 0.3571428571 0.0000000000 0.0000000000 + 26 0.0000000000 0.3571428571 0.0000000000 + 27 0.3331969711 0.1743627344 0.0000000000 + 28 0.2109655754 0.3135011040 0.0000000000 + 29 0.1500975965 0.3480711654 0.0000000000 + 30 0.2718335542 0.2789310426 0.0000000000 + 31 0.0892296176 0.3826412269 0.0000000000 + 32 0.3945603880 0.0697944263 0.0000000000 + 33 0.3327015331 0.2443609811 0.0000000000 + 34 0.3940649500 0.1397926730 0.0000000000 + 35 0.4285714286 0.0000000000 0.0000000000 + 36 0.0000000000 0.4285714286 0.0000000000 + 37 0.2104701374 0.3834993507 0.0000000000 + 38 0.2713381162 0.3489292893 0.0000000000 + 39 0.1496021585 0.4180694121 0.0000000000 + 40 0.3935695120 0.2097909197 0.0000000000 + 41 0.3322060951 0.3143592278 0.0000000000 + 42 0.0887341796 0.4526394736 0.0000000000 + 43 0.4504567725 0.0993518841 0.0000000000 + 44 0.3930740740 0.2797891664 0.0000000000 + 45 0.4544374909 0.1752208582 0.0000000000 + 46 0.2708426782 0.4189275360 0.0000000000 + 47 0.2099746993 0.4534975974 0.0000000000 + 48 0.5000000000 0.0000000000 0.0000000000 + 49 0.0000000000 0.5000000000 0.0000000000 + 50 0.3317106570 0.3843574743 0.0000000000 + 51 0.1491067205 0.4880676588 0.0000000000 + 52 0.4539420528 0.2452191049 0.0000000000 + 53 0.5158009078 0.0706525501 0.0000000000 + 54 0.3925786357 0.3497874127 0.0000000000 + 55 0.0882387416 0.5226377203 0.0000000000 + 56 0.5153054697 0.1406507968 0.0000000000 + 57 0.4534466145 0.3152173510 0.0000000000 + 58 0.5148100317 0.2106490435 0.0000000000 + 59 0.2703472404 0.4889257827 0.0000000000 + 60 0.3312152192 0.4543557210 0.0000000000 + 61 0.2094792613 0.5234958441 0.0000000000 + 62 0.5714285714 0.0000000000 0.0000000000 + 63 0.0000000000 0.5714285714 0.0000000000 + 64 0.3920831979 0.4197856594 0.0000000000 + 65 0.1486112825 0.5580659055 0.0000000000 + 66 0.5753000629 0.1000669874 0.0000000000 + 67 0.5143145937 0.2806472902 0.0000000000 + 68 0.4529511767 0.3852155978 0.0000000000 + 69 0.0877433036 0.5926359670 0.0000000000 + 70 0.5756780106 0.1760789821 0.0000000000 + 71 0.3307197811 0.5243539682 0.0000000000 + 72 0.2698518022 0.5589240294 0.0000000000 + 73 0.5138191550 0.3506455369 0.0000000000 + 74 0.5751825726 0.2460772288 0.0000000000 + 75 0.3915877600 0.4897839066 0.0000000000 + 76 0.2089838233 0.5934940908 0.0000000000 + 77 0.6370414278 0.0715106742 0.0000000000 + 78 0.4524557380 0.4552138444 0.0000000000 + 79 0.6428571429 0.0000000000 0.0000000000 + 80 0.0000000000 0.6428571429 0.0000000000 + 81 0.1481158457 0.6280641506 0.0000000000 + 82 0.6365459899 0.1415089210 0.0000000000 + 83 0.5746871342 0.3160754760 0.0000000000 + 84 0.5133237171 0.4206437834 0.0000000000 + 85 0.0872478660 0.6626342106 0.0000000000 + 86 0.6360505518 0.2115071679 0.0000000000 + 87 0.3302243426 0.5943522149 0.0000000000 + 88 0.3910923221 0.5597821533 0.0000000000 + 89 0.2693563640 0.6289222760 0.0000000000 + 90 0.5741916959 0.3860737220 0.0000000000 + 91 0.4519603009 0.5252120918 0.0000000000 + 92 0.6355551133 0.2815054146 0.0000000000 + 93 0.2084883857 0.6634923374 0.0000000000 + 94 0.7001433534 0.1007820910 0.0000000000 + 95 0.5128282786 0.4906420301 0.0000000000 + 96 0.1476204060 0.6980623973 0.0000000000 + 97 0.7142857143 0.0000000000 0.0000000000 + 98 0.0000000000 0.7142857143 0.0000000000 + 99 0.6969185306 0.1769371066 0.0000000000 + 100 0.6350596749 0.3515036612 0.0000000000 + 101 0.5736962577 0.4560719691 0.0000000000 + 102 0.0867524267 0.7326324579 0.0000000000 + 103 0.6964230920 0.2469353532 0.0000000000 + 104 0.3905968836 0.6297804001 0.0000000000 + 105 0.3297289033 0.6643504612 0.0000000000 + 106 0.4514648630 0.5952103385 0.0000000000 + 107 0.2688609243 0.6989205222 0.0000000000 + 108 0.5123328418 0.5606402769 0.0000000000 + 109 0.7582819479 0.0723687987 0.0000000000 + 110 0.6345642367 0.4215019076 0.0000000000 + 111 0.2079929457 0.7334905840 0.0000000000 + 112 0.6959276538 0.3169335998 0.0000000000 + 113 0.7577865096 0.1423670454 0.0000000000 + 114 0.5732008201 0.5260702143 0.0000000000 + 115 0.1471249672 0.7680606437 0.0000000000 + 116 0.7857142857 0.0000000000 0.0000000000 + 117 0.0000000000 0.7857142857 0.0000000000 + 118 0.7572860102 0.2123746795 0.0000000000 + 119 0.6954322157 0.3869318465 0.0000000000 + 120 0.3901014431 0.6997786459 0.0000000000 + 121 0.6340687986 0.4915001543 0.0000000000 + 122 0.4509694216 0.6652085838 0.0000000000 + 123 0.3292334646 0.7343487078 0.0000000000 + 124 0.0862569880 0.8026307045 0.0000000000 + 125 0.7567969679 0.2823701526 0.0000000000 + 126 0.5118374039 0.6306385236 0.0000000000 + 127 0.2683654869 0.7689187686 0.0000000000 + 128 0.8193591446 0.0872021784 0.0000000000 + 129 0.5727053828 0.5960684621 0.0000000000 + 130 0.2074975077 0.8034888295 0.0000000000 + 131 0.6949367775 0.4569300929 0.0000000000 + 132 0.7563059607 0.3523684526 0.0000000000 + 133 0.8181499369 0.1777973059 0.0000000000 + 134 0.6335733613 0.5614983995 0.0000000000 + 135 0.1466295286 0.8380588904 0.0000000000 + 136 0.8176627030 0.2477959626 0.0000000000 + 137 0.8571428571 0.0000000000 0.0000000000 + 138 0.0000000000 0.8571428571 0.0000000000 + 139 0.4504739844 0.7352068305 0.0000000000 + 140 0.3896060057 0.7697768924 0.0000000000 + 141 0.7558057104 0.4223635832 0.0000000000 + 142 0.5113419629 0.7006367683 0.0000000000 + 143 0.3287380273 0.8043469545 0.0000000000 + 144 0.6944402915 0.5269298688 0.0000000000 + 145 0.8171718080 0.3177945936 0.0000000000 + 146 0.0857615493 0.8726289513 0.0000000000 + 147 0.5722103607 0.6660667414 0.0000000000 + 148 0.2678700483 0.8389170152 0.0000000000 + 149 0.8799109224 0.0739567803 0.0000000000 + 150 0.8785275524 0.1439253187 0.0000000000 + 151 0.6330782106 0.6314963928 0.0000000000 + 152 0.7553077665 0.4923601335 0.0000000000 + 153 0.2054987581 0.8779407470 0.0000000000 + 154 0.8785275524 0.2132175384 0.0000000000 + 155 0.8166681241 0.3877899638 0.0000000000 + 156 0.6939466362 0.5969279783 0.0000000000 + 157 0.1461340900 0.9080571371 0.0000000000 + 158 0.4499785468 0.8052050773 0.0000000000 + 159 0.8780384510 0.2832214669 0.0000000000 + 160 0.5108465257 0.7706350151 0.0000000000 + 161 0.3891105682 0.8397751391 0.0000000000 + 162 0.0000000000 0.9285714286 0.0000000000 + 163 0.9285714286 0.0000000000 0.0000000000 + 164 0.5717145005 0.7360649328 0.0000000000 + 165 0.3282425891 0.8743452000 0.0000000000 + 166 0.8161726575 0.4577880342 0.0000000000 + 167 0.7548133486 0.5623559903 0.0000000000 + 168 0.6325824083 0.7014945307 0.0000000000 + 169 0.9389178239 0.1084828019 0.0000000000 + 170 0.8775329145 0.3532199938 0.0000000000 + 171 0.0892362707 0.9418515034 0.0000000000 + 172 0.9393782217 0.1785714286 0.0000000000 + 173 0.6934502934 0.6669245192 0.0000000000 + 174 0.2065066306 0.9434853229 0.0000000000 + 175 0.2583547433 0.9356372868 0.0000000000 + 176 0.9389178239 0.2486600552 0.0000000000 + 177 0.8156812462 0.5277858896 0.0000000000 + 178 0.8770401967 0.4232175552 0.0000000000 + 179 0.5103510877 0.8406332634 0.0000000000 + 180 0.4494831082 0.8752033241 0.0000000000 + 181 0.7543181403 0.6323542259 0.0000000000 + 182 0.5712190709 0.8060632062 0.0000000000 + 183 0.9384067878 0.3186595991 0.0000000000 + 184 0.6320871142 0.7714932043 0.0000000000 + 185 0.3277471506 0.9443434467 0.0000000000 + 186 1.0000000000 0.0000000000 0.0000000000 + 187 0.0000000000 1.0000000000 0.0000000000 + 188 1.0000000000 0.0714285714 0.0000000000 + 189 0.0714285714 1.0000000000 0.0000000000 + 190 0.3898979103 0.9255526687 0.0000000000 + 191 0.8765454154 0.4932157626 0.0000000000 + 192 1.0000000000 0.1428571429 0.0000000000 + 193 0.1428571429 1.0000000000 0.0000000000 + 194 0.8151859727 0.5977839324 0.0000000000 + 195 0.6929549044 0.7369227396 0.0000000000 + 196 0.9379078372 0.3886469037 0.0000000000 + 197 1.0000000000 0.2142857143 0.0000000000 + 198 0.2142857143 1.0000000000 0.0000000000 + 199 0.7538229694 0.7023524736 0.0000000000 + 200 1.0000000000 0.2857142857 0.0000000000 + 201 0.2857142857 1.0000000000 0.0000000000 + 202 0.8760533420 0.5632132129 0.0000000000 + 203 0.9374130699 0.4586451524 0.0000000000 + 204 0.5098556487 0.9106315102 0.0000000000 + 205 0.5707239399 0.8760615506 0.0000000000 + 206 0.4489876705 0.9452015708 0.0000000000 + 207 0.6315920134 0.8414914622 0.0000000000 + 208 0.8146908143 0.6677821779 0.0000000000 + 209 1.0000000000 0.3571428571 0.0000000000 + 210 0.3571428571 1.0000000000 0.0000000000 + 211 0.6924598483 0.8069211296 0.0000000000 + 212 0.9369182740 0.5286434009 0.0000000000 + 213 0.7533280008 0.7723510893 0.0000000000 + 214 0.8755588664 0.6332114152 0.0000000000 + 215 1.0000000000 0.4285714286 0.0000000000 + 216 0.4285714286 1.0000000000 0.0000000000 + 217 0.8141956465 0.7377804263 0.0000000000 + 218 0.5702281628 0.9460598503 0.0000000000 + 219 0.6310965106 0.9114897323 0.0000000000 + 220 0.9364253293 0.5986409720 0.0000000000 + 221 0.6919647133 0.8769193807 0.0000000000 + 222 1.0000000000 0.5000000000 0.0000000000 + 223 0.5000000000 1.0000000000 0.0000000000 + 224 0.8750638238 0.7032097672 0.0000000000 + 225 0.7528332282 0.8423493425 0.0000000000 + 226 0.8137008832 0.8077787070 0.0000000000 + 227 0.9359314630 0.6686389474 0.0000000000 + 228 1.0000000000 0.5714285714 0.0000000000 + 229 0.5714285714 1.0000000000 0.0000000000 + 230 0.8745686042 0.7732081323 0.0000000000 + 231 0.6914692701 0.9469177118 0.0000000000 + 232 1.0000000000 0.6428571429 0.0000000000 + 233 0.6428571429 1.0000000000 0.0000000000 + 234 0.9354363083 0.7386375863 0.0000000000 + 235 0.7517405304 0.9273912656 0.0000000000 + 236 0.8132061034 0.8777769589 0.0000000000 + 237 0.8740737271 0.8432063903 0.0000000000 + 238 1.0000000000 0.7142857143 0.0000000000 + 239 0.7142857143 1.0000000000 0.0000000000 + 240 0.9349414289 0.8086358374 0.0000000000 + 241 0.8162765415 0.9436745703 0.0000000000 + 242 0.8735789308 0.9132046269 0.0000000000 + 243 1.0000000000 0.7857142857 0.0000000000 + 244 0.7857142857 1.0000000000 0.0000000000 + 245 0.9344465927 0.8786340148 0.0000000000 + 246 1.0000000000 0.8571428571 0.0000000000 + 247 0.8571428571 1.0000000000 0.0000000000 + 248 0.9339517917 0.9486322651 0.0000000000 + 249 1.0000000000 0.9285714286 0.0000000000 + 250 0.9285714286 1.0000000000 0.0000000000 + 251 1.0000000000 1.0000000000 0.0000000000 +End Nodes + + +Begin Elements UPwSmallStrainElement2D3N + 1 1 1 3 2 + 2 1 192 197 172 + 3 1 172 197 176 + 4 1 192 172 169 + 5 1 176 197 200 + 6 1 172 176 154 + 7 1 169 172 150 + 8 1 154 176 159 + 9 1 159 176 183 + 10 1 154 159 136 + 11 1 183 176 200 + 12 1 183 200 209 + 13 1 159 183 170 + 14 1 136 159 145 + 15 1 154 136 133 + 16 1 159 170 145 + 17 1 145 170 155 + 18 1 136 145 125 + 19 1 133 136 118 + 20 1 155 170 178 + 21 1 125 145 132 + 22 1 118 136 125 + 23 1 155 178 166 + 24 1 132 145 155 + 25 1 132 155 141 + 26 1 166 178 191 + 27 1 155 166 141 + 28 1 191 178 203 + 29 1 141 166 152 + 30 1 203 178 196 + 31 1 191 203 212 + 32 1 152 166 177 + 33 1 196 178 170 + 34 1 203 196 215 + 35 1 203 215 222 + 36 1 212 203 222 + 37 1 212 222 228 + 38 1 177 166 191 + 39 1 196 170 183 + 40 1 196 183 209 + 41 1 196 209 215 + 42 1 177 191 202 + 43 1 202 191 212 + 44 1 177 202 194 + 45 1 202 212 220 + 46 1 194 202 214 + 47 1 177 194 167 + 48 1 220 212 228 + 49 1 220 228 232 + 50 1 214 202 220 + 51 1 167 194 181 + 52 1 177 167 152 + 53 1 214 220 227 + 54 1 181 194 208 + 55 1 152 167 144 + 56 1 227 220 232 + 57 1 227 232 238 + 58 1 208 194 214 + 59 1 181 208 199 + 60 1 144 167 156 + 61 1 208 214 224 + 62 1 199 208 217 + 63 1 181 199 173 + 64 1 156 167 181 + 65 1 217 208 224 + 66 1 181 173 156 + 67 1 217 224 230 + 68 1 156 173 151 + 69 1 217 230 226 + 70 1 151 173 168 + 71 1 226 230 237 + 72 1 217 226 213 + 73 1 168 173 195 + 74 1 237 230 240 + 75 1 213 226 225 + 76 1 195 173 199 + 77 1 240 230 234 + 78 1 225 226 236 + 79 1 195 199 213 + 80 1 234 230 224 + 81 1 236 226 237 + 82 1 213 199 217 + 83 1 195 213 211 + 84 1 236 237 242 + 85 1 211 213 225 + 86 1 195 211 184 + 87 1 242 237 245 + 88 1 184 211 207 + 89 1 195 184 168 + 90 1 245 237 240 + 91 1 207 211 221 + 92 1 168 184 164 + 93 1 245 240 246 + 94 1 245 246 249 + 95 1 221 211 225 + 96 1 164 184 182 + 97 1 221 225 235 + 98 1 182 184 207 + 99 1 164 182 160 + 100 1 235 225 236 + 101 1 182 207 205 + 102 1 160 182 179 + 103 1 235 236 241 + 104 1 205 207 219 + 105 1 179 182 205 + 106 1 160 179 158 + 107 1 241 236 242 + 108 1 219 207 221 + 109 1 158 179 180 + 110 1 160 158 139 + 111 1 219 221 231 + 112 1 180 179 204 + 113 1 139 158 140 + 114 1 160 139 142 + 115 1 231 221 235 + 116 1 204 179 205 + 117 1 140 158 161 + 118 1 142 139 122 + 119 1 231 235 239 + 120 1 204 205 218 + 121 1 161 158 180 + 122 1 122 139 120 + 123 1 218 205 219 + 124 1 204 218 223 + 125 1 161 180 190 + 126 1 120 139 140 + 127 1 218 219 233 + 128 1 190 180 206 + 129 1 161 190 165 + 130 1 120 140 123 + 131 1 206 180 204 + 132 1 190 216 210 + 133 1 165 190 185 + 134 1 123 140 143 + 135 1 206 204 223 + 136 1 185 190 210 + 137 1 185 210 201 + 138 1 185 201 175 + 139 1 175 201 198 + 140 1 185 175 165 + 141 1 143 140 161 + 142 1 143 161 165 + 143 1 143 165 148 + 144 1 148 165 175 + 145 1 143 148 127 + 146 1 127 148 130 + 147 1 143 127 123 + 148 1 130 148 153 + 149 1 123 127 107 + 150 1 153 148 175 + 151 1 130 153 135 + 152 1 107 127 111 + 153 1 123 107 105 + 154 1 135 153 157 + 155 1 130 135 115 + 156 1 111 127 130 + 157 1 157 153 174 + 158 1 130 115 111 + 159 1 174 153 175 + 160 1 174 175 198 + 161 1 174 198 193 + 162 1 157 174 193 + 163 1 111 115 96 + 164 1 96 115 102 + 165 1 111 96 93 + 166 1 102 115 124 + 167 1 93 96 81 + 168 1 111 93 107 + 169 1 124 115 135 + 170 1 81 96 85 + 171 1 107 93 89 + 172 1 85 96 102 + 173 1 89 93 76 + 174 1 107 89 105 + 175 1 76 93 81 + 176 1 89 76 72 + 177 1 105 89 87 + 178 1 72 76 61 + 179 1 89 72 87 + 180 1 61 76 65 + 181 1 87 72 71 + 182 1 65 76 81 + 183 1 61 65 51 + 184 1 71 72 59 + 185 1 51 65 55 + 186 1 61 51 47 + 187 1 59 72 61 + 188 1 55 65 69 + 189 1 47 51 39 + 190 1 59 61 47 + 191 1 69 65 81 + 192 1 39 51 42 + 193 1 69 81 85 + 194 1 42 51 55 + 195 1 39 42 31 + 196 1 69 85 80 + 197 1 42 55 49 + 198 1 31 42 36 + 199 1 124 135 146 + 200 1 146 135 157 + 201 1 124 146 138 + 202 1 146 157 171 + 203 1 171 157 193 + 204 1 146 171 162 + 205 1 47 39 37 + 206 1 37 39 29 + 207 1 47 37 46 + 208 1 29 39 31 + 209 1 37 29 28 + 210 1 46 37 38 + 211 1 29 31 22 + 212 1 37 28 38 + 213 1 22 31 26 + 214 1 38 28 30 + 215 1 30 28 21 + 216 1 38 30 41 + 217 1 21 28 20 + 218 1 30 21 23 + 219 1 41 30 33 + 220 1 20 28 29 + 221 1 23 21 15 + 222 1 33 30 23 + 223 1 20 29 22 + 224 1 15 21 13 + 225 1 20 22 14 + 226 1 13 21 20 + 227 1 15 13 9 + 228 1 14 22 18 + 229 1 13 20 14 + 230 1 9 13 8 + 231 1 13 14 8 + 232 1 9 8 4 + 233 1 8 14 11 + 234 1 4 8 6 + 235 1 9 4 7 + 236 1 7 4 3 + 237 1 9 7 12 + 238 1 12 7 10 + 239 1 9 12 15 + 240 1 15 12 19 + 241 1 19 12 16 + 242 1 15 19 23 + 243 1 16 12 10 + 244 1 19 16 24 + 245 1 23 19 27 + 246 1 24 16 25 + 247 1 27 19 24 + 248 1 23 27 33 + 249 1 27 24 34 + 250 1 33 27 40 + 251 1 34 24 32 + 252 1 40 27 34 + 253 1 33 40 44 + 254 1 32 24 25 + 255 1 40 34 45 + 256 1 44 40 52 + 257 1 45 34 43 + 258 1 40 45 52 + 259 1 43 34 32 + 260 1 52 45 58 + 261 1 43 32 35 + 262 1 58 45 56 + 263 1 52 58 67 + 264 1 56 45 43 + 265 1 58 56 70 + 266 1 67 58 74 + 267 1 56 43 53 + 268 1 70 56 66 + 269 1 74 58 70 + 270 1 53 43 35 + 271 1 66 56 53 + 272 1 66 53 62 + 273 1 47 46 59 + 274 1 59 46 60 + 275 1 60 46 50 + 276 1 59 60 71 + 277 1 50 46 38 + 278 1 60 50 64 + 279 1 71 60 75 + 280 1 50 38 41 + 281 1 64 50 54 + 282 1 75 60 64 + 283 1 54 50 41 + 284 1 64 54 68 + 285 1 54 41 44 + 286 1 68 54 57 + 287 1 44 41 33 + 288 1 54 44 57 + 289 1 57 44 52 + 290 1 57 52 67 + 291 1 57 67 73 + 292 1 73 67 83 + 293 1 57 73 68 + 294 1 83 67 74 + 295 1 68 73 84 + 296 1 83 74 92 + 297 1 84 73 90 + 298 1 68 84 78 + 299 1 92 74 86 + 300 1 90 73 83 + 301 1 78 84 95 + 302 1 86 74 70 + 303 1 90 83 100 + 304 1 95 84 101 + 305 1 86 70 82 + 306 1 100 83 92 + 307 1 101 84 90 + 308 1 82 70 66 + 309 1 101 90 110 + 310 1 82 66 77 + 311 1 110 90 100 + 312 1 101 110 121 + 313 1 77 66 62 + 314 1 110 100 119 + 315 1 121 110 131 + 316 1 119 100 112 + 317 1 110 119 131 + 318 1 112 100 92 + 319 1 131 119 141 + 320 1 112 92 103 + 321 1 141 119 132 + 322 1 131 141 152 + 323 1 103 92 86 + 324 1 132 119 112 + 325 1 103 86 99 + 326 1 132 112 125 + 327 1 99 86 82 + 328 1 125 112 103 + 329 1 99 82 94 + 330 1 94 82 77 + 331 1 99 94 113 + 332 1 113 94 109 + 333 1 99 113 118 + 334 1 109 94 97 + 335 1 99 118 103 + 336 1 103 118 125 + 337 1 71 75 88 + 338 1 88 75 91 + 339 1 71 88 87 + 340 1 91 75 78 + 341 1 88 91 106 + 342 1 87 88 104 + 343 1 78 75 64 + 344 1 106 91 108 + 345 1 104 88 106 + 346 1 108 91 95 + 347 1 106 108 126 + 348 1 95 91 78 + 349 1 108 95 114 + 350 1 126 108 129 + 351 1 114 95 101 + 352 1 108 114 129 + 353 1 114 101 121 + 354 1 129 114 134 + 355 1 114 121 134 + 356 1 129 134 151 + 357 1 134 121 144 + 358 1 151 134 156 + 359 1 129 151 147 + 360 1 144 121 131 + 361 1 156 134 144 + 362 1 147 151 168 + 363 1 147 168 164 + 364 1 147 164 142 + 365 1 142 164 160 + 366 1 147 142 126 + 367 1 126 142 122 + 368 1 147 126 129 + 369 1 87 104 105 + 370 1 105 104 120 + 371 1 120 104 122 + 372 1 105 120 123 + 373 1 122 104 106 + 374 1 122 106 126 + 375 1 144 131 152 + 376 1 224 214 227 + 377 1 224 227 234 + 378 1 234 227 238 + 379 1 234 238 243 + 380 1 240 234 243 + 381 1 240 243 246 + 382 1 242 245 248 + 383 1 248 245 249 + 384 1 248 249 251 + 385 1 242 248 247 + 386 1 102 124 117 + 387 1 113 109 128 + 388 1 128 109 116 + 389 1 113 128 133 + 390 1 133 128 150 + 391 1 133 150 154 + 392 1 154 150 172 + 393 1 150 128 149 + 394 1 149 128 137 + 395 1 150 149 169 + 396 1 169 149 163 + 397 1 113 133 118 + 398 1 235 241 244 + 399 1 244 241 247 + 400 1 247 241 242 + 401 1 68 78 64 + 402 1 94 77 97 + 403 1 55 69 63 + 404 1 219 231 233 + 405 1 85 102 98 + 406 1 192 169 188 + 407 1 239 233 231 + 408 1 239 235 244 + 409 1 63 49 55 + 410 1 62 79 77 + 411 1 193 189 171 + 412 1 171 189 162 + 413 1 17 25 16 + 414 1 17 16 10 + 415 1 216 190 206 + 416 1 216 206 223 + 417 1 18 11 14 + 418 1 137 163 149 + 419 1 251 250 248 + 420 1 248 250 247 + 421 1 138 117 124 + 422 1 5 10 7 + 423 1 5 7 3 + 424 1 229 223 218 + 425 1 229 218 233 + 426 1 36 26 31 + 427 1 97 116 109 + 428 1 187 162 189 + 429 1 35 48 53 + 430 1 6 2 4 + 431 1 186 188 163 + 432 1 98 80 85 + 433 1 49 36 42 + 434 1 79 97 77 + 435 1 25 35 32 + 436 1 11 6 8 + 437 1 117 98 102 + 438 1 26 18 22 + 439 1 116 137 128 + 440 1 162 138 146 + 441 1 48 62 53 + 442 1 80 63 69 + 443 1 188 169 163 + 444 1 4 2 3 +End Elements + + + +Begin SubModelPart Soil_drained-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 6 + 11 + 18 + 26 + 36 + 49 + 63 + 80 + 98 + 117 + 138 + 162 + 186 + 187 + 188 + 192 + 197 + 200 + 209 + 215 + 222 + 228 + 232 + 238 + 243 + 246 + 249 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-2 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 3 + 5 + 10 + 17 + 25 + 35 + 48 + 62 + 79 + 97 + 116 + 137 + 163 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-3 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Fluid_Pressure-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/MaterialParameters.json new file mode 100644 index 000000000000..7794c8263b80 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/MaterialParameters.json @@ -0,0 +1,27 @@ +{ + "properties": [{ + "model_part_name": "PorousDomain.Soil_drained-auto-1", + "properties_id": 1, + "Material": { + "constitutive_law": { + "name" : "GeoLinearElasticPlaneStrain2DLaw" + }, + "Variables": { + "IGNORE_UNDRAINED" : true, + "YOUNG_MODULUS" : 3.0e7, + "POISSON_RATIO" : 0.2, + "DENSITY_SOLID" : 2.0e3, + "DENSITY_WATER" : 1.0e3, + "POROSITY" : 0.3, + "BULK_MODULUS_SOLID" : 1.0e12, + "BULK_MODULUS_FLUID" : 2.0e-30, + "PERMEABILITY_XX" : 4.5e-30, + "PERMEABILITY_YY" : 4.5e-30, + "PERMEABILITY_XY" : 0.0, + "DYNAMIC_VISCOSITY" : 1.0e-3, + "THICKNESS" : 1.0 + }, + "Tables": {} + } + }] +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json new file mode 100644 index 000000000000..0a992e40043d --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json @@ -0,0 +1,166 @@ +{ + "problem_data": { + "problem_name": "test_inclined_phreatic_multi_line", + "start_time": 0.0, + "end_time": 1.0, + "echo_level": 1, + "parallel_type": "OpenMP", + "number_of_threads": 1 + }, + "solver_settings": { + "solver_type": "U_Pw", + "model_part_name": "PorousDomain", + "domain_size": 2, + "start_time": 0.0, + "model_import_settings": { + "input_type": "mdpa", + "input_filename": "test_inclined_phreatic_multi_line" + }, + "material_import_settings": { + "materials_filename": "MaterialParameters.json" + }, + "time_stepping": { + "time_step": 0.25 + }, + "buffer_size": 2, + "echo_level": 1, + "clear_storage": false, + "compute_reactions": false, + "move_mesh_flag": true, + "reform_dofs_at_each_step": false, + "nodal_smoothing": false, + "block_builder": true, + "solution_type": "Quasi-Static", + "scheme_type": "Newmark", + "newmark_beta": 0.25, + "newmark_gamma": 0.5, + "newmark_theta": 0.5, + "rayleigh_m": 0.0, + "rayleigh_k": 0.0, + "strategy_type": "newton_raphson", + "convergence_criterion": "displacement_criterion", + "displacement_relative_tolerance": 1.0E-4, + "displacement_absolute_tolerance": 1.0E-9, + "residual_relative_tolerance": 1.0E-4, + "residual_absolute_tolerance": 1.0E-9, + "min_iterations": 6, + "max_iterations": 15, + "number_cycles": 100, + "reduction_factor": 0.5, + "increase_factor": 2.0, + "realised_factor": 0.9999, + "desired_iterations": 4, + "max_radius_factor": 10.0, + "min_radius_factor": 0.1, + "calculate_reactions": true, + "max_line_search_iterations": 5, + "first_alpha_value": 0.5, + "second_alpha_value": 1.0, + "min_alpha": 0.1, + "max_alpha": 2.0, + "line_search_tolerance": 0.5, + "rotation_dofs": true, + "linear_solver_settings": { + "solver_type": "amgcl", + "smoother_type": "ilu0", + "krylov_type": "gmres", + "coarsening_type": "aggregation", + "max_iteration": 100, + "verbosity": 0, + "tolerance": 1.0e-6, + "scaling": false + }, + "problem_domain_sub_model_part_list": ["Soil_drained-auto-1"], + "processes_sub_model_part_list": ["Solid_Displacement-auto-1","Solid_Displacement-auto-2","Solid_Displacement-auto-3","Fluid_Pressure-auto-1"], + "body_domain_sub_model_part_list": ["Soil_drained-auto-1"] + }, + "output_processes": { + "gid_output": [{ + "python_module": "gid_output_process", + "kratos_module": "KratosMultiphysics", + "process_name": "GiDOutputProcess", + "Parameters": { + "model_part_name": "PorousDomain.porous_computational_model_part", + "output_name": "test_inclinded_phreatic_line", + "postprocess_parameters": { + "result_file_configuration": { + "gidpost_flags": { + "WriteDeformedMeshFlag": "WriteUndeformed", + "WriteConditionsFlag": "WriteElementsOnly", + "GiDPostMode": "GiD_PostBinary", + "MultiFileFlag": "SingleFile" + }, + "file_label": "step", + "output_control_type": "step", + "output_interval": 1, + "body_output": true, + "node_output": false, + "skin_output": false, + "plane_output": [], + "nodal_results": ["DISPLACEMENT","WATER_PRESSURE"], + "gauss_point_results": ["GREEN_LAGRANGE_STRAIN_TENSOR","CAUCHY_STRESS_TENSOR","TOTAL_STRESS_TENSOR","VON_MISES_STRESS","FLUID_FLUX_VECTOR"] + }, + "point_data_configuration": [] + } + } + }] + }, + "processes": { + "constraints_process_list": [{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-1", + "variable_name": "DISPLACEMENT", + "active": [true,false,false], + "is_fixed": [true,false,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-2", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-3", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_scalar_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyScalarConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Fluid_Pressure-auto-1", + "variable_name": "WATER_PRESSURE", + "is_fixed": true, + "value": 0.0, + "table": [0, 0], + "fluid_pressure_type": "Phreatic_Multi_Line", + "gravity_direction": 1, + "out_of_plane_direction": 2, + "x_coordinates" : [0.0,0.5,1.0], + "y_coordinates": [1.0,0.9,0.5], + "z_coordinates": [0.0,0.0,0.0], + "specific_weight": 10000.0 + } + }], + "loads_process_list": [] + } +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/test_inclined_phreatic_multi_line.mdpa b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/test_inclined_phreatic_multi_line.mdpa new file mode 100644 index 000000000000..6e57631c3459 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/test_inclined_phreatic_multi_line.mdpa @@ -0,0 +1,1757 @@ + +Begin Properties 1 +End Properties + + +Begin Nodes + 1 0.0000000000 0.0000000000 0.0000000000 + 2 0.0000000000 0.0714285714 0.0000000000 + 3 0.0714285714 0.0000000000 0.0000000000 + 4 0.0776346270 0.0988478008 0.0000000000 + 5 0.1428571429 0.0000000000 0.0000000000 + 6 0.0000000000 0.1428571429 0.0000000000 + 7 0.1520793486 0.0680781786 0.0000000000 + 8 0.0907159317 0.1726464868 0.0000000000 + 9 0.1515839106 0.1380764253 0.0000000000 + 10 0.2142857143 0.0000000000 0.0000000000 + 11 0.0000000000 0.2142857143 0.0000000000 + 12 0.2124518894 0.1035063639 0.0000000000 + 13 0.1510884725 0.2080746720 0.0000000000 + 14 0.0902204937 0.2426447335 0.0000000000 + 15 0.2119564514 0.1735046106 0.0000000000 + 16 0.2733198683 0.0689363025 0.0000000000 + 17 0.2857142857 0.0000000000 0.0000000000 + 18 0.0000000000 0.2857142857 0.0000000000 + 19 0.2728244303 0.1389345492 0.0000000000 + 20 0.1505930345 0.2780729187 0.0000000000 + 21 0.2114610134 0.2435028573 0.0000000000 + 22 0.0897250556 0.3126429802 0.0000000000 + 23 0.2723289923 0.2089327959 0.0000000000 + 24 0.3375182442 0.0986367809 0.0000000000 + 25 0.3571428571 0.0000000000 0.0000000000 + 26 0.0000000000 0.3571428571 0.0000000000 + 27 0.3331969711 0.1743627344 0.0000000000 + 28 0.2109655754 0.3135011040 0.0000000000 + 29 0.1500975965 0.3480711654 0.0000000000 + 30 0.2718335542 0.2789310426 0.0000000000 + 31 0.0892296176 0.3826412269 0.0000000000 + 32 0.3945603880 0.0697944263 0.0000000000 + 33 0.3327015331 0.2443609811 0.0000000000 + 34 0.3940649500 0.1397926730 0.0000000000 + 35 0.4285714286 0.0000000000 0.0000000000 + 36 0.0000000000 0.4285714286 0.0000000000 + 37 0.2104701374 0.3834993507 0.0000000000 + 38 0.2713381162 0.3489292893 0.0000000000 + 39 0.1496021585 0.4180694121 0.0000000000 + 40 0.3935695120 0.2097909197 0.0000000000 + 41 0.3322060951 0.3143592278 0.0000000000 + 42 0.0887341796 0.4526394736 0.0000000000 + 43 0.4504567725 0.0993518841 0.0000000000 + 44 0.3930740740 0.2797891664 0.0000000000 + 45 0.4544374909 0.1752208582 0.0000000000 + 46 0.2708426782 0.4189275360 0.0000000000 + 47 0.2099746993 0.4534975974 0.0000000000 + 48 0.5000000000 0.0000000000 0.0000000000 + 49 0.0000000000 0.5000000000 0.0000000000 + 50 0.3317106570 0.3843574743 0.0000000000 + 51 0.1491067205 0.4880676588 0.0000000000 + 52 0.4539420528 0.2452191049 0.0000000000 + 53 0.5158009078 0.0706525501 0.0000000000 + 54 0.3925786357 0.3497874127 0.0000000000 + 55 0.0882387416 0.5226377203 0.0000000000 + 56 0.5153054697 0.1406507968 0.0000000000 + 57 0.4534466145 0.3152173510 0.0000000000 + 58 0.5148100317 0.2106490435 0.0000000000 + 59 0.2703472404 0.4889257827 0.0000000000 + 60 0.3312152192 0.4543557210 0.0000000000 + 61 0.2094792613 0.5234958441 0.0000000000 + 62 0.5714285714 0.0000000000 0.0000000000 + 63 0.0000000000 0.5714285714 0.0000000000 + 64 0.3920831979 0.4197856594 0.0000000000 + 65 0.1486112825 0.5580659055 0.0000000000 + 66 0.5753000629 0.1000669874 0.0000000000 + 67 0.5143145937 0.2806472902 0.0000000000 + 68 0.4529511767 0.3852155978 0.0000000000 + 69 0.0877433036 0.5926359670 0.0000000000 + 70 0.5756780106 0.1760789821 0.0000000000 + 71 0.3307197811 0.5243539682 0.0000000000 + 72 0.2698518022 0.5589240294 0.0000000000 + 73 0.5138191550 0.3506455369 0.0000000000 + 74 0.5751825726 0.2460772288 0.0000000000 + 75 0.3915877600 0.4897839066 0.0000000000 + 76 0.2089838233 0.5934940908 0.0000000000 + 77 0.6370414278 0.0715106742 0.0000000000 + 78 0.4524557380 0.4552138444 0.0000000000 + 79 0.6428571429 0.0000000000 0.0000000000 + 80 0.0000000000 0.6428571429 0.0000000000 + 81 0.1481158457 0.6280641506 0.0000000000 + 82 0.6365459899 0.1415089210 0.0000000000 + 83 0.5746871342 0.3160754760 0.0000000000 + 84 0.5133237171 0.4206437834 0.0000000000 + 85 0.0872478660 0.6626342106 0.0000000000 + 86 0.6360505518 0.2115071679 0.0000000000 + 87 0.3302243426 0.5943522149 0.0000000000 + 88 0.3910923221 0.5597821533 0.0000000000 + 89 0.2693563640 0.6289222760 0.0000000000 + 90 0.5741916959 0.3860737220 0.0000000000 + 91 0.4519603009 0.5252120918 0.0000000000 + 92 0.6355551133 0.2815054146 0.0000000000 + 93 0.2084883857 0.6634923374 0.0000000000 + 94 0.7001433534 0.1007820910 0.0000000000 + 95 0.5128282786 0.4906420301 0.0000000000 + 96 0.1476204060 0.6980623973 0.0000000000 + 97 0.7142857143 0.0000000000 0.0000000000 + 98 0.0000000000 0.7142857143 0.0000000000 + 99 0.6969185306 0.1769371066 0.0000000000 + 100 0.6350596749 0.3515036612 0.0000000000 + 101 0.5736962577 0.4560719691 0.0000000000 + 102 0.0867524267 0.7326324579 0.0000000000 + 103 0.6964230920 0.2469353532 0.0000000000 + 104 0.3905968836 0.6297804001 0.0000000000 + 105 0.3297289033 0.6643504612 0.0000000000 + 106 0.4514648630 0.5952103385 0.0000000000 + 107 0.2688609243 0.6989205222 0.0000000000 + 108 0.5123328418 0.5606402769 0.0000000000 + 109 0.7582819479 0.0723687987 0.0000000000 + 110 0.6345642367 0.4215019076 0.0000000000 + 111 0.2079929457 0.7334905840 0.0000000000 + 112 0.6959276538 0.3169335998 0.0000000000 + 113 0.7577865096 0.1423670454 0.0000000000 + 114 0.5732008201 0.5260702143 0.0000000000 + 115 0.1471249672 0.7680606437 0.0000000000 + 116 0.7857142857 0.0000000000 0.0000000000 + 117 0.0000000000 0.7857142857 0.0000000000 + 118 0.7572860102 0.2123746795 0.0000000000 + 119 0.6954322157 0.3869318465 0.0000000000 + 120 0.3901014431 0.6997786459 0.0000000000 + 121 0.6340687986 0.4915001543 0.0000000000 + 122 0.4509694216 0.6652085838 0.0000000000 + 123 0.3292334646 0.7343487078 0.0000000000 + 124 0.0862569880 0.8026307045 0.0000000000 + 125 0.7567969679 0.2823701526 0.0000000000 + 126 0.5118374039 0.6306385236 0.0000000000 + 127 0.2683654869 0.7689187686 0.0000000000 + 128 0.8193591446 0.0872021784 0.0000000000 + 129 0.5727053828 0.5960684621 0.0000000000 + 130 0.2074975077 0.8034888295 0.0000000000 + 131 0.6949367775 0.4569300929 0.0000000000 + 132 0.7563059607 0.3523684526 0.0000000000 + 133 0.8181499369 0.1777973059 0.0000000000 + 134 0.6335733613 0.5614983995 0.0000000000 + 135 0.1466295286 0.8380588904 0.0000000000 + 136 0.8176627030 0.2477959626 0.0000000000 + 137 0.8571428571 0.0000000000 0.0000000000 + 138 0.0000000000 0.8571428571 0.0000000000 + 139 0.4504739844 0.7352068305 0.0000000000 + 140 0.3896060057 0.7697768924 0.0000000000 + 141 0.7558057104 0.4223635832 0.0000000000 + 142 0.5113419629 0.7006367683 0.0000000000 + 143 0.3287380273 0.8043469545 0.0000000000 + 144 0.6944402915 0.5269298688 0.0000000000 + 145 0.8171718080 0.3177945936 0.0000000000 + 146 0.0857615493 0.8726289513 0.0000000000 + 147 0.5722103607 0.6660667414 0.0000000000 + 148 0.2678700483 0.8389170152 0.0000000000 + 149 0.8799109224 0.0739567803 0.0000000000 + 150 0.8785275524 0.1439253187 0.0000000000 + 151 0.6330782106 0.6314963928 0.0000000000 + 152 0.7553077665 0.4923601335 0.0000000000 + 153 0.2054987581 0.8779407470 0.0000000000 + 154 0.8785275524 0.2132175384 0.0000000000 + 155 0.8166681241 0.3877899638 0.0000000000 + 156 0.6939466362 0.5969279783 0.0000000000 + 157 0.1461340900 0.9080571371 0.0000000000 + 158 0.4499785468 0.8052050773 0.0000000000 + 159 0.8780384510 0.2832214669 0.0000000000 + 160 0.5108465257 0.7706350151 0.0000000000 + 161 0.3891105682 0.8397751391 0.0000000000 + 162 0.0000000000 0.9285714286 0.0000000000 + 163 0.9285714286 0.0000000000 0.0000000000 + 164 0.5717145005 0.7360649328 0.0000000000 + 165 0.3282425891 0.8743452000 0.0000000000 + 166 0.8161726575 0.4577880342 0.0000000000 + 167 0.7548133486 0.5623559903 0.0000000000 + 168 0.6325824083 0.7014945307 0.0000000000 + 169 0.9389178239 0.1084828019 0.0000000000 + 170 0.8775329145 0.3532199938 0.0000000000 + 171 0.0892362707 0.9418515034 0.0000000000 + 172 0.9393782217 0.1785714286 0.0000000000 + 173 0.6934502934 0.6669245192 0.0000000000 + 174 0.2065066306 0.9434853229 0.0000000000 + 175 0.2583547433 0.9356372868 0.0000000000 + 176 0.9389178239 0.2486600552 0.0000000000 + 177 0.8156812462 0.5277858896 0.0000000000 + 178 0.8770401967 0.4232175552 0.0000000000 + 179 0.5103510877 0.8406332634 0.0000000000 + 180 0.4494831082 0.8752033241 0.0000000000 + 181 0.7543181403 0.6323542259 0.0000000000 + 182 0.5712190709 0.8060632062 0.0000000000 + 183 0.9384067878 0.3186595991 0.0000000000 + 184 0.6320871142 0.7714932043 0.0000000000 + 185 0.3277471506 0.9443434467 0.0000000000 + 186 1.0000000000 0.0000000000 0.0000000000 + 187 0.0000000000 1.0000000000 0.0000000000 + 188 1.0000000000 0.0714285714 0.0000000000 + 189 0.0714285714 1.0000000000 0.0000000000 + 190 0.3898979103 0.9255526687 0.0000000000 + 191 0.8765454154 0.4932157626 0.0000000000 + 192 1.0000000000 0.1428571429 0.0000000000 + 193 0.1428571429 1.0000000000 0.0000000000 + 194 0.8151859727 0.5977839324 0.0000000000 + 195 0.6929549044 0.7369227396 0.0000000000 + 196 0.9379078372 0.3886469037 0.0000000000 + 197 1.0000000000 0.2142857143 0.0000000000 + 198 0.2142857143 1.0000000000 0.0000000000 + 199 0.7538229694 0.7023524736 0.0000000000 + 200 1.0000000000 0.2857142857 0.0000000000 + 201 0.2857142857 1.0000000000 0.0000000000 + 202 0.8760533420 0.5632132129 0.0000000000 + 203 0.9374130699 0.4586451524 0.0000000000 + 204 0.5098556487 0.9106315102 0.0000000000 + 205 0.5707239399 0.8760615506 0.0000000000 + 206 0.4489876705 0.9452015708 0.0000000000 + 207 0.6315920134 0.8414914622 0.0000000000 + 208 0.8146908143 0.6677821779 0.0000000000 + 209 1.0000000000 0.3571428571 0.0000000000 + 210 0.3571428571 1.0000000000 0.0000000000 + 211 0.6924598483 0.8069211296 0.0000000000 + 212 0.9369182740 0.5286434009 0.0000000000 + 213 0.7533280008 0.7723510893 0.0000000000 + 214 0.8755588664 0.6332114152 0.0000000000 + 215 1.0000000000 0.4285714286 0.0000000000 + 216 0.4285714286 1.0000000000 0.0000000000 + 217 0.8141956465 0.7377804263 0.0000000000 + 218 0.5702281628 0.9460598503 0.0000000000 + 219 0.6310965106 0.9114897323 0.0000000000 + 220 0.9364253293 0.5986409720 0.0000000000 + 221 0.6919647133 0.8769193807 0.0000000000 + 222 1.0000000000 0.5000000000 0.0000000000 + 223 0.5000000000 1.0000000000 0.0000000000 + 224 0.8750638238 0.7032097672 0.0000000000 + 225 0.7528332282 0.8423493425 0.0000000000 + 226 0.8137008832 0.8077787070 0.0000000000 + 227 0.9359314630 0.6686389474 0.0000000000 + 228 1.0000000000 0.5714285714 0.0000000000 + 229 0.5714285714 1.0000000000 0.0000000000 + 230 0.8745686042 0.7732081323 0.0000000000 + 231 0.6914692701 0.9469177118 0.0000000000 + 232 1.0000000000 0.6428571429 0.0000000000 + 233 0.6428571429 1.0000000000 0.0000000000 + 234 0.9354363083 0.7386375863 0.0000000000 + 235 0.7517405304 0.9273912656 0.0000000000 + 236 0.8132061034 0.8777769589 0.0000000000 + 237 0.8740737271 0.8432063903 0.0000000000 + 238 1.0000000000 0.7142857143 0.0000000000 + 239 0.7142857143 1.0000000000 0.0000000000 + 240 0.9349414289 0.8086358374 0.0000000000 + 241 0.8162765415 0.9436745703 0.0000000000 + 242 0.8735789308 0.9132046269 0.0000000000 + 243 1.0000000000 0.7857142857 0.0000000000 + 244 0.7857142857 1.0000000000 0.0000000000 + 245 0.9344465927 0.8786340148 0.0000000000 + 246 1.0000000000 0.8571428571 0.0000000000 + 247 0.8571428571 1.0000000000 0.0000000000 + 248 0.9339517917 0.9486322651 0.0000000000 + 249 1.0000000000 0.9285714286 0.0000000000 + 250 0.9285714286 1.0000000000 0.0000000000 + 251 1.0000000000 1.0000000000 0.0000000000 +End Nodes + + +Begin Elements UPwSmallStrainElement2D3N + 1 1 1 3 2 + 2 1 192 197 172 + 3 1 172 197 176 + 4 1 192 172 169 + 5 1 176 197 200 + 6 1 172 176 154 + 7 1 169 172 150 + 8 1 154 176 159 + 9 1 159 176 183 + 10 1 154 159 136 + 11 1 183 176 200 + 12 1 183 200 209 + 13 1 159 183 170 + 14 1 136 159 145 + 15 1 154 136 133 + 16 1 159 170 145 + 17 1 145 170 155 + 18 1 136 145 125 + 19 1 133 136 118 + 20 1 155 170 178 + 21 1 125 145 132 + 22 1 118 136 125 + 23 1 155 178 166 + 24 1 132 145 155 + 25 1 132 155 141 + 26 1 166 178 191 + 27 1 155 166 141 + 28 1 191 178 203 + 29 1 141 166 152 + 30 1 203 178 196 + 31 1 191 203 212 + 32 1 152 166 177 + 33 1 196 178 170 + 34 1 203 196 215 + 35 1 203 215 222 + 36 1 212 203 222 + 37 1 212 222 228 + 38 1 177 166 191 + 39 1 196 170 183 + 40 1 196 183 209 + 41 1 196 209 215 + 42 1 177 191 202 + 43 1 202 191 212 + 44 1 177 202 194 + 45 1 202 212 220 + 46 1 194 202 214 + 47 1 177 194 167 + 48 1 220 212 228 + 49 1 220 228 232 + 50 1 214 202 220 + 51 1 167 194 181 + 52 1 177 167 152 + 53 1 214 220 227 + 54 1 181 194 208 + 55 1 152 167 144 + 56 1 227 220 232 + 57 1 227 232 238 + 58 1 208 194 214 + 59 1 181 208 199 + 60 1 144 167 156 + 61 1 208 214 224 + 62 1 199 208 217 + 63 1 181 199 173 + 64 1 156 167 181 + 65 1 217 208 224 + 66 1 181 173 156 + 67 1 217 224 230 + 68 1 156 173 151 + 69 1 217 230 226 + 70 1 151 173 168 + 71 1 226 230 237 + 72 1 217 226 213 + 73 1 168 173 195 + 74 1 237 230 240 + 75 1 213 226 225 + 76 1 195 173 199 + 77 1 240 230 234 + 78 1 225 226 236 + 79 1 195 199 213 + 80 1 234 230 224 + 81 1 236 226 237 + 82 1 213 199 217 + 83 1 195 213 211 + 84 1 236 237 242 + 85 1 211 213 225 + 86 1 195 211 184 + 87 1 242 237 245 + 88 1 184 211 207 + 89 1 195 184 168 + 90 1 245 237 240 + 91 1 207 211 221 + 92 1 168 184 164 + 93 1 245 240 246 + 94 1 245 246 249 + 95 1 221 211 225 + 96 1 164 184 182 + 97 1 221 225 235 + 98 1 182 184 207 + 99 1 164 182 160 + 100 1 235 225 236 + 101 1 182 207 205 + 102 1 160 182 179 + 103 1 235 236 241 + 104 1 205 207 219 + 105 1 179 182 205 + 106 1 160 179 158 + 107 1 241 236 242 + 108 1 219 207 221 + 109 1 158 179 180 + 110 1 160 158 139 + 111 1 219 221 231 + 112 1 180 179 204 + 113 1 139 158 140 + 114 1 160 139 142 + 115 1 231 221 235 + 116 1 204 179 205 + 117 1 140 158 161 + 118 1 142 139 122 + 119 1 231 235 239 + 120 1 204 205 218 + 121 1 161 158 180 + 122 1 122 139 120 + 123 1 218 205 219 + 124 1 204 218 223 + 125 1 161 180 190 + 126 1 120 139 140 + 127 1 218 219 233 + 128 1 190 180 206 + 129 1 161 190 165 + 130 1 120 140 123 + 131 1 206 180 204 + 132 1 190 216 210 + 133 1 165 190 185 + 134 1 123 140 143 + 135 1 206 204 223 + 136 1 185 190 210 + 137 1 185 210 201 + 138 1 185 201 175 + 139 1 175 201 198 + 140 1 185 175 165 + 141 1 143 140 161 + 142 1 143 161 165 + 143 1 143 165 148 + 144 1 148 165 175 + 145 1 143 148 127 + 146 1 127 148 130 + 147 1 143 127 123 + 148 1 130 148 153 + 149 1 123 127 107 + 150 1 153 148 175 + 151 1 130 153 135 + 152 1 107 127 111 + 153 1 123 107 105 + 154 1 135 153 157 + 155 1 130 135 115 + 156 1 111 127 130 + 157 1 157 153 174 + 158 1 130 115 111 + 159 1 174 153 175 + 160 1 174 175 198 + 161 1 174 198 193 + 162 1 157 174 193 + 163 1 111 115 96 + 164 1 96 115 102 + 165 1 111 96 93 + 166 1 102 115 124 + 167 1 93 96 81 + 168 1 111 93 107 + 169 1 124 115 135 + 170 1 81 96 85 + 171 1 107 93 89 + 172 1 85 96 102 + 173 1 89 93 76 + 174 1 107 89 105 + 175 1 76 93 81 + 176 1 89 76 72 + 177 1 105 89 87 + 178 1 72 76 61 + 179 1 89 72 87 + 180 1 61 76 65 + 181 1 87 72 71 + 182 1 65 76 81 + 183 1 61 65 51 + 184 1 71 72 59 + 185 1 51 65 55 + 186 1 61 51 47 + 187 1 59 72 61 + 188 1 55 65 69 + 189 1 47 51 39 + 190 1 59 61 47 + 191 1 69 65 81 + 192 1 39 51 42 + 193 1 69 81 85 + 194 1 42 51 55 + 195 1 39 42 31 + 196 1 69 85 80 + 197 1 42 55 49 + 198 1 31 42 36 + 199 1 124 135 146 + 200 1 146 135 157 + 201 1 124 146 138 + 202 1 146 157 171 + 203 1 171 157 193 + 204 1 146 171 162 + 205 1 47 39 37 + 206 1 37 39 29 + 207 1 47 37 46 + 208 1 29 39 31 + 209 1 37 29 28 + 210 1 46 37 38 + 211 1 29 31 22 + 212 1 37 28 38 + 213 1 22 31 26 + 214 1 38 28 30 + 215 1 30 28 21 + 216 1 38 30 41 + 217 1 21 28 20 + 218 1 30 21 23 + 219 1 41 30 33 + 220 1 20 28 29 + 221 1 23 21 15 + 222 1 33 30 23 + 223 1 20 29 22 + 224 1 15 21 13 + 225 1 20 22 14 + 226 1 13 21 20 + 227 1 15 13 9 + 228 1 14 22 18 + 229 1 13 20 14 + 230 1 9 13 8 + 231 1 13 14 8 + 232 1 9 8 4 + 233 1 8 14 11 + 234 1 4 8 6 + 235 1 9 4 7 + 236 1 7 4 3 + 237 1 9 7 12 + 238 1 12 7 10 + 239 1 9 12 15 + 240 1 15 12 19 + 241 1 19 12 16 + 242 1 15 19 23 + 243 1 16 12 10 + 244 1 19 16 24 + 245 1 23 19 27 + 246 1 24 16 25 + 247 1 27 19 24 + 248 1 23 27 33 + 249 1 27 24 34 + 250 1 33 27 40 + 251 1 34 24 32 + 252 1 40 27 34 + 253 1 33 40 44 + 254 1 32 24 25 + 255 1 40 34 45 + 256 1 44 40 52 + 257 1 45 34 43 + 258 1 40 45 52 + 259 1 43 34 32 + 260 1 52 45 58 + 261 1 43 32 35 + 262 1 58 45 56 + 263 1 52 58 67 + 264 1 56 45 43 + 265 1 58 56 70 + 266 1 67 58 74 + 267 1 56 43 53 + 268 1 70 56 66 + 269 1 74 58 70 + 270 1 53 43 35 + 271 1 66 56 53 + 272 1 66 53 62 + 273 1 47 46 59 + 274 1 59 46 60 + 275 1 60 46 50 + 276 1 59 60 71 + 277 1 50 46 38 + 278 1 60 50 64 + 279 1 71 60 75 + 280 1 50 38 41 + 281 1 64 50 54 + 282 1 75 60 64 + 283 1 54 50 41 + 284 1 64 54 68 + 285 1 54 41 44 + 286 1 68 54 57 + 287 1 44 41 33 + 288 1 54 44 57 + 289 1 57 44 52 + 290 1 57 52 67 + 291 1 57 67 73 + 292 1 73 67 83 + 293 1 57 73 68 + 294 1 83 67 74 + 295 1 68 73 84 + 296 1 83 74 92 + 297 1 84 73 90 + 298 1 68 84 78 + 299 1 92 74 86 + 300 1 90 73 83 + 301 1 78 84 95 + 302 1 86 74 70 + 303 1 90 83 100 + 304 1 95 84 101 + 305 1 86 70 82 + 306 1 100 83 92 + 307 1 101 84 90 + 308 1 82 70 66 + 309 1 101 90 110 + 310 1 82 66 77 + 311 1 110 90 100 + 312 1 101 110 121 + 313 1 77 66 62 + 314 1 110 100 119 + 315 1 121 110 131 + 316 1 119 100 112 + 317 1 110 119 131 + 318 1 112 100 92 + 319 1 131 119 141 + 320 1 112 92 103 + 321 1 141 119 132 + 322 1 131 141 152 + 323 1 103 92 86 + 324 1 132 119 112 + 325 1 103 86 99 + 326 1 132 112 125 + 327 1 99 86 82 + 328 1 125 112 103 + 329 1 99 82 94 + 330 1 94 82 77 + 331 1 99 94 113 + 332 1 113 94 109 + 333 1 99 113 118 + 334 1 109 94 97 + 335 1 99 118 103 + 336 1 103 118 125 + 337 1 71 75 88 + 338 1 88 75 91 + 339 1 71 88 87 + 340 1 91 75 78 + 341 1 88 91 106 + 342 1 87 88 104 + 343 1 78 75 64 + 344 1 106 91 108 + 345 1 104 88 106 + 346 1 108 91 95 + 347 1 106 108 126 + 348 1 95 91 78 + 349 1 108 95 114 + 350 1 126 108 129 + 351 1 114 95 101 + 352 1 108 114 129 + 353 1 114 101 121 + 354 1 129 114 134 + 355 1 114 121 134 + 356 1 129 134 151 + 357 1 134 121 144 + 358 1 151 134 156 + 359 1 129 151 147 + 360 1 144 121 131 + 361 1 156 134 144 + 362 1 147 151 168 + 363 1 147 168 164 + 364 1 147 164 142 + 365 1 142 164 160 + 366 1 147 142 126 + 367 1 126 142 122 + 368 1 147 126 129 + 369 1 87 104 105 + 370 1 105 104 120 + 371 1 120 104 122 + 372 1 105 120 123 + 373 1 122 104 106 + 374 1 122 106 126 + 375 1 144 131 152 + 376 1 224 214 227 + 377 1 224 227 234 + 378 1 234 227 238 + 379 1 234 238 243 + 380 1 240 234 243 + 381 1 240 243 246 + 382 1 242 245 248 + 383 1 248 245 249 + 384 1 248 249 251 + 385 1 242 248 247 + 386 1 102 124 117 + 387 1 113 109 128 + 388 1 128 109 116 + 389 1 113 128 133 + 390 1 133 128 150 + 391 1 133 150 154 + 392 1 154 150 172 + 393 1 150 128 149 + 394 1 149 128 137 + 395 1 150 149 169 + 396 1 169 149 163 + 397 1 113 133 118 + 398 1 235 241 244 + 399 1 244 241 247 + 400 1 247 241 242 + 401 1 68 78 64 + 402 1 94 77 97 + 403 1 55 69 63 + 404 1 219 231 233 + 405 1 85 102 98 + 406 1 192 169 188 + 407 1 239 233 231 + 408 1 239 235 244 + 409 1 63 49 55 + 410 1 62 79 77 + 411 1 193 189 171 + 412 1 171 189 162 + 413 1 17 25 16 + 414 1 17 16 10 + 415 1 216 190 206 + 416 1 216 206 223 + 417 1 18 11 14 + 418 1 137 163 149 + 419 1 251 250 248 + 420 1 248 250 247 + 421 1 138 117 124 + 422 1 5 10 7 + 423 1 5 7 3 + 424 1 229 223 218 + 425 1 229 218 233 + 426 1 36 26 31 + 427 1 97 116 109 + 428 1 187 162 189 + 429 1 35 48 53 + 430 1 6 2 4 + 431 1 186 188 163 + 432 1 98 80 85 + 433 1 49 36 42 + 434 1 79 97 77 + 435 1 25 35 32 + 436 1 11 6 8 + 437 1 117 98 102 + 438 1 26 18 22 + 439 1 116 137 128 + 440 1 162 138 146 + 441 1 48 62 53 + 442 1 80 63 69 + 443 1 188 169 163 + 444 1 4 2 3 +End Elements + + + +Begin SubModelPart Soil_drained-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 6 + 11 + 18 + 26 + 36 + 49 + 63 + 80 + 98 + 117 + 138 + 162 + 186 + 187 + 188 + 192 + 197 + 200 + 209 + 215 + 222 + 228 + 232 + 238 + 243 + 246 + 249 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-2 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 3 + 5 + 10 + 17 + 25 + 35 + 48 + 62 + 79 + 97 + 116 + 137 + 163 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-3 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Fluid_Pressure-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + diff --git a/applications/GeoMechanicsApplication/tests/test_water_pressure.py b/applications/GeoMechanicsApplication/tests/test_water_pressure.py index 47a16933f261..7add7ea33071 100644 --- a/applications/GeoMechanicsApplication/tests/test_water_pressure.py +++ b/applications/GeoMechanicsApplication/tests/test_water_pressure.py @@ -18,18 +18,50 @@ def tearDown(self): # Code here will be placed AFTER every test in this TestCase. pass - def test_inclined_phreatic_line(self): + # def test_inclined_phreatic_line(self): + # """ + # test hydrostatic water pressure under an inclided phreatic line ranging over the width of the geometry + + # :return: + # """ + # test_name = 'test_inclinded_phreatic_line' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # water_pressure = test_helper.get_water_pressure(simulation) + + # p_bot_left = water_pressure[0] + # p_bot_middle = water_pressure[47] + # p_bot_right = water_pressure[185] + + # p_top_left = water_pressure[186] + # p_top_middle = water_pressure[222] + # p_top_right = water_pressure[250] + + # self.assertAlmostEqual(-10000, p_bot_left) + # self.assertAlmostEqual(-7500, p_bot_middle) + # self.assertAlmostEqual(-5000, p_bot_right) + + # self.assertAlmostEqual(0, p_top_left) + # self.assertAlmostEqual(0, p_top_middle) + # self.assertAlmostEqual(0, p_top_right) + + def test_inclined_phreatic_line_time(self): """ test hydrostatic water pressure under an inclided phreatic line ranging over the width of the geometry :return: """ - test_name = 'test_inclinded_phreatic_line' + test_name = 'test_inclinded_phreatic_multi_line_time_dependent' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) simulation = test_helper.run_kratos(file_path) - water_pressure = test_helper.get_water_pressure(simulation) + res_path = os.path.join(file_path, test_name + '.post.res') + + water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') + print(water_pressure.keys()) + p_bot_left = water_pressure[0] p_bot_middle = water_pressure[47] p_bot_right = water_pressure[185] @@ -45,236 +77,292 @@ def test_inclined_phreatic_line(self): self.assertAlmostEqual(0, p_top_left) self.assertAlmostEqual(0, p_top_middle) self.assertAlmostEqual(0, p_top_right) + + # def test_phreatic_multi_line_2_points(self): + # """ + # test hydrostatic water pressure under a phreatic multi line ranging over the width of the geometry + # (Same as test_inclined_phreatic_line) + # :return: + # """ + # test_name = 'test_inclined_phreatic_multi_line' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # water_pressure = test_helper.get_water_pressure(simulation) + + # p_bot_left = water_pressure[0] + # p_bot_middle = water_pressure[47] + # p_bot_right = water_pressure[185] + + # p_top_left = water_pressure[186] + # p_top_middle = water_pressure[222] + # p_top_right = water_pressure[250] + + # self.assertAlmostEqual(-10000, p_bot_left) + # self.assertAlmostEqual(-7500, p_bot_middle) + # self.assertAlmostEqual(-5000, p_bot_right) + + # self.assertAlmostEqual(0, p_top_left) + # self.assertAlmostEqual(0, p_top_middle) + # self.assertAlmostEqual(0, p_top_right) + + # def test_phreatic_multi_line_3_points(self): + # """ + # test hydrostatic water pressure under a phreatic multi line ranging over the width of the geometry + # (Same as test_inclined_phreatic_line) + # :return: + # """ + # test_name = 'test_inclined_phreatic_multi_line_3_points' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # water_pressure = test_helper.get_water_pressure(simulation) + + # p_bot_left = water_pressure[0] + # p_bot_middle = water_pressure[47] + # p_bot_right = water_pressure[185] + + # p_top_left = water_pressure[186] + # p_top_middle = water_pressure[222] + # p_top_right = water_pressure[250] + + # self.assertAlmostEqual(-10000, p_bot_left) + # self.assertAlmostEqual(-9000, p_bot_middle) + # self.assertAlmostEqual(-5000, p_bot_right) + + # self.assertAlmostEqual(0, p_top_left) + # self.assertAlmostEqual(0, p_top_middle) + # self.assertAlmostEqual(0, p_top_right) + + # def test_inclinded_phreatic_line_smaller_line(self): + # """ + # test hydrostatic water pressure under an inclided phreatic line ranging over a part of the geometry + + # :return: + # """ + # test_name = 'test_inclinded_phreatic_line_smaller_line' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # # Get water pressure in all the nodes + # water_pressure = test_helper.get_water_pressure(simulation) + + # # get node information of the bottom nodes in the geometry + # bottom_n_nbrs = [0, 2, 4, 9, 16, 24, 34, 47, 61, 78, 96, 115, 136, 162, 185] + # x_coords_boundary_nodes = [i / 14 for i in range(15)] + + # # Set turning points of the phreatic line + # head_values = [1, 1, 0.5, 0.5] + # head_x_coords = [0, 0.3, 0.7, 1] + + # # Analytically calculate water pressure at the bottom of the geometry + # dhdx = (head_values[2] - head_values[1]) / (head_x_coords[2] - head_x_coords[1]) + # gamma_w = 10000 + + # p_bottom_analytic = [-head_values[1] * gamma_w if x <= head_x_coords[1] + # else -head_values[2] * gamma_w if x >= head_x_coords[2] + # else -(dhdx * (x - head_x_coords[1]) + head_values[1]) * gamma_w + # for x in x_coords_boundary_nodes] + + # # assert + # for idx, node_nr in enumerate(bottom_n_nbrs): + # self.assertAlmostEqual(p_bottom_analytic[idx], water_pressure[node_nr], delta=1e-6) + + # @KratosUnittest.skip("unit test not implemented") + # def test_interpolate_water_pressure(self): + # pass + + # def test_interpolate_water_pressure_inclined(self): + # """ + # Test interpolate water pressure with an inclined phreatic line. + # The geometry consists out of 3 blocks. On the top block, an inclined phreatic line is defined. On the bottom + # block, 100 pressure is defined. The water pressure in the middle block is interpolated between the water pressure + # in the top and bottom block + # :return: + # """ + + # test_name = 'interpolate_line_2' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # water_pressure = test_helper.get_water_pressure(simulation) + + # # Node numbers of the left and right boundary of the middle block + # middle_left_n_nbrs = [181, 155, 134, 110, 92, 75, 59, 45] + # middle_right_n_nbrs = [301, 287, 274, 260, 249, 235, 227, 217] + + # # Pore pressures at the corners of the middle block + # p_top_middle_left = -10000 + # p_bot_middle_left = -100 + + # p_top_middle_right = -5000 + # p_bot_middle_tight = -100 + + # # Vertical coordinates of the left and right boundary nodes of the middle block + # vert_coord_bound_mid = [-i / 7 * 0.5 + 1.0 for i in range(8)] + + # # Analytically calculate pore pressure along left and right boundary of the middle block + # dpdy_left = (p_top_middle_left - p_bot_middle_left) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) + # dpdy_right = (p_top_middle_right - p_bot_middle_tight) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) + + # p_middle_left_analytic = [(dpdy_left * (y - vert_coord_bound_mid[0]) + p_top_middle_left) + # for y in vert_coord_bound_mid] + + # p_middle_right_analytic = [(dpdy_right * (y - vert_coord_bound_mid[0]) + p_top_middle_right) + # for y in vert_coord_bound_mid] + + # # Assert + # for idx, node_nr in enumerate(middle_left_n_nbrs): + # self.assertAlmostEqual(p_middle_left_analytic[idx], water_pressure[node_nr], delta=1e-6) + + # for idx, node_nr in enumerate(middle_right_n_nbrs): + # self.assertAlmostEqual(p_middle_right_analytic[idx], water_pressure[node_nr], delta=1e-6) + + # @KratosUnittest.skip("check if test is correct") + # def test_normal_load_triangle_3n_fic(self): + # test_name = 'test_normal_load_triangle_3n_fic' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # n_dim = 2 + # self.assert_linear_elastic_saturated_block(simulation, n_dim) + + # def test_normal_load_triangle_6n(self): + # test_name = 'test_normal_load_triangle_6n' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # n_dim = 2 + # self.assert_linear_elastic_saturated_block(simulation, n_dim) + + # def test_normal_load_quad_8n(self): + # test_name = 'test_normal_load_quad_8n' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # n_dim = 2 + # self.assert_linear_elastic_saturated_block(simulation, n_dim) + + # def test_normal_load_tetra_10n(self): + # test_name = 'test_normal_load_tetra_10n' + # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + # simulation = test_helper.run_kratos(file_path) + + # n_dim = 3 + # self.assert_linear_elastic_saturated_block(simulation, n_dim) + + # def assert_linear_elastic_saturated_block(self, simulation, n_dim): + # """ + # Assert results of a linear elastic fully saturated block. The sides of the block can move freely in vertical + # direction and are fixed in horizontal direction. The bottom of the block is fixed. On top of the block, a + # hydrostatic water load is applied with a hydraulic head 1 meter above the top of the soil placed. Results are: + # total stresses, effective stresses, displacements, green langrange strains and water pressure. + + # :param simulation: Kratos simulation + # :param top_node_nbrs: node numbers of the nodes at the top of the geometry + # :param n_dim: number of dimensions + # :return: + # """ + # # get total stresses + # total_stresses = test_helper.get_total_stress_tensor(simulation) + # total_stresses_xx = [integration_point[0,0] for element in total_stresses for integration_point in element] + + # if n_dim >= 2: + # total_stresses_yy = [integration_point[1,1] for element in total_stresses for integration_point in element] + # if n_dim >= 3: + # total_stresses_zz = [integration_point[2,2] for element in total_stresses for integration_point in element] + + # # get effective stresses + # efective_stresses = test_helper.get_cauchy_stress_tensor(simulation) + # efective_stresses_xx = [integration_point[0,0] for element in efective_stresses for integration_point in element] + # if n_dim >= 2: + # efective_stresses_yy = [integration_point[1,1] for element in efective_stresses + # for integration_point in element] + # if n_dim >= 3: + # efective_stresses_zz = [integration_point[2,2] for element in efective_stresses + # for integration_point in element] + + # # get strains + # green_lagrange_strains = test_helper.get_green_lagrange_strain_tensor(simulation) + # green_lagrange_strains_xx = [integration_point[0,0] for element in green_lagrange_strains for integration_point in + # element] + # if n_dim >= 2: + # green_lagrange_strains_yy = [integration_point[1,1] for element in green_lagrange_strains + # for integration_point in element] + # if n_dim >= 3: + # green_lagrange_strains_zz = [integration_point[2,2] for element in green_lagrange_strains + # for integration_point in element] + + # # get displacements + # displacements = test_helper.get_displacement(simulation) + # x_displacements = [displacement[0] for displacement in displacements] + # if n_dim >= 2: + # y_displacements = [displacement[1] for displacement in displacements] + # if n_dim >= 3: + # z_displacements = [displacement[2] for displacement in displacements] + + # # get water pressures + # water_pressures = test_helper.get_water_pressure(simulation) + + # # get coordinates + # nodal_coordinates = test_helper.get_nodal_coordinates(simulation) + # gauss_coordinates = test_helper.get_gauss_coordinates(simulation) + + # # get the coordinates of all gauss points in a list + # gauss_coordinates_x = [integration_point[0] for element in gauss_coordinates for integration_point in + # element] + # if n_dim >= 2: + # gauss_coordinates_y = [integration_point[1] for element in gauss_coordinates for integration_point in + # element] + # if n_dim >= 3: + # gauss_coordinates_z = [integration_point[2] for element in gauss_coordinates for integration_point in + # element] + + # # Calculate expected values + # expected_water_pressure = [coord[1] * 1e4 - 2e4 for coord in nodal_coordinates] + # #todo correct this + # expected_displacements_y = [coord[1] * 0.0001667 for coord in nodal_coordinates] + + # expected_total_stress_xx = [gauss_coordinate_y * 1e4 - 2e4 for gauss_coordinate_y in gauss_coordinates_y] + # if n_dim >= 2: + # expected_eff_stress_yy = [(1 - gauss_coordinate_y) * 1e4 for gauss_coordinate_y in gauss_coordinates_y] + # expected_strain_yy = [(1-gauss_coordinate_y) * 0.00033333 for gauss_coordinate_y in gauss_coordinates_y] + # if n_dim >= 3: + # expected_total_stress_zz = expected_total_stress_xx + + # # Assert integration point information + # for idx, total_stress_xx in enumerate(total_stresses_xx): + # self.assertAlmostEqual(expected_total_stress_xx[idx], total_stress_xx, 4) + # if n_dim >= 2: + # self.assertAlmostEqual(-1e4, total_stresses_yy[idx], 1) + # if n_dim >= 3: + # self.assertAlmostEqual(expected_total_stress_zz[idx], total_stresses_zz[idx], 4) - def test_inclinded_phreatic_line_smaller_line(self): - """ - test hydrostatic water pressure under an inclided phreatic line ranging over a part of the geometry - - :return: - """ - test_name = 'test_inclinded_phreatic_line_smaller_line' - file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) - - # Get water pressure in all the nodes - water_pressure = test_helper.get_water_pressure(simulation) - - # get node information of the bottom nodes in the geometry - bottom_n_nbrs = [0, 2, 4, 9, 16, 24, 34, 47, 61, 78, 96, 115, 136, 162, 185] - x_coords_boundary_nodes = [i / 14 for i in range(15)] - - # Set turning points of the phreatic line - head_values = [1, 1, 0.5, 0.5] - head_x_coords = [0, 0.3, 0.7, 1] - - # Analytically calculate water pressure at the bottom of the geometry - dhdx = (head_values[2] - head_values[1]) / (head_x_coords[2] - head_x_coords[1]) - gamma_w = 10000 - - p_bottom_analytic = [-head_values[1] * gamma_w if x <= head_x_coords[1] - else -head_values[2] * gamma_w if x >= head_x_coords[2] - else -(dhdx * (x - head_x_coords[1]) + head_values[1]) * gamma_w - for x in x_coords_boundary_nodes] - - # assert - for idx, node_nr in enumerate(bottom_n_nbrs): - self.assertAlmostEqual(p_bottom_analytic[idx], water_pressure[node_nr], delta=1e-6) - - @KratosUnittest.skip("unit test not implemented") - def test_interpolate_water_pressure(self): - pass - - def test_interpolate_water_pressure_inclined(self): - """ - Test interpolate water pressure with an inclined phreatic line. - The geometry consists out of 3 blocks. On the top block, an inclined phreatic line is defined. On the bottom - block, 100 pressure is defined. The water pressure in the middle block is interpolated between the water pressure - in the top and bottom block - :return: - """ - - test_name = 'interpolate_line_2' - file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) - - water_pressure = test_helper.get_water_pressure(simulation) - - # Node numbers of the left and right boundary of the middle block - middle_left_n_nbrs = [181, 155, 134, 110, 92, 75, 59, 45] - middle_right_n_nbrs = [301, 287, 274, 260, 249, 235, 227, 217] - - # Pore pressures at the corners of the middle block - p_top_middle_left = -10000 - p_bot_middle_left = -100 - - p_top_middle_right = -5000 - p_bot_middle_tight = -100 - - # Vertical coordinates of the left and right boundary nodes of the middle block - vert_coord_bound_mid = [-i / 7 * 0.5 + 1.0 for i in range(8)] - - # Analytically calculate pore pressure along left and right boundary of the middle block - dpdy_left = (p_top_middle_left - p_bot_middle_left) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) - dpdy_right = (p_top_middle_right - p_bot_middle_tight) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) - - p_middle_left_analytic = [(dpdy_left * (y - vert_coord_bound_mid[0]) + p_top_middle_left) - for y in vert_coord_bound_mid] - - p_middle_right_analytic = [(dpdy_right * (y - vert_coord_bound_mid[0]) + p_top_middle_right) - for y in vert_coord_bound_mid] - - # Assert - for idx, node_nr in enumerate(middle_left_n_nbrs): - self.assertAlmostEqual(p_middle_left_analytic[idx], water_pressure[node_nr], delta=1e-6) - - for idx, node_nr in enumerate(middle_right_n_nbrs): - self.assertAlmostEqual(p_middle_right_analytic[idx], water_pressure[node_nr], delta=1e-6) - - @KratosUnittest.skip("check if test is correct") - def test_normal_load_triangle_3n_fic(self): - test_name = 'test_normal_load_triangle_3n_fic' - file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) - - n_dim = 2 - self.assert_linear_elastic_saturated_block(simulation, n_dim) - - def test_normal_load_triangle_6n(self): - test_name = 'test_normal_load_triangle_6n' - file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) - - n_dim = 2 - self.assert_linear_elastic_saturated_block(simulation, n_dim) - - def test_normal_load_quad_8n(self): - test_name = 'test_normal_load_quad_8n' - file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) - - n_dim = 2 - self.assert_linear_elastic_saturated_block(simulation, n_dim) - - def test_normal_load_tetra_10n(self): - test_name = 'test_normal_load_tetra_10n' - file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) - - n_dim = 3 - self.assert_linear_elastic_saturated_block(simulation, n_dim) - - def assert_linear_elastic_saturated_block(self, simulation, n_dim): - """ - Assert results of a linear elastic fully saturated block. The sides of the block can move freely in vertical - direction and are fixed in horizontal direction. The bottom of the block is fixed. On top of the block, a - hydrostatic water load is applied with a hydraulic head 1 meter above the top of the soil placed. Results are: - total stresses, effective stresses, displacements, green langrange strains and water pressure. - - :param simulation: Kratos simulation - :param top_node_nbrs: node numbers of the nodes at the top of the geometry - :param n_dim: number of dimensions - :return: - """ - # get total stresses - total_stresses = test_helper.get_total_stress_tensor(simulation) - total_stresses_xx = [integration_point[0,0] for element in total_stresses for integration_point in element] - - if n_dim >= 2: - total_stresses_yy = [integration_point[1,1] for element in total_stresses for integration_point in element] - if n_dim >= 3: - total_stresses_zz = [integration_point[2,2] for element in total_stresses for integration_point in element] - - # get effective stresses - efective_stresses = test_helper.get_cauchy_stress_tensor(simulation) - efective_stresses_xx = [integration_point[0,0] for element in efective_stresses for integration_point in element] - if n_dim >= 2: - efective_stresses_yy = [integration_point[1,1] for element in efective_stresses - for integration_point in element] - if n_dim >= 3: - efective_stresses_zz = [integration_point[2,2] for element in efective_stresses - for integration_point in element] - - # get strains - green_lagrange_strains = test_helper.get_green_lagrange_strain_tensor(simulation) - green_lagrange_strains_xx = [integration_point[0,0] for element in green_lagrange_strains for integration_point in - element] - if n_dim >= 2: - green_lagrange_strains_yy = [integration_point[1,1] for element in green_lagrange_strains - for integration_point in element] - if n_dim >= 3: - green_lagrange_strains_zz = [integration_point[2,2] for element in green_lagrange_strains - for integration_point in element] - - # get displacements - displacements = test_helper.get_displacement(simulation) - x_displacements = [displacement[0] for displacement in displacements] - if n_dim >= 2: - y_displacements = [displacement[1] for displacement in displacements] - if n_dim >= 3: - z_displacements = [displacement[2] for displacement in displacements] - - # get water pressures - water_pressures = test_helper.get_water_pressure(simulation) - - # get coordinates - nodal_coordinates = test_helper.get_nodal_coordinates(simulation) - gauss_coordinates = test_helper.get_gauss_coordinates(simulation) - - # get the coordinates of all gauss points in a list - gauss_coordinates_x = [integration_point[0] for element in gauss_coordinates for integration_point in - element] - if n_dim >= 2: - gauss_coordinates_y = [integration_point[1] for element in gauss_coordinates for integration_point in - element] - if n_dim >= 3: - gauss_coordinates_z = [integration_point[2] for element in gauss_coordinates for integration_point in - element] - - # Calculate expected values - expected_water_pressure = [coord[1] * 1e4 - 2e4 for coord in nodal_coordinates] - #todo correct this - expected_displacements_y = [coord[1] * 0.0001667 for coord in nodal_coordinates] - - expected_total_stress_xx = [gauss_coordinate_y * 1e4 - 2e4 for gauss_coordinate_y in gauss_coordinates_y] - if n_dim >= 2: - expected_eff_stress_yy = [(1 - gauss_coordinate_y) * 1e4 for gauss_coordinate_y in gauss_coordinates_y] - expected_strain_yy = [(1-gauss_coordinate_y) * 0.00033333 for gauss_coordinate_y in gauss_coordinates_y] - if n_dim >= 3: - expected_total_stress_zz = expected_total_stress_xx - - # Assert integration point information - for idx, total_stress_xx in enumerate(total_stresses_xx): - self.assertAlmostEqual(expected_total_stress_xx[idx], total_stress_xx, 4) - if n_dim >= 2: - self.assertAlmostEqual(-1e4, total_stresses_yy[idx], 1) - if n_dim >= 3: - self.assertAlmostEqual(expected_total_stress_zz[idx], total_stresses_zz[idx], 4) - - self.assertAlmostEqual(0.0, efective_stresses_xx[idx], 4) - if n_dim >= 2: - self.assertAlmostEqual(expected_eff_stress_yy[idx], efective_stresses_yy[idx],4) - if n_dim >= 3: - self.assertAlmostEqual(0.0, efective_stresses_zz[idx], 4) - - self.assertAlmostEqual(0.0, green_lagrange_strains_xx[idx]) - if n_dim >= 2: - self.assertAlmostEqual(expected_strain_yy[idx], green_lagrange_strains_yy[idx]) - if n_dim >= 3: - self.assertAlmostEqual(0.0, green_lagrange_strains_zz[idx]) - - # Assert displacements - for x_displacement in x_displacements: - self.assertAlmostEqual(0.0, x_displacement) - - for node_idx in range(len(nodal_coordinates)): - #todo correct expected displacement + # self.assertAlmostEqual(0.0, efective_stresses_xx[idx], 4) # if n_dim >= 2: - # self.assertAlmostEqual(expected_displacements_y[node_idx], y_displacements[node_idx], 6) - self.assertAlmostEqual(expected_water_pressure[node_idx], water_pressures[node_idx], 6) + # self.assertAlmostEqual(expected_eff_stress_yy[idx], efective_stresses_yy[idx],4) + # if n_dim >= 3: + # self.assertAlmostEqual(0.0, efective_stresses_zz[idx], 4) - if n_dim >= 3: - for z_displacement in z_displacements: - self.assertAlmostEqual(0.0, z_displacement) + # self.assertAlmostEqual(0.0, green_lagrange_strains_xx[idx]) + # if n_dim >= 2: + # self.assertAlmostEqual(expected_strain_yy[idx], green_lagrange_strains_yy[idx]) + # if n_dim >= 3: + # self.assertAlmostEqual(0.0, green_lagrange_strains_zz[idx]) + + # # Assert displacements + # for x_displacement in x_displacements: + # self.assertAlmostEqual(0.0, x_displacement) + + # for node_idx in range(len(nodal_coordinates)): + # #todo correct expected displacement + # # if n_dim >= 2: + # # self.assertAlmostEqual(expected_displacements_y[node_idx], y_displacements[node_idx], 6) + # self.assertAlmostEqual(expected_water_pressure[node_idx], water_pressures[node_idx], 6) + + # if n_dim >= 3: + # for z_displacement in z_displacements: + # self.assertAlmostEqual(0.0, z_displacement) if __name__ == '__main__': KratosUnittest.main() From 3ba3b052ed92583303b8d380aaf60256ce481b84 Mon Sep 17 00:00:00 2001 From: Jonathan Nuttall Date: Tue, 31 Jan 2023 16:54:15 +0100 Subject: [PATCH 02/27] Updated py:: namespace typo in add_custom_processes_to_python.cpp --- .../custom_python/add_custom_processes_to_python.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp index 4fa7ef85dbd8..7167f4cea6af 100644 --- a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp +++ b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp @@ -92,11 +92,11 @@ void AddCustomProcessesToPython(pybind11::module& m) py::class_ (m, "ApplyConstantPhreaticMultiLinePressureProcess") - .def(init < ModelPart&, Parameters>()); + .def(py::init < ModelPart&, Parameters>()); py::class_ (m, "ApplyConstantInterpolateLinePressureProcess") - .def(init < ModelPart&, Parameters>()); + .def(py::init < ModelPart&, Parameters>()); py::class_ (m, "ApplyBoundaryPhreaticLinePressureTableProcess") @@ -112,11 +112,11 @@ void AddCustomProcessesToPython(pybind11::module& m) py::class_ (m, "ApplyPhreaticMultiLinePressureTableProcess") - .def(init < ModelPart&, Parameters>()); + .def(py::init < ModelPart&, Parameters>()); py::class_ (m, "ApplyBoundaryPhreaticLinePressureTableProcess") - .def(init < ModelPart&, Parameters>()); + .def(py::init < ModelPart&, Parameters>()); py::class_ (m, "ApplyPhreaticSurfacePressureTableProcess") From 1d9a4d82bd116a5cc8113a2afa885aa95f2cb8eb Mon Sep 17 00:00:00 2001 From: Jonathan Nuttall Date: Fri, 3 Feb 2023 10:26:58 +0100 Subject: [PATCH 03/27] Removed duplicate addition of python ApplyConstantInterpolateLinePressureProcess --- .../custom_python/add_custom_processes_to_python.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp index 7167f4cea6af..4aff08c9550e 100644 --- a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp +++ b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp @@ -94,10 +94,6 @@ void AddCustomProcessesToPython(pybind11::module& m) (m, "ApplyConstantPhreaticMultiLinePressureProcess") .def(py::init < ModelPart&, Parameters>()); - py::class_ - (m, "ApplyConstantInterpolateLinePressureProcess") - .def(py::init < ModelPart&, Parameters>()); - py::class_ (m, "ApplyBoundaryPhreaticLinePressureTableProcess") .def(py::init < ModelPart&, Parameters>()); From 339f17a905f450228df92a786cebbcf33c9f9669 Mon Sep 17 00:00:00 2001 From: Jonathan Nuttall Date: Fri, 3 Feb 2023 13:00:36 +0100 Subject: [PATCH 04/27] Removed duplicate addition of python ApplyBoundaryPhreaticLinePressureTableProcess --- .../custom_python/add_custom_processes_to_python.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp index 4aff08c9550e..70806b7cb1be 100644 --- a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp +++ b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp @@ -110,10 +110,6 @@ void AddCustomProcessesToPython(pybind11::module& m) (m, "ApplyPhreaticMultiLinePressureTableProcess") .def(py::init < ModelPart&, Parameters>()); - py::class_ - (m, "ApplyBoundaryPhreaticLinePressureTableProcess") - .def(py::init < ModelPart&, Parameters>()); - py::class_ (m, "ApplyPhreaticSurfacePressureTableProcess") .def(py::init < ModelPart&, Parameters>()); From c55254b746135114786717968afe5fc3c5090d56 Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Tue, 7 Feb 2023 10:57:11 +0100 Subject: [PATCH 05/27] Added tests to phreatic multiline process Added tests Fixed issue --- ...t_phreatic_multi_line_pressure_process.hpp | 2 +- .../tests/test_helper.py | 44 +- .../ProjectParameters.json | 4 +- .../MaterialParameters.json | 0 .../ProjectParameters.json | 11 +- ...tic_multi_line_time_dependent_centre.mdpa} | 0 .../MaterialParameters.json | 27 + .../ProjectParameters.json | 167 ++ ...eatic_multi_line_time_dependent_edges.mdpa | 1774 +++++++++++++++++ .../ProjectParameters.json | 2 +- .../tests/test_water_pressure.py | 708 ++++--- 11 files changed, 2394 insertions(+), 345 deletions(-) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent.gid => test_inclinded_phreatic_multi_line_time_dependent_centre.gid}/MaterialParameters.json (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent.gid => test_inclinded_phreatic_multi_line_time_dependent_centre.gid}/ProjectParameters.json (97%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent.gid/test_inclinded_phreatic_multi_line_time_dependent.mdpa => test_inclinded_phreatic_multi_line_time_dependent_centre.gid/test_inclinded_phreatic_multi_line_time_dependent_centre.mdpa} (100%) create mode 100644 applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json create mode 100644 applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/test_inclinded_phreatic_multi_line_time_dependent_edges.mdpa diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index 5cc3b896b695..0b02bce144a9 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -226,7 +226,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process int index = 0; for(index; index < mHorizontalDirectionCoordinates.size(); index++) { - if (mHorizontalDirectionCoordinates[index] > rNode.Coordinates()[mHorizontalDirection]) + if (mHorizontalDirectionCoordinates[index] >= rNode.Coordinates()[mHorizontalDirection]) { break; } diff --git a/applications/GeoMechanicsApplication/tests/test_helper.py b/applications/GeoMechanicsApplication/tests/test_helper.py index e9431af844fa..af8e2d6aa480 100644 --- a/applications/GeoMechanicsApplication/tests/test_helper.py +++ b/applications/GeoMechanicsApplication/tests/test_helper.py @@ -175,49 +175,31 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): all_data = f.readlines() add_var = False - - data = [] - time_steps = [] - all_var_data = [] + res = {} # read all data at each time step of variable for line in all_data: if "End Values" in line and add_var: add_var = False - all_var_data.append(data) - data = [] + if add_var: - data.append(line) + if line.startswith("Values"): + continue; + lineSplit = line.split() + lineSplit[0] = int(lineSplit[0]) + for ind, strVal in enumerate(lineSplit[1:]): + lineSplit[ind+1] = float(strVal) + if (len(lineSplit[1:])==1): + res[time_step][lineSplit[0]] = lineSplit[1] + else: + res[time_step][lineSplit[0]] = lineSplit[1:] if r'"' + variable + r'"' in line: time_step = float(line.split()[3]) - - time_steps.append(time_step) + res[time_step] = {} add_var=True - # initialise results dictionary - res = {"time": time_steps} - - for var_data in all_var_data: - var_data.pop(0) - - # convert var data to floats - for i, _ in enumerate(var_data): - line = var_data[i].split() - line[1] = float(line[1]) - line[2] = float(line[2]) - line[3] = float(line[3]) - var_data[i] = line - - # add node numbers as dict keys - for line in var_data: - res[line[0]] = [] - - for var_data in all_var_data: - for line in var_data: - res[line[0]].append(line[1:]) - return res diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json index 48435dbb41e6..dc11c22f36d8 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json @@ -43,7 +43,7 @@ "displacement_absolute_tolerance": 1.0E-9, "residual_relative_tolerance": 1.0E-4, "residual_absolute_tolerance": 1.0E-9, - "min_iterations": 2, + "min_iterations": 6, "max_iterations": 15, "number_cycles": 100, "reduction_factor": 0.5, @@ -151,7 +151,7 @@ "variable_name": "WATER_PRESSURE", "is_fixed": true, "value": 0.0, - "table": [1,2], + "table": [1, 2], "fluid_pressure_type": "Phreatic_Line", "gravity_direction": 1, "out_of_plane_direction": 2, diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/MaterialParameters.json similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/MaterialParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/MaterialParameters.json diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json similarity index 97% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/ProjectParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json index 7cf0ef206f65..dff094f8f91e 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json @@ -1,6 +1,6 @@ { "problem_data": { - "problem_name": "test_inclinded_phreatic_multi_line_time_dependent", + "problem_name": "test_inclinded_phreatic_multi_line_time_dependent_centre", "start_time": 0.0, "end_time": 4.0, "echo_level": 1, @@ -14,13 +14,14 @@ "start_time": 0.0, "model_import_settings": { "input_type": "mdpa", - "input_filename": "test_inclinded_phreatic_multi_line_time_dependent" + "input_filename": "test_inclinded_phreatic_multi_line_time_dependent_centre" }, "material_import_settings": { "materials_filename": "MaterialParameters.json" }, "time_stepping": { - "time_step": 0.25 + "time_step": 0.25, + "max_delta_time_factor": 1 }, "buffer_size": 2, "echo_level": 1, @@ -43,7 +44,7 @@ "displacement_absolute_tolerance": 1.0E-9, "residual_relative_tolerance": 1.0E-4, "residual_absolute_tolerance": 1.0E-9, - "min_iterations": 2, + "min_iterations": 6, "max_iterations": 15, "number_cycles": 100, "reduction_factor": 0.5, @@ -81,7 +82,7 @@ "process_name": "GiDOutputProcess", "Parameters": { "model_part_name": "PorousDomain.porous_computational_model_part", - "output_name": "test_inclinded_phreatic_multi_line_time_dependent", + "output_name": "test_inclinded_phreatic_multi_line_time_dependent_centre", "postprocess_parameters": { "result_file_configuration": { "gidpost_flags": { diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/test_inclinded_phreatic_multi_line_time_dependent.mdpa b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/test_inclinded_phreatic_multi_line_time_dependent_centre.mdpa similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent.gid/test_inclinded_phreatic_multi_line_time_dependent.mdpa rename to applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/test_inclinded_phreatic_multi_line_time_dependent_centre.mdpa diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json new file mode 100644 index 000000000000..7794c8263b80 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json @@ -0,0 +1,27 @@ +{ + "properties": [{ + "model_part_name": "PorousDomain.Soil_drained-auto-1", + "properties_id": 1, + "Material": { + "constitutive_law": { + "name" : "GeoLinearElasticPlaneStrain2DLaw" + }, + "Variables": { + "IGNORE_UNDRAINED" : true, + "YOUNG_MODULUS" : 3.0e7, + "POISSON_RATIO" : 0.2, + "DENSITY_SOLID" : 2.0e3, + "DENSITY_WATER" : 1.0e3, + "POROSITY" : 0.3, + "BULK_MODULUS_SOLID" : 1.0e12, + "BULK_MODULUS_FLUID" : 2.0e-30, + "PERMEABILITY_XX" : 4.5e-30, + "PERMEABILITY_YY" : 4.5e-30, + "PERMEABILITY_XY" : 0.0, + "DYNAMIC_VISCOSITY" : 1.0e-3, + "THICKNESS" : 1.0 + }, + "Tables": {} + } + }] +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json new file mode 100644 index 000000000000..8a82b0de30b1 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json @@ -0,0 +1,167 @@ +{ + "problem_data": { + "problem_name": "test_inclinded_phreatic_multi_line_time_dependent_edges", + "start_time": 0.0, + "end_time": 4.0, + "echo_level": 1, + "parallel_type": "OpenMP", + "number_of_threads": 1 + }, + "solver_settings": { + "solver_type": "U_Pw", + "model_part_name": "PorousDomain", + "domain_size": 2, + "start_time": 0.0, + "model_import_settings": { + "input_type": "mdpa", + "input_filename": "test_inclinded_phreatic_multi_line_time_dependent_edges" + }, + "material_import_settings": { + "materials_filename": "MaterialParameters.json" + }, + "time_stepping": { + "time_step": 0.25, + "max_delta_time_factor": 1 + }, + "buffer_size": 2, + "echo_level": 1, + "clear_storage": false, + "compute_reactions": false, + "move_mesh_flag": true, + "reform_dofs_at_each_step": false, + "nodal_smoothing": false, + "block_builder": true, + "solution_type": "Quasi-Static", + "scheme_type": "Newmark", + "newmark_beta": 0.25, + "newmark_gamma": 0.5, + "newmark_theta": 0.5, + "rayleigh_m": 0.0, + "rayleigh_k": 0.0, + "strategy_type": "newton_raphson", + "convergence_criterion": "displacement_criterion", + "displacement_relative_tolerance": 1.0E-4, + "displacement_absolute_tolerance": 1.0E-9, + "residual_relative_tolerance": 1.0E-4, + "residual_absolute_tolerance": 1.0E-9, + "min_iterations": 6, + "max_iterations": 15, + "number_cycles": 100, + "reduction_factor": 0.5, + "increase_factor": 2.0, + "realised_factor": 0.9999, + "desired_iterations": 4, + "max_radius_factor": 10.0, + "min_radius_factor": 0.1, + "calculate_reactions": true, + "max_line_search_iterations": 5, + "first_alpha_value": 0.5, + "second_alpha_value": 1.0, + "min_alpha": 0.1, + "max_alpha": 2.0, + "line_search_tolerance": 0.5, + "rotation_dofs": true, + "linear_solver_settings": { + "solver_type": "amgcl", + "smoother_type": "ilu0", + "krylov_type": "gmres", + "coarsening_type": "aggregation", + "max_iteration": 100, + "verbosity": 0, + "tolerance": 1.0e-6, + "scaling": false + }, + "problem_domain_sub_model_part_list": ["Soil_drained-auto-1"], + "processes_sub_model_part_list": ["Solid_Displacement-auto-1","Solid_Displacement-auto-2","Solid_Displacement-auto-3","Fluid_Pressure-auto-1"], + "body_domain_sub_model_part_list": ["Soil_drained-auto-1"] + }, + "output_processes": { + "gid_output": [{ + "python_module": "gid_output_process", + "kratos_module": "KratosMultiphysics", + "process_name": "GiDOutputProcess", + "Parameters": { + "model_part_name": "PorousDomain.porous_computational_model_part", + "output_name": "test_inclinded_phreatic_multi_line_time_dependent_edges", + "postprocess_parameters": { + "result_file_configuration": { + "gidpost_flags": { + "WriteDeformedMeshFlag": "WriteUndeformed", + "WriteConditionsFlag": "WriteElementsOnly", + "GiDPostMode": "GiD_PostAscii", + "MultiFileFlag": "SingleFile" + }, + "file_label": "step", + "output_control_type": "step", + "output_interval": 1, + "body_output": true, + "node_output": false, + "skin_output": false, + "plane_output": [], + "nodal_results": ["DISPLACEMENT","WATER_PRESSURE"], + "gauss_point_results": ["GREEN_LAGRANGE_STRAIN_TENSOR","CAUCHY_STRESS_TENSOR","TOTAL_STRESS_TENSOR","VON_MISES_STRESS","FLUID_FLUX_VECTOR"] + }, + "point_data_configuration": [] + } + } + }] + }, + "processes": { + "constraints_process_list": [{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-1", + "variable_name": "DISPLACEMENT", + "active": [true,false,false], + "is_fixed": [true,false,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-2", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_vector_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyVectorConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Solid_Displacement-auto-3", + "variable_name": "DISPLACEMENT", + "active": [true,true,false], + "is_fixed": [true,true,false], + "value": [0.0,0.0,0.0], + "table": [0,0,0] + } + },{ + "python_module": "apply_scalar_constraint_table_process", + "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", + "process_name": "ApplyScalarConstraintTableProcess", + "Parameters": { + "model_part_name": "PorousDomain.Fluid_Pressure-auto-1", + "variable_name": "WATER_PRESSURE", + "is_fixed": true, + "value": 0.0, + "table": [1, 0, 2], + "fluid_pressure_type": "Phreatic_Multi_Line", + "gravity_direction": 1, + "out_of_plane_direction": 2, + "x_coordinates" : [0.0,0.5,1.0], + "y_coordinates": [0.5,0.5,0.5], + "z_coordinates": [0.0,0.0,0.0], + "specific_weight": 10000.0 + } + }], + "loads_process_list": [] + } +} diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/test_inclinded_phreatic_multi_line_time_dependent_edges.mdpa b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/test_inclinded_phreatic_multi_line_time_dependent_edges.mdpa new file mode 100644 index 000000000000..2797a29b9501 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/test_inclinded_phreatic_multi_line_time_dependent_edges.mdpa @@ -0,0 +1,1774 @@ +Begin Table 1 TIME WATER_PRESSURE + 0.0 0.0 + 1.0 0.5 + 2.0 0.0 + 3.0 -0.5 + 4.0 0.0 +End Table + +Begin Table 2 TIME WATER_PRESSURE + 0.0 0.0 + 1.0 0.25 + 2.0 0.0 + 3.0 -0.25 + 4.0 0.0 +End Table + +Begin Properties 1 +End Properties + + +Begin Nodes + 1 0.0000000000 0.0000000000 0.0000000000 + 2 0.0000000000 0.0714285714 0.0000000000 + 3 0.0714285714 0.0000000000 0.0000000000 + 4 0.0776346270 0.0988478008 0.0000000000 + 5 0.1428571429 0.0000000000 0.0000000000 + 6 0.0000000000 0.1428571429 0.0000000000 + 7 0.1520793486 0.0680781786 0.0000000000 + 8 0.0907159317 0.1726464868 0.0000000000 + 9 0.1515839106 0.1380764253 0.0000000000 + 10 0.2142857143 0.0000000000 0.0000000000 + 11 0.0000000000 0.2142857143 0.0000000000 + 12 0.2124518894 0.1035063639 0.0000000000 + 13 0.1510884725 0.2080746720 0.0000000000 + 14 0.0902204937 0.2426447335 0.0000000000 + 15 0.2119564514 0.1735046106 0.0000000000 + 16 0.2733198683 0.0689363025 0.0000000000 + 17 0.2857142857 0.0000000000 0.0000000000 + 18 0.0000000000 0.2857142857 0.0000000000 + 19 0.2728244303 0.1389345492 0.0000000000 + 20 0.1505930345 0.2780729187 0.0000000000 + 21 0.2114610134 0.2435028573 0.0000000000 + 22 0.0897250556 0.3126429802 0.0000000000 + 23 0.2723289923 0.2089327959 0.0000000000 + 24 0.3375182442 0.0986367809 0.0000000000 + 25 0.3571428571 0.0000000000 0.0000000000 + 26 0.0000000000 0.3571428571 0.0000000000 + 27 0.3331969711 0.1743627344 0.0000000000 + 28 0.2109655754 0.3135011040 0.0000000000 + 29 0.1500975965 0.3480711654 0.0000000000 + 30 0.2718335542 0.2789310426 0.0000000000 + 31 0.0892296176 0.3826412269 0.0000000000 + 32 0.3945603880 0.0697944263 0.0000000000 + 33 0.3327015331 0.2443609811 0.0000000000 + 34 0.3940649500 0.1397926730 0.0000000000 + 35 0.4285714286 0.0000000000 0.0000000000 + 36 0.0000000000 0.4285714286 0.0000000000 + 37 0.2104701374 0.3834993507 0.0000000000 + 38 0.2713381162 0.3489292893 0.0000000000 + 39 0.1496021585 0.4180694121 0.0000000000 + 40 0.3935695120 0.2097909197 0.0000000000 + 41 0.3322060951 0.3143592278 0.0000000000 + 42 0.0887341796 0.4526394736 0.0000000000 + 43 0.4504567725 0.0993518841 0.0000000000 + 44 0.3930740740 0.2797891664 0.0000000000 + 45 0.4544374909 0.1752208582 0.0000000000 + 46 0.2708426782 0.4189275360 0.0000000000 + 47 0.2099746993 0.4534975974 0.0000000000 + 48 0.5000000000 0.0000000000 0.0000000000 + 49 0.0000000000 0.5000000000 0.0000000000 + 50 0.3317106570 0.3843574743 0.0000000000 + 51 0.1491067205 0.4880676588 0.0000000000 + 52 0.4539420528 0.2452191049 0.0000000000 + 53 0.5158009078 0.0706525501 0.0000000000 + 54 0.3925786357 0.3497874127 0.0000000000 + 55 0.0882387416 0.5226377203 0.0000000000 + 56 0.5153054697 0.1406507968 0.0000000000 + 57 0.4534466145 0.3152173510 0.0000000000 + 58 0.5148100317 0.2106490435 0.0000000000 + 59 0.2703472404 0.4889257827 0.0000000000 + 60 0.3312152192 0.4543557210 0.0000000000 + 61 0.2094792613 0.5234958441 0.0000000000 + 62 0.5714285714 0.0000000000 0.0000000000 + 63 0.0000000000 0.5714285714 0.0000000000 + 64 0.3920831979 0.4197856594 0.0000000000 + 65 0.1486112825 0.5580659055 0.0000000000 + 66 0.5753000629 0.1000669874 0.0000000000 + 67 0.5143145937 0.2806472902 0.0000000000 + 68 0.4529511767 0.3852155978 0.0000000000 + 69 0.0877433036 0.5926359670 0.0000000000 + 70 0.5756780106 0.1760789821 0.0000000000 + 71 0.3307197811 0.5243539682 0.0000000000 + 72 0.2698518022 0.5589240294 0.0000000000 + 73 0.5138191550 0.3506455369 0.0000000000 + 74 0.5751825726 0.2460772288 0.0000000000 + 75 0.3915877600 0.4897839066 0.0000000000 + 76 0.2089838233 0.5934940908 0.0000000000 + 77 0.6370414278 0.0715106742 0.0000000000 + 78 0.4524557380 0.4552138444 0.0000000000 + 79 0.6428571429 0.0000000000 0.0000000000 + 80 0.0000000000 0.6428571429 0.0000000000 + 81 0.1481158457 0.6280641506 0.0000000000 + 82 0.6365459899 0.1415089210 0.0000000000 + 83 0.5746871342 0.3160754760 0.0000000000 + 84 0.5133237171 0.4206437834 0.0000000000 + 85 0.0872478660 0.6626342106 0.0000000000 + 86 0.6360505518 0.2115071679 0.0000000000 + 87 0.3302243426 0.5943522149 0.0000000000 + 88 0.3910923221 0.5597821533 0.0000000000 + 89 0.2693563640 0.6289222760 0.0000000000 + 90 0.5741916959 0.3860737220 0.0000000000 + 91 0.4519603009 0.5252120918 0.0000000000 + 92 0.6355551133 0.2815054146 0.0000000000 + 93 0.2084883857 0.6634923374 0.0000000000 + 94 0.7001433534 0.1007820910 0.0000000000 + 95 0.5128282786 0.4906420301 0.0000000000 + 96 0.1476204060 0.6980623973 0.0000000000 + 97 0.7142857143 0.0000000000 0.0000000000 + 98 0.0000000000 0.7142857143 0.0000000000 + 99 0.6969185306 0.1769371066 0.0000000000 + 100 0.6350596749 0.3515036612 0.0000000000 + 101 0.5736962577 0.4560719691 0.0000000000 + 102 0.0867524267 0.7326324579 0.0000000000 + 103 0.6964230920 0.2469353532 0.0000000000 + 104 0.3905968836 0.6297804001 0.0000000000 + 105 0.3297289033 0.6643504612 0.0000000000 + 106 0.4514648630 0.5952103385 0.0000000000 + 107 0.2688609243 0.6989205222 0.0000000000 + 108 0.5123328418 0.5606402769 0.0000000000 + 109 0.7582819479 0.0723687987 0.0000000000 + 110 0.6345642367 0.4215019076 0.0000000000 + 111 0.2079929457 0.7334905840 0.0000000000 + 112 0.6959276538 0.3169335998 0.0000000000 + 113 0.7577865096 0.1423670454 0.0000000000 + 114 0.5732008201 0.5260702143 0.0000000000 + 115 0.1471249672 0.7680606437 0.0000000000 + 116 0.7857142857 0.0000000000 0.0000000000 + 117 0.0000000000 0.7857142857 0.0000000000 + 118 0.7572860102 0.2123746795 0.0000000000 + 119 0.6954322157 0.3869318465 0.0000000000 + 120 0.3901014431 0.6997786459 0.0000000000 + 121 0.6340687986 0.4915001543 0.0000000000 + 122 0.4509694216 0.6652085838 0.0000000000 + 123 0.3292334646 0.7343487078 0.0000000000 + 124 0.0862569880 0.8026307045 0.0000000000 + 125 0.7567969679 0.2823701526 0.0000000000 + 126 0.5118374039 0.6306385236 0.0000000000 + 127 0.2683654869 0.7689187686 0.0000000000 + 128 0.8193591446 0.0872021784 0.0000000000 + 129 0.5727053828 0.5960684621 0.0000000000 + 130 0.2074975077 0.8034888295 0.0000000000 + 131 0.6949367775 0.4569300929 0.0000000000 + 132 0.7563059607 0.3523684526 0.0000000000 + 133 0.8181499369 0.1777973059 0.0000000000 + 134 0.6335733613 0.5614983995 0.0000000000 + 135 0.1466295286 0.8380588904 0.0000000000 + 136 0.8176627030 0.2477959626 0.0000000000 + 137 0.8571428571 0.0000000000 0.0000000000 + 138 0.0000000000 0.8571428571 0.0000000000 + 139 0.4504739844 0.7352068305 0.0000000000 + 140 0.3896060057 0.7697768924 0.0000000000 + 141 0.7558057104 0.4223635832 0.0000000000 + 142 0.5113419629 0.7006367683 0.0000000000 + 143 0.3287380273 0.8043469545 0.0000000000 + 144 0.6944402915 0.5269298688 0.0000000000 + 145 0.8171718080 0.3177945936 0.0000000000 + 146 0.0857615493 0.8726289513 0.0000000000 + 147 0.5722103607 0.6660667414 0.0000000000 + 148 0.2678700483 0.8389170152 0.0000000000 + 149 0.8799109224 0.0739567803 0.0000000000 + 150 0.8785275524 0.1439253187 0.0000000000 + 151 0.6330782106 0.6314963928 0.0000000000 + 152 0.7553077665 0.4923601335 0.0000000000 + 153 0.2054987581 0.8779407470 0.0000000000 + 154 0.8785275524 0.2132175384 0.0000000000 + 155 0.8166681241 0.3877899638 0.0000000000 + 156 0.6939466362 0.5969279783 0.0000000000 + 157 0.1461340900 0.9080571371 0.0000000000 + 158 0.4499785468 0.8052050773 0.0000000000 + 159 0.8780384510 0.2832214669 0.0000000000 + 160 0.5108465257 0.7706350151 0.0000000000 + 161 0.3891105682 0.8397751391 0.0000000000 + 162 0.0000000000 0.9285714286 0.0000000000 + 163 0.9285714286 0.0000000000 0.0000000000 + 164 0.5717145005 0.7360649328 0.0000000000 + 165 0.3282425891 0.8743452000 0.0000000000 + 166 0.8161726575 0.4577880342 0.0000000000 + 167 0.7548133486 0.5623559903 0.0000000000 + 168 0.6325824083 0.7014945307 0.0000000000 + 169 0.9389178239 0.1084828019 0.0000000000 + 170 0.8775329145 0.3532199938 0.0000000000 + 171 0.0892362707 0.9418515034 0.0000000000 + 172 0.9393782217 0.1785714286 0.0000000000 + 173 0.6934502934 0.6669245192 0.0000000000 + 174 0.2065066306 0.9434853229 0.0000000000 + 175 0.2583547433 0.9356372868 0.0000000000 + 176 0.9389178239 0.2486600552 0.0000000000 + 177 0.8156812462 0.5277858896 0.0000000000 + 178 0.8770401967 0.4232175552 0.0000000000 + 179 0.5103510877 0.8406332634 0.0000000000 + 180 0.4494831082 0.8752033241 0.0000000000 + 181 0.7543181403 0.6323542259 0.0000000000 + 182 0.5712190709 0.8060632062 0.0000000000 + 183 0.9384067878 0.3186595991 0.0000000000 + 184 0.6320871142 0.7714932043 0.0000000000 + 185 0.3277471506 0.9443434467 0.0000000000 + 186 1.0000000000 0.0000000000 0.0000000000 + 187 0.0000000000 1.0000000000 0.0000000000 + 188 1.0000000000 0.0714285714 0.0000000000 + 189 0.0714285714 1.0000000000 0.0000000000 + 190 0.3898979103 0.9255526687 0.0000000000 + 191 0.8765454154 0.4932157626 0.0000000000 + 192 1.0000000000 0.1428571429 0.0000000000 + 193 0.1428571429 1.0000000000 0.0000000000 + 194 0.8151859727 0.5977839324 0.0000000000 + 195 0.6929549044 0.7369227396 0.0000000000 + 196 0.9379078372 0.3886469037 0.0000000000 + 197 1.0000000000 0.2142857143 0.0000000000 + 198 0.2142857143 1.0000000000 0.0000000000 + 199 0.7538229694 0.7023524736 0.0000000000 + 200 1.0000000000 0.2857142857 0.0000000000 + 201 0.2857142857 1.0000000000 0.0000000000 + 202 0.8760533420 0.5632132129 0.0000000000 + 203 0.9374130699 0.4586451524 0.0000000000 + 204 0.5098556487 0.9106315102 0.0000000000 + 205 0.5707239399 0.8760615506 0.0000000000 + 206 0.4489876705 0.9452015708 0.0000000000 + 207 0.6315920134 0.8414914622 0.0000000000 + 208 0.8146908143 0.6677821779 0.0000000000 + 209 1.0000000000 0.3571428571 0.0000000000 + 210 0.3571428571 1.0000000000 0.0000000000 + 211 0.6924598483 0.8069211296 0.0000000000 + 212 0.9369182740 0.5286434009 0.0000000000 + 213 0.7533280008 0.7723510893 0.0000000000 + 214 0.8755588664 0.6332114152 0.0000000000 + 215 1.0000000000 0.4285714286 0.0000000000 + 216 0.4285714286 1.0000000000 0.0000000000 + 217 0.8141956465 0.7377804263 0.0000000000 + 218 0.5702281628 0.9460598503 0.0000000000 + 219 0.6310965106 0.9114897323 0.0000000000 + 220 0.9364253293 0.5986409720 0.0000000000 + 221 0.6919647133 0.8769193807 0.0000000000 + 222 1.0000000000 0.5000000000 0.0000000000 + 223 0.5000000000 1.0000000000 0.0000000000 + 224 0.8750638238 0.7032097672 0.0000000000 + 225 0.7528332282 0.8423493425 0.0000000000 + 226 0.8137008832 0.8077787070 0.0000000000 + 227 0.9359314630 0.6686389474 0.0000000000 + 228 1.0000000000 0.5714285714 0.0000000000 + 229 0.5714285714 1.0000000000 0.0000000000 + 230 0.8745686042 0.7732081323 0.0000000000 + 231 0.6914692701 0.9469177118 0.0000000000 + 232 1.0000000000 0.6428571429 0.0000000000 + 233 0.6428571429 1.0000000000 0.0000000000 + 234 0.9354363083 0.7386375863 0.0000000000 + 235 0.7517405304 0.9273912656 0.0000000000 + 236 0.8132061034 0.8777769589 0.0000000000 + 237 0.8740737271 0.8432063903 0.0000000000 + 238 1.0000000000 0.7142857143 0.0000000000 + 239 0.7142857143 1.0000000000 0.0000000000 + 240 0.9349414289 0.8086358374 0.0000000000 + 241 0.8162765415 0.9436745703 0.0000000000 + 242 0.8735789308 0.9132046269 0.0000000000 + 243 1.0000000000 0.7857142857 0.0000000000 + 244 0.7857142857 1.0000000000 0.0000000000 + 245 0.9344465927 0.8786340148 0.0000000000 + 246 1.0000000000 0.8571428571 0.0000000000 + 247 0.8571428571 1.0000000000 0.0000000000 + 248 0.9339517917 0.9486322651 0.0000000000 + 249 1.0000000000 0.9285714286 0.0000000000 + 250 0.9285714286 1.0000000000 0.0000000000 + 251 1.0000000000 1.0000000000 0.0000000000 +End Nodes + + +Begin Elements UPwSmallStrainElement2D3N + 1 1 1 3 2 + 2 1 192 197 172 + 3 1 172 197 176 + 4 1 192 172 169 + 5 1 176 197 200 + 6 1 172 176 154 + 7 1 169 172 150 + 8 1 154 176 159 + 9 1 159 176 183 + 10 1 154 159 136 + 11 1 183 176 200 + 12 1 183 200 209 + 13 1 159 183 170 + 14 1 136 159 145 + 15 1 154 136 133 + 16 1 159 170 145 + 17 1 145 170 155 + 18 1 136 145 125 + 19 1 133 136 118 + 20 1 155 170 178 + 21 1 125 145 132 + 22 1 118 136 125 + 23 1 155 178 166 + 24 1 132 145 155 + 25 1 132 155 141 + 26 1 166 178 191 + 27 1 155 166 141 + 28 1 191 178 203 + 29 1 141 166 152 + 30 1 203 178 196 + 31 1 191 203 212 + 32 1 152 166 177 + 33 1 196 178 170 + 34 1 203 196 215 + 35 1 203 215 222 + 36 1 212 203 222 + 37 1 212 222 228 + 38 1 177 166 191 + 39 1 196 170 183 + 40 1 196 183 209 + 41 1 196 209 215 + 42 1 177 191 202 + 43 1 202 191 212 + 44 1 177 202 194 + 45 1 202 212 220 + 46 1 194 202 214 + 47 1 177 194 167 + 48 1 220 212 228 + 49 1 220 228 232 + 50 1 214 202 220 + 51 1 167 194 181 + 52 1 177 167 152 + 53 1 214 220 227 + 54 1 181 194 208 + 55 1 152 167 144 + 56 1 227 220 232 + 57 1 227 232 238 + 58 1 208 194 214 + 59 1 181 208 199 + 60 1 144 167 156 + 61 1 208 214 224 + 62 1 199 208 217 + 63 1 181 199 173 + 64 1 156 167 181 + 65 1 217 208 224 + 66 1 181 173 156 + 67 1 217 224 230 + 68 1 156 173 151 + 69 1 217 230 226 + 70 1 151 173 168 + 71 1 226 230 237 + 72 1 217 226 213 + 73 1 168 173 195 + 74 1 237 230 240 + 75 1 213 226 225 + 76 1 195 173 199 + 77 1 240 230 234 + 78 1 225 226 236 + 79 1 195 199 213 + 80 1 234 230 224 + 81 1 236 226 237 + 82 1 213 199 217 + 83 1 195 213 211 + 84 1 236 237 242 + 85 1 211 213 225 + 86 1 195 211 184 + 87 1 242 237 245 + 88 1 184 211 207 + 89 1 195 184 168 + 90 1 245 237 240 + 91 1 207 211 221 + 92 1 168 184 164 + 93 1 245 240 246 + 94 1 245 246 249 + 95 1 221 211 225 + 96 1 164 184 182 + 97 1 221 225 235 + 98 1 182 184 207 + 99 1 164 182 160 + 100 1 235 225 236 + 101 1 182 207 205 + 102 1 160 182 179 + 103 1 235 236 241 + 104 1 205 207 219 + 105 1 179 182 205 + 106 1 160 179 158 + 107 1 241 236 242 + 108 1 219 207 221 + 109 1 158 179 180 + 110 1 160 158 139 + 111 1 219 221 231 + 112 1 180 179 204 + 113 1 139 158 140 + 114 1 160 139 142 + 115 1 231 221 235 + 116 1 204 179 205 + 117 1 140 158 161 + 118 1 142 139 122 + 119 1 231 235 239 + 120 1 204 205 218 + 121 1 161 158 180 + 122 1 122 139 120 + 123 1 218 205 219 + 124 1 204 218 223 + 125 1 161 180 190 + 126 1 120 139 140 + 127 1 218 219 233 + 128 1 190 180 206 + 129 1 161 190 165 + 130 1 120 140 123 + 131 1 206 180 204 + 132 1 190 216 210 + 133 1 165 190 185 + 134 1 123 140 143 + 135 1 206 204 223 + 136 1 185 190 210 + 137 1 185 210 201 + 138 1 185 201 175 + 139 1 175 201 198 + 140 1 185 175 165 + 141 1 143 140 161 + 142 1 143 161 165 + 143 1 143 165 148 + 144 1 148 165 175 + 145 1 143 148 127 + 146 1 127 148 130 + 147 1 143 127 123 + 148 1 130 148 153 + 149 1 123 127 107 + 150 1 153 148 175 + 151 1 130 153 135 + 152 1 107 127 111 + 153 1 123 107 105 + 154 1 135 153 157 + 155 1 130 135 115 + 156 1 111 127 130 + 157 1 157 153 174 + 158 1 130 115 111 + 159 1 174 153 175 + 160 1 174 175 198 + 161 1 174 198 193 + 162 1 157 174 193 + 163 1 111 115 96 + 164 1 96 115 102 + 165 1 111 96 93 + 166 1 102 115 124 + 167 1 93 96 81 + 168 1 111 93 107 + 169 1 124 115 135 + 170 1 81 96 85 + 171 1 107 93 89 + 172 1 85 96 102 + 173 1 89 93 76 + 174 1 107 89 105 + 175 1 76 93 81 + 176 1 89 76 72 + 177 1 105 89 87 + 178 1 72 76 61 + 179 1 89 72 87 + 180 1 61 76 65 + 181 1 87 72 71 + 182 1 65 76 81 + 183 1 61 65 51 + 184 1 71 72 59 + 185 1 51 65 55 + 186 1 61 51 47 + 187 1 59 72 61 + 188 1 55 65 69 + 189 1 47 51 39 + 190 1 59 61 47 + 191 1 69 65 81 + 192 1 39 51 42 + 193 1 69 81 85 + 194 1 42 51 55 + 195 1 39 42 31 + 196 1 69 85 80 + 197 1 42 55 49 + 198 1 31 42 36 + 199 1 124 135 146 + 200 1 146 135 157 + 201 1 124 146 138 + 202 1 146 157 171 + 203 1 171 157 193 + 204 1 146 171 162 + 205 1 47 39 37 + 206 1 37 39 29 + 207 1 47 37 46 + 208 1 29 39 31 + 209 1 37 29 28 + 210 1 46 37 38 + 211 1 29 31 22 + 212 1 37 28 38 + 213 1 22 31 26 + 214 1 38 28 30 + 215 1 30 28 21 + 216 1 38 30 41 + 217 1 21 28 20 + 218 1 30 21 23 + 219 1 41 30 33 + 220 1 20 28 29 + 221 1 23 21 15 + 222 1 33 30 23 + 223 1 20 29 22 + 224 1 15 21 13 + 225 1 20 22 14 + 226 1 13 21 20 + 227 1 15 13 9 + 228 1 14 22 18 + 229 1 13 20 14 + 230 1 9 13 8 + 231 1 13 14 8 + 232 1 9 8 4 + 233 1 8 14 11 + 234 1 4 8 6 + 235 1 9 4 7 + 236 1 7 4 3 + 237 1 9 7 12 + 238 1 12 7 10 + 239 1 9 12 15 + 240 1 15 12 19 + 241 1 19 12 16 + 242 1 15 19 23 + 243 1 16 12 10 + 244 1 19 16 24 + 245 1 23 19 27 + 246 1 24 16 25 + 247 1 27 19 24 + 248 1 23 27 33 + 249 1 27 24 34 + 250 1 33 27 40 + 251 1 34 24 32 + 252 1 40 27 34 + 253 1 33 40 44 + 254 1 32 24 25 + 255 1 40 34 45 + 256 1 44 40 52 + 257 1 45 34 43 + 258 1 40 45 52 + 259 1 43 34 32 + 260 1 52 45 58 + 261 1 43 32 35 + 262 1 58 45 56 + 263 1 52 58 67 + 264 1 56 45 43 + 265 1 58 56 70 + 266 1 67 58 74 + 267 1 56 43 53 + 268 1 70 56 66 + 269 1 74 58 70 + 270 1 53 43 35 + 271 1 66 56 53 + 272 1 66 53 62 + 273 1 47 46 59 + 274 1 59 46 60 + 275 1 60 46 50 + 276 1 59 60 71 + 277 1 50 46 38 + 278 1 60 50 64 + 279 1 71 60 75 + 280 1 50 38 41 + 281 1 64 50 54 + 282 1 75 60 64 + 283 1 54 50 41 + 284 1 64 54 68 + 285 1 54 41 44 + 286 1 68 54 57 + 287 1 44 41 33 + 288 1 54 44 57 + 289 1 57 44 52 + 290 1 57 52 67 + 291 1 57 67 73 + 292 1 73 67 83 + 293 1 57 73 68 + 294 1 83 67 74 + 295 1 68 73 84 + 296 1 83 74 92 + 297 1 84 73 90 + 298 1 68 84 78 + 299 1 92 74 86 + 300 1 90 73 83 + 301 1 78 84 95 + 302 1 86 74 70 + 303 1 90 83 100 + 304 1 95 84 101 + 305 1 86 70 82 + 306 1 100 83 92 + 307 1 101 84 90 + 308 1 82 70 66 + 309 1 101 90 110 + 310 1 82 66 77 + 311 1 110 90 100 + 312 1 101 110 121 + 313 1 77 66 62 + 314 1 110 100 119 + 315 1 121 110 131 + 316 1 119 100 112 + 317 1 110 119 131 + 318 1 112 100 92 + 319 1 131 119 141 + 320 1 112 92 103 + 321 1 141 119 132 + 322 1 131 141 152 + 323 1 103 92 86 + 324 1 132 119 112 + 325 1 103 86 99 + 326 1 132 112 125 + 327 1 99 86 82 + 328 1 125 112 103 + 329 1 99 82 94 + 330 1 94 82 77 + 331 1 99 94 113 + 332 1 113 94 109 + 333 1 99 113 118 + 334 1 109 94 97 + 335 1 99 118 103 + 336 1 103 118 125 + 337 1 71 75 88 + 338 1 88 75 91 + 339 1 71 88 87 + 340 1 91 75 78 + 341 1 88 91 106 + 342 1 87 88 104 + 343 1 78 75 64 + 344 1 106 91 108 + 345 1 104 88 106 + 346 1 108 91 95 + 347 1 106 108 126 + 348 1 95 91 78 + 349 1 108 95 114 + 350 1 126 108 129 + 351 1 114 95 101 + 352 1 108 114 129 + 353 1 114 101 121 + 354 1 129 114 134 + 355 1 114 121 134 + 356 1 129 134 151 + 357 1 134 121 144 + 358 1 151 134 156 + 359 1 129 151 147 + 360 1 144 121 131 + 361 1 156 134 144 + 362 1 147 151 168 + 363 1 147 168 164 + 364 1 147 164 142 + 365 1 142 164 160 + 366 1 147 142 126 + 367 1 126 142 122 + 368 1 147 126 129 + 369 1 87 104 105 + 370 1 105 104 120 + 371 1 120 104 122 + 372 1 105 120 123 + 373 1 122 104 106 + 374 1 122 106 126 + 375 1 144 131 152 + 376 1 224 214 227 + 377 1 224 227 234 + 378 1 234 227 238 + 379 1 234 238 243 + 380 1 240 234 243 + 381 1 240 243 246 + 382 1 242 245 248 + 383 1 248 245 249 + 384 1 248 249 251 + 385 1 242 248 247 + 386 1 102 124 117 + 387 1 113 109 128 + 388 1 128 109 116 + 389 1 113 128 133 + 390 1 133 128 150 + 391 1 133 150 154 + 392 1 154 150 172 + 393 1 150 128 149 + 394 1 149 128 137 + 395 1 150 149 169 + 396 1 169 149 163 + 397 1 113 133 118 + 398 1 235 241 244 + 399 1 244 241 247 + 400 1 247 241 242 + 401 1 68 78 64 + 402 1 94 77 97 + 403 1 55 69 63 + 404 1 219 231 233 + 405 1 85 102 98 + 406 1 192 169 188 + 407 1 239 233 231 + 408 1 239 235 244 + 409 1 63 49 55 + 410 1 62 79 77 + 411 1 193 189 171 + 412 1 171 189 162 + 413 1 17 25 16 + 414 1 17 16 10 + 415 1 216 190 206 + 416 1 216 206 223 + 417 1 18 11 14 + 418 1 137 163 149 + 419 1 251 250 248 + 420 1 248 250 247 + 421 1 138 117 124 + 422 1 5 10 7 + 423 1 5 7 3 + 424 1 229 223 218 + 425 1 229 218 233 + 426 1 36 26 31 + 427 1 97 116 109 + 428 1 187 162 189 + 429 1 35 48 53 + 430 1 6 2 4 + 431 1 186 188 163 + 432 1 98 80 85 + 433 1 49 36 42 + 434 1 79 97 77 + 435 1 25 35 32 + 436 1 11 6 8 + 437 1 117 98 102 + 438 1 26 18 22 + 439 1 116 137 128 + 440 1 162 138 146 + 441 1 48 62 53 + 442 1 80 63 69 + 443 1 188 169 163 + 444 1 4 2 3 +End Elements + + + +Begin SubModelPart Soil_drained-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-1 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 6 + 11 + 18 + 26 + 36 + 49 + 63 + 80 + 98 + 117 + 138 + 162 + 186 + 187 + 188 + 192 + 197 + 200 + 209 + 215 + 222 + 228 + 232 + 238 + 243 + 246 + 249 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-2 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 3 + 5 + 10 + 17 + 25 + 35 + 48 + 62 + 79 + 97 + 116 + 137 + 163 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Solid_Displacement-auto-3 + Begin SubModelPartTables + End SubModelPartTables + Begin SubModelPartNodes + 1 + 186 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + +Begin SubModelPart Fluid_Pressure-auto-1 + Begin SubModelPartTables + 1 + 2 + End SubModelPartTables + Begin SubModelPartNodes + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + End SubModelPartNodes + Begin SubModelPartElements + End SubModelPartElements + Begin SubModelPartConditions + End SubModelPartConditions +End SubModelPart + diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json index 0a992e40043d..82e4d6b94fff 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json @@ -151,7 +151,7 @@ "variable_name": "WATER_PRESSURE", "is_fixed": true, "value": 0.0, - "table": [0, 0], + "table": [0, 0, 0], "fluid_pressure_type": "Phreatic_Multi_Line", "gravity_direction": 1, "out_of_plane_direction": 2, diff --git a/applications/GeoMechanicsApplication/tests/test_water_pressure.py b/applications/GeoMechanicsApplication/tests/test_water_pressure.py index 7add7ea33071..b5d27d192349 100644 --- a/applications/GeoMechanicsApplication/tests/test_water_pressure.py +++ b/applications/GeoMechanicsApplication/tests/test_water_pressure.py @@ -3,6 +3,7 @@ import KratosMultiphysics.KratosUnittest as KratosUnittest import test_helper +import numpy as np class KratosGeoMechanicsWaterPressureTests(KratosUnittest.TestCase): @@ -18,50 +19,91 @@ def tearDown(self): # Code here will be placed AFTER every test in this TestCase. pass - # def test_inclined_phreatic_line(self): - # """ - # test hydrostatic water pressure under an inclided phreatic line ranging over the width of the geometry + def test_inclined_phreatic_line(self): + """ + test hydrostatic water pressure under an inclided phreatic line ranging over the width of the geometry - # :return: - # """ - # test_name = 'test_inclinded_phreatic_line' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) + :return: + """ + test_name = 'test_inclinded_phreatic_line' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) - # water_pressure = test_helper.get_water_pressure(simulation) + water_pressure = test_helper.get_water_pressure(simulation) - # p_bot_left = water_pressure[0] - # p_bot_middle = water_pressure[47] - # p_bot_right = water_pressure[185] + p_bot_left = water_pressure[0] + p_bot_middle = water_pressure[47] + p_bot_right = water_pressure[185] - # p_top_left = water_pressure[186] - # p_top_middle = water_pressure[222] - # p_top_right = water_pressure[250] + p_top_left = water_pressure[186] + p_top_middle = water_pressure[222] + p_top_right = water_pressure[250] - # self.assertAlmostEqual(-10000, p_bot_left) - # self.assertAlmostEqual(-7500, p_bot_middle) - # self.assertAlmostEqual(-5000, p_bot_right) + self.assertAlmostEqual(-10000, p_bot_left) + self.assertAlmostEqual(-7500, p_bot_middle) + self.assertAlmostEqual(-5000, p_bot_right) - # self.assertAlmostEqual(0, p_top_left) - # self.assertAlmostEqual(0, p_top_middle) - # self.assertAlmostEqual(0, p_top_right) + self.assertAlmostEqual(0, p_top_left) + self.assertAlmostEqual(0, p_top_middle) + self.assertAlmostEqual(0, p_top_right) + def test_inclined_phreatic_line_time(self): """ test hydrostatic water pressure under an inclided phreatic line ranging over the width of the geometry :return: """ - test_name = 'test_inclinded_phreatic_multi_line_time_dependent' + test_name = 'test_inclinded_phreatic_line_time_dependent' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) simulation = test_helper.run_kratos(file_path) res_path = os.path.join(file_path, test_name + '.post.res') water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') + + # Time = 0.25 + + # Bottom Row + self.assertAlmostEqual(-6250, water_pressures[0.25][1]) + self.assertAlmostEqual(-3125, water_pressures[0.25][48]) + self.assertAlmostEqual(0, water_pressures[0.25][186]) - print(water_pressure.keys()) + # Top Row + self.assertAlmostEqual(0, water_pressures[0.25][187]) + self.assertAlmostEqual(0, water_pressures[0.25][223]) + self.assertAlmostEqual(0, water_pressures[0.25][251]) + # Time = 0.75 + self.assertAlmostEqual(-8750, water_pressures[0.75][1]) + self.assertAlmostEqual(-4375, water_pressures[0.75][48]) + self.assertAlmostEqual(0, water_pressures[0.75][186]) + + self.assertAlmostEqual(0, water_pressures[0.75][187]) + self.assertAlmostEqual(0, water_pressures[0.75][223]) + self.assertAlmostEqual(0, water_pressures[0.75][251]) + + # Time = 1.0 + self.assertAlmostEqual(-10000, water_pressures[1.0][1]) + self.assertAlmostEqual(-5000, water_pressures[1.0][48]) + self.assertAlmostEqual(0, water_pressures[1.0][186]) + + self.assertAlmostEqual(0, water_pressures[1.0][187]) + self.assertAlmostEqual(0, water_pressures[1.0][223]) + self.assertAlmostEqual(0, water_pressures[1.0][251]) + + def test_phreatic_multi_line_2_points(self): + """ + test hydrostatic water pressure under a phreatic multi line ranging over the width of the geometry + (Same as test_inclined_phreatic_line) + :return: + """ + test_name = 'test_inclined_phreatic_multi_line' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + water_pressure = test_helper.get_water_pressure(simulation) + p_bot_left = water_pressure[0] p_bot_middle = water_pressure[47] p_bot_right = water_pressure[185] @@ -77,292 +119,348 @@ def test_inclined_phreatic_line_time(self): self.assertAlmostEqual(0, p_top_left) self.assertAlmostEqual(0, p_top_middle) self.assertAlmostEqual(0, p_top_right) + + def test_phreatic_multi_line_3_points(self): + """ + test hydrostatic water pressure under a phreatic multi line ranging over the width of the geometry + (Same as test_inclined_phreatic_line) + :return: + """ + test_name = 'test_inclined_phreatic_multi_line_3_points' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + water_pressure = test_helper.get_water_pressure(simulation) + + p_bot_left = water_pressure[0] + p_bot_middle = water_pressure[47] + p_bot_right = water_pressure[185] + + p_top_left = water_pressure[186] + p_top_middle = water_pressure[222] + p_top_right = water_pressure[250] + + self.assertAlmostEqual(-10000, p_bot_left) + self.assertAlmostEqual(-9000, p_bot_middle) + self.assertAlmostEqual(-5000, p_bot_right) + + self.assertAlmostEqual(0, p_top_left) + self.assertAlmostEqual(0, p_top_middle) + self.assertAlmostEqual(0, p_top_right) - # def test_phreatic_multi_line_2_points(self): - # """ - # test hydrostatic water pressure under a phreatic multi line ranging over the width of the geometry - # (Same as test_inclined_phreatic_line) - # :return: - # """ - # test_name = 'test_inclined_phreatic_multi_line' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # water_pressure = test_helper.get_water_pressure(simulation) - - # p_bot_left = water_pressure[0] - # p_bot_middle = water_pressure[47] - # p_bot_right = water_pressure[185] - - # p_top_left = water_pressure[186] - # p_top_middle = water_pressure[222] - # p_top_right = water_pressure[250] - - # self.assertAlmostEqual(-10000, p_bot_left) - # self.assertAlmostEqual(-7500, p_bot_middle) - # self.assertAlmostEqual(-5000, p_bot_right) - - # self.assertAlmostEqual(0, p_top_left) - # self.assertAlmostEqual(0, p_top_middle) - # self.assertAlmostEqual(0, p_top_right) - - # def test_phreatic_multi_line_3_points(self): - # """ - # test hydrostatic water pressure under a phreatic multi line ranging over the width of the geometry - # (Same as test_inclined_phreatic_line) - # :return: - # """ - # test_name = 'test_inclined_phreatic_multi_line_3_points' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # water_pressure = test_helper.get_water_pressure(simulation) - - # p_bot_left = water_pressure[0] - # p_bot_middle = water_pressure[47] - # p_bot_right = water_pressure[185] - - # p_top_left = water_pressure[186] - # p_top_middle = water_pressure[222] - # p_top_right = water_pressure[250] - - # self.assertAlmostEqual(-10000, p_bot_left) - # self.assertAlmostEqual(-9000, p_bot_middle) - # self.assertAlmostEqual(-5000, p_bot_right) - - # self.assertAlmostEqual(0, p_top_left) - # self.assertAlmostEqual(0, p_top_middle) - # self.assertAlmostEqual(0, p_top_right) - - # def test_inclinded_phreatic_line_smaller_line(self): - # """ - # test hydrostatic water pressure under an inclided phreatic line ranging over a part of the geometry - - # :return: - # """ - # test_name = 'test_inclinded_phreatic_line_smaller_line' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # # Get water pressure in all the nodes - # water_pressure = test_helper.get_water_pressure(simulation) - - # # get node information of the bottom nodes in the geometry - # bottom_n_nbrs = [0, 2, 4, 9, 16, 24, 34, 47, 61, 78, 96, 115, 136, 162, 185] - # x_coords_boundary_nodes = [i / 14 for i in range(15)] - - # # Set turning points of the phreatic line - # head_values = [1, 1, 0.5, 0.5] - # head_x_coords = [0, 0.3, 0.7, 1] - - # # Analytically calculate water pressure at the bottom of the geometry - # dhdx = (head_values[2] - head_values[1]) / (head_x_coords[2] - head_x_coords[1]) - # gamma_w = 10000 - - # p_bottom_analytic = [-head_values[1] * gamma_w if x <= head_x_coords[1] - # else -head_values[2] * gamma_w if x >= head_x_coords[2] - # else -(dhdx * (x - head_x_coords[1]) + head_values[1]) * gamma_w - # for x in x_coords_boundary_nodes] - - # # assert - # for idx, node_nr in enumerate(bottom_n_nbrs): - # self.assertAlmostEqual(p_bottom_analytic[idx], water_pressure[node_nr], delta=1e-6) - - # @KratosUnittest.skip("unit test not implemented") - # def test_interpolate_water_pressure(self): - # pass - - # def test_interpolate_water_pressure_inclined(self): - # """ - # Test interpolate water pressure with an inclined phreatic line. - # The geometry consists out of 3 blocks. On the top block, an inclined phreatic line is defined. On the bottom - # block, 100 pressure is defined. The water pressure in the middle block is interpolated between the water pressure - # in the top and bottom block - # :return: - # """ - - # test_name = 'interpolate_line_2' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # water_pressure = test_helper.get_water_pressure(simulation) - - # # Node numbers of the left and right boundary of the middle block - # middle_left_n_nbrs = [181, 155, 134, 110, 92, 75, 59, 45] - # middle_right_n_nbrs = [301, 287, 274, 260, 249, 235, 227, 217] - - # # Pore pressures at the corners of the middle block - # p_top_middle_left = -10000 - # p_bot_middle_left = -100 - - # p_top_middle_right = -5000 - # p_bot_middle_tight = -100 - - # # Vertical coordinates of the left and right boundary nodes of the middle block - # vert_coord_bound_mid = [-i / 7 * 0.5 + 1.0 for i in range(8)] - - # # Analytically calculate pore pressure along left and right boundary of the middle block - # dpdy_left = (p_top_middle_left - p_bot_middle_left) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) - # dpdy_right = (p_top_middle_right - p_bot_middle_tight) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) - - # p_middle_left_analytic = [(dpdy_left * (y - vert_coord_bound_mid[0]) + p_top_middle_left) - # for y in vert_coord_bound_mid] - - # p_middle_right_analytic = [(dpdy_right * (y - vert_coord_bound_mid[0]) + p_top_middle_right) - # for y in vert_coord_bound_mid] - - # # Assert - # for idx, node_nr in enumerate(middle_left_n_nbrs): - # self.assertAlmostEqual(p_middle_left_analytic[idx], water_pressure[node_nr], delta=1e-6) - - # for idx, node_nr in enumerate(middle_right_n_nbrs): - # self.assertAlmostEqual(p_middle_right_analytic[idx], water_pressure[node_nr], delta=1e-6) - - # @KratosUnittest.skip("check if test is correct") - # def test_normal_load_triangle_3n_fic(self): - # test_name = 'test_normal_load_triangle_3n_fic' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # n_dim = 2 - # self.assert_linear_elastic_saturated_block(simulation, n_dim) - - # def test_normal_load_triangle_6n(self): - # test_name = 'test_normal_load_triangle_6n' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # n_dim = 2 - # self.assert_linear_elastic_saturated_block(simulation, n_dim) - - # def test_normal_load_quad_8n(self): - # test_name = 'test_normal_load_quad_8n' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # n_dim = 2 - # self.assert_linear_elastic_saturated_block(simulation, n_dim) - - # def test_normal_load_tetra_10n(self): - # test_name = 'test_normal_load_tetra_10n' - # file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - # simulation = test_helper.run_kratos(file_path) - - # n_dim = 3 - # self.assert_linear_elastic_saturated_block(simulation, n_dim) - - # def assert_linear_elastic_saturated_block(self, simulation, n_dim): - # """ - # Assert results of a linear elastic fully saturated block. The sides of the block can move freely in vertical - # direction and are fixed in horizontal direction. The bottom of the block is fixed. On top of the block, a - # hydrostatic water load is applied with a hydraulic head 1 meter above the top of the soil placed. Results are: - # total stresses, effective stresses, displacements, green langrange strains and water pressure. - - # :param simulation: Kratos simulation - # :param top_node_nbrs: node numbers of the nodes at the top of the geometry - # :param n_dim: number of dimensions - # :return: - # """ - # # get total stresses - # total_stresses = test_helper.get_total_stress_tensor(simulation) - # total_stresses_xx = [integration_point[0,0] for element in total_stresses for integration_point in element] - - # if n_dim >= 2: - # total_stresses_yy = [integration_point[1,1] for element in total_stresses for integration_point in element] - # if n_dim >= 3: - # total_stresses_zz = [integration_point[2,2] for element in total_stresses for integration_point in element] - - # # get effective stresses - # efective_stresses = test_helper.get_cauchy_stress_tensor(simulation) - # efective_stresses_xx = [integration_point[0,0] for element in efective_stresses for integration_point in element] - # if n_dim >= 2: - # efective_stresses_yy = [integration_point[1,1] for element in efective_stresses - # for integration_point in element] - # if n_dim >= 3: - # efective_stresses_zz = [integration_point[2,2] for element in efective_stresses - # for integration_point in element] - - # # get strains - # green_lagrange_strains = test_helper.get_green_lagrange_strain_tensor(simulation) - # green_lagrange_strains_xx = [integration_point[0,0] for element in green_lagrange_strains for integration_point in - # element] - # if n_dim >= 2: - # green_lagrange_strains_yy = [integration_point[1,1] for element in green_lagrange_strains - # for integration_point in element] - # if n_dim >= 3: - # green_lagrange_strains_zz = [integration_point[2,2] for element in green_lagrange_strains - # for integration_point in element] - - # # get displacements - # displacements = test_helper.get_displacement(simulation) - # x_displacements = [displacement[0] for displacement in displacements] - # if n_dim >= 2: - # y_displacements = [displacement[1] for displacement in displacements] - # if n_dim >= 3: - # z_displacements = [displacement[2] for displacement in displacements] - - # # get water pressures - # water_pressures = test_helper.get_water_pressure(simulation) - - # # get coordinates - # nodal_coordinates = test_helper.get_nodal_coordinates(simulation) - # gauss_coordinates = test_helper.get_gauss_coordinates(simulation) - - # # get the coordinates of all gauss points in a list - # gauss_coordinates_x = [integration_point[0] for element in gauss_coordinates for integration_point in - # element] - # if n_dim >= 2: - # gauss_coordinates_y = [integration_point[1] for element in gauss_coordinates for integration_point in - # element] - # if n_dim >= 3: - # gauss_coordinates_z = [integration_point[2] for element in gauss_coordinates for integration_point in - # element] - - # # Calculate expected values - # expected_water_pressure = [coord[1] * 1e4 - 2e4 for coord in nodal_coordinates] - # #todo correct this - # expected_displacements_y = [coord[1] * 0.0001667 for coord in nodal_coordinates] - - # expected_total_stress_xx = [gauss_coordinate_y * 1e4 - 2e4 for gauss_coordinate_y in gauss_coordinates_y] - # if n_dim >= 2: - # expected_eff_stress_yy = [(1 - gauss_coordinate_y) * 1e4 for gauss_coordinate_y in gauss_coordinates_y] - # expected_strain_yy = [(1-gauss_coordinate_y) * 0.00033333 for gauss_coordinate_y in gauss_coordinates_y] - # if n_dim >= 3: - # expected_total_stress_zz = expected_total_stress_xx - - # # Assert integration point information - # for idx, total_stress_xx in enumerate(total_stresses_xx): - # self.assertAlmostEqual(expected_total_stress_xx[idx], total_stress_xx, 4) - # if n_dim >= 2: - # self.assertAlmostEqual(-1e4, total_stresses_yy[idx], 1) - # if n_dim >= 3: - # self.assertAlmostEqual(expected_total_stress_zz[idx], total_stresses_zz[idx], 4) + + def test_inclined_phreatic_multi_line_time_centre(self): + """ + test hydrostatic water pressure under an inclided phreatic multi line ranging over the width of the geometry - # self.assertAlmostEqual(0.0, efective_stresses_xx[idx], 4) - # if n_dim >= 2: - # self.assertAlmostEqual(expected_eff_stress_yy[idx], efective_stresses_yy[idx],4) - # if n_dim >= 3: - # self.assertAlmostEqual(0.0, efective_stresses_zz[idx], 4) + :return: + """ + test_name = 'test_inclinded_phreatic_multi_line_time_dependent_centre' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) - # self.assertAlmostEqual(0.0, green_lagrange_strains_xx[idx]) + res_path = os.path.join(file_path, test_name + '.post.res') + + water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') + + times = [x * 0.25 for x in range(1,16)] + dHeadCentre = [0.5, -0.5, -0.5, 0.5] + for ind, time in enumerate(times): + + # Central Head + dHeadInd = int(ind/4) # slope + if dHeadInd == 0: + lastHead = -5000 + else: + lastHead = (sum(dHeadCentre[0:dHeadInd]) * -10000) - 5000 + expectedBottomCentreHead = lastHead - (dHeadCentre[dHeadInd] * 10000) * (time - (4 * dHeadInd * 0.25)) + + + # Bottom Row + self.assertAlmostEqual(-5000, water_pressures[time][1]) + self.assertAlmostEqual(expectedBottomCentreHead, water_pressures[time][48]) + self.assertAlmostEqual(-5000, water_pressures[time][186]) + + # Top Row + self.assertAlmostEqual(0, water_pressures[time][187]) + self.assertAlmostEqual(0, water_pressures[time][223]) + self.assertAlmostEqual(0, water_pressures[time][251]) + + + def test_inclined_phreatic_multi_line_time_edge(self): + """ + test hydrostatic water pressure under an inclided phreatic multi line ranging over the width of the geometry + + :return: + """ + test_name = 'test_inclinded_phreatic_multi_line_time_dependent_edges' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + res_path = os.path.join(file_path, test_name + '.post.res') + + water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') + + times = [x * 0.25 for x in range(1,16)] + dHeadLeft = [0.5, -0.5, -0.5, 0.5] + dHeadRight = [0.25, -0.25, -0.25, 0.25] + for ind, time in enumerate(times): + + dHeadInd = int(ind/4) # slope + + # Left Head + if dHeadInd == 0: + lastHead = -5000 + else: + lastHead = (sum(dHeadLeft[0:dHeadInd]) * -10000) - 5000 + expectedBottomLeftHead = lastHead - (dHeadLeft[dHeadInd] * 10000) * (time - (4 * dHeadInd * 0.25)) + + # Left Head + if dHeadInd == 0: + lastHead = -5000 + else: + lastHead = (sum(dHeadRight[0:dHeadInd]) * -10000) - 5000 + expectedBottomRightHead = lastHead - (dHeadRight[dHeadInd] * 10000) * (time - (4 * dHeadInd * 0.25)) + + # Bottom Row + self.assertAlmostEqual(expectedBottomLeftHead, water_pressures[time][1]) + self.assertAlmostEqual(-5000, water_pressures[time][48]) + self.assertAlmostEqual(expectedBottomRightHead, water_pressures[time][186]) + + # Top Row + self.assertAlmostEqual(0, water_pressures[time][187]) + self.assertAlmostEqual(0, water_pressures[time][223]) + self.assertAlmostEqual(0, water_pressures[time][251]) + + def test_inclinded_phreatic_line_smaller_line(self): + """ + test hydrostatic water pressure under an inclided phreatic line ranging over a part of the geometry + + :return: + """ + test_name = 'test_inclinded_phreatic_line_smaller_line' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + # Get water pressure in all the nodes + water_pressure = test_helper.get_water_pressure(simulation) + + # get node information of the bottom nodes in the geometry + bottom_n_nbrs = [0, 2, 4, 9, 16, 24, 34, 47, 61, 78, 96, 115, 136, 162, 185] + x_coords_boundary_nodes = [i / 14 for i in range(15)] + + # Set turning points of the phreatic line + head_values = [1, 1, 0.5, 0.5] + head_x_coords = [0, 0.3, 0.7, 1] + + # Analytically calculate water pressure at the bottom of the geometry + dhdx = (head_values[2] - head_values[1]) / (head_x_coords[2] - head_x_coords[1]) + gamma_w = 10000 + + p_bottom_analytic = [-head_values[1] * gamma_w if x <= head_x_coords[1] + else -head_values[2] * gamma_w if x >= head_x_coords[2] + else -(dhdx * (x - head_x_coords[1]) + head_values[1]) * gamma_w + for x in x_coords_boundary_nodes] + + # assert + for idx, node_nr in enumerate(bottom_n_nbrs): + self.assertAlmostEqual(p_bottom_analytic[idx], water_pressure[node_nr], delta=1e-6) + + @KratosUnittest.skip("unit test not implemented") + def test_interpolate_water_pressure(self): + pass + + def test_interpolate_water_pressure_inclined(self): + """ + Test interpolate water pressure with an inclined phreatic line. + The geometry consists out of 3 blocks. On the top block, an inclined phreatic line is defined. On the bottom + block, 100 pressure is defined. The water pressure in the middle block is interpolated between the water pressure + in the top and bottom block + :return: + """ + + test_name = 'interpolate_line_2' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + water_pressure = test_helper.get_water_pressure(simulation) + + # Node numbers of the left and right boundary of the middle block + middle_left_n_nbrs = [181, 155, 134, 110, 92, 75, 59, 45] + middle_right_n_nbrs = [301, 287, 274, 260, 249, 235, 227, 217] + + # Pore pressures at the corners of the middle block + p_top_middle_left = -10000 + p_bot_middle_left = -100 + + p_top_middle_right = -5000 + p_bot_middle_tight = -100 + + # Vertical coordinates of the left and right boundary nodes of the middle block + vert_coord_bound_mid = [-i / 7 * 0.5 + 1.0 for i in range(8)] + + # Analytically calculate pore pressure along left and right boundary of the middle block + dpdy_left = (p_top_middle_left - p_bot_middle_left) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) + dpdy_right = (p_top_middle_right - p_bot_middle_tight) / (vert_coord_bound_mid[0] - vert_coord_bound_mid[-1]) + + p_middle_left_analytic = [(dpdy_left * (y - vert_coord_bound_mid[0]) + p_top_middle_left) + for y in vert_coord_bound_mid] + + p_middle_right_analytic = [(dpdy_right * (y - vert_coord_bound_mid[0]) + p_top_middle_right) + for y in vert_coord_bound_mid] + + # Assert + for idx, node_nr in enumerate(middle_left_n_nbrs): + self.assertAlmostEqual(p_middle_left_analytic[idx], water_pressure[node_nr], delta=1e-6) + + for idx, node_nr in enumerate(middle_right_n_nbrs): + self.assertAlmostEqual(p_middle_right_analytic[idx], water_pressure[node_nr], delta=1e-6) + + @KratosUnittest.skip("check if test is correct") + def test_normal_load_triangle_3n_fic(self): + test_name = 'test_normal_load_triangle_3n_fic' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + n_dim = 2 + self.assert_linear_elastic_saturated_block(simulation, n_dim) + + def test_normal_load_triangle_6n(self): + test_name = 'test_normal_load_triangle_6n' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + n_dim = 2 + self.assert_linear_elastic_saturated_block(simulation, n_dim) + + def test_normal_load_quad_8n(self): + test_name = 'test_normal_load_quad_8n' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + n_dim = 2 + self.assert_linear_elastic_saturated_block(simulation, n_dim) + + def test_normal_load_tetra_10n(self): + test_name = 'test_normal_load_tetra_10n' + file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) + simulation = test_helper.run_kratos(file_path) + + n_dim = 3 + self.assert_linear_elastic_saturated_block(simulation, n_dim) + + def assert_linear_elastic_saturated_block(self, simulation, n_dim): + """ + Assert results of a linear elastic fully saturated block. The sides of the block can move freely in vertical + direction and are fixed in horizontal direction. The bottom of the block is fixed. On top of the block, a + hydrostatic water load is applied with a hydraulic head 1 meter above the top of the soil placed. Results are: + total stresses, effective stresses, displacements, green langrange strains and water pressure. + + :param simulation: Kratos simulation + :param top_node_nbrs: node numbers of the nodes at the top of the geometry + :param n_dim: number of dimensions + :return: + """ + # get total stresses + total_stresses = test_helper.get_total_stress_tensor(simulation) + total_stresses_xx = [integration_point[0,0] for element in total_stresses for integration_point in element] + + if n_dim >= 2: + total_stresses_yy = [integration_point[1,1] for element in total_stresses for integration_point in element] + if n_dim >= 3: + total_stresses_zz = [integration_point[2,2] for element in total_stresses for integration_point in element] + + # get effective stresses + efective_stresses = test_helper.get_cauchy_stress_tensor(simulation) + efective_stresses_xx = [integration_point[0,0] for element in efective_stresses for integration_point in element] + if n_dim >= 2: + efective_stresses_yy = [integration_point[1,1] for element in efective_stresses + for integration_point in element] + if n_dim >= 3: + efective_stresses_zz = [integration_point[2,2] for element in efective_stresses + for integration_point in element] + + # get strains + green_lagrange_strains = test_helper.get_green_lagrange_strain_tensor(simulation) + green_lagrange_strains_xx = [integration_point[0,0] for element in green_lagrange_strains for integration_point in + element] + if n_dim >= 2: + green_lagrange_strains_yy = [integration_point[1,1] for element in green_lagrange_strains + for integration_point in element] + if n_dim >= 3: + green_lagrange_strains_zz = [integration_point[2,2] for element in green_lagrange_strains + for integration_point in element] + + # get displacements + displacements = test_helper.get_displacement(simulation) + x_displacements = [displacement[0] for displacement in displacements] + if n_dim >= 2: + y_displacements = [displacement[1] for displacement in displacements] + if n_dim >= 3: + z_displacements = [displacement[2] for displacement in displacements] + + # get water pressures + water_pressures = test_helper.get_water_pressure(simulation) + + # get coordinates + nodal_coordinates = test_helper.get_nodal_coordinates(simulation) + gauss_coordinates = test_helper.get_gauss_coordinates(simulation) + + # get the coordinates of all gauss points in a list + gauss_coordinates_x = [integration_point[0] for element in gauss_coordinates for integration_point in + element] + if n_dim >= 2: + gauss_coordinates_y = [integration_point[1] for element in gauss_coordinates for integration_point in + element] + if n_dim >= 3: + gauss_coordinates_z = [integration_point[2] for element in gauss_coordinates for integration_point in + element] + + # Calculate expected values + expected_water_pressure = [coord[1] * 1e4 - 2e4 for coord in nodal_coordinates] + #todo correct this + expected_displacements_y = [coord[1] * 0.0001667 for coord in nodal_coordinates] + + expected_total_stress_xx = [gauss_coordinate_y * 1e4 - 2e4 for gauss_coordinate_y in gauss_coordinates_y] + if n_dim >= 2: + expected_eff_stress_yy = [(1 - gauss_coordinate_y) * 1e4 for gauss_coordinate_y in gauss_coordinates_y] + expected_strain_yy = [(1-gauss_coordinate_y) * 0.00033333 for gauss_coordinate_y in gauss_coordinates_y] + if n_dim >= 3: + expected_total_stress_zz = expected_total_stress_xx + + # Assert integration point information + for idx, total_stress_xx in enumerate(total_stresses_xx): + self.assertAlmostEqual(expected_total_stress_xx[idx], total_stress_xx, 4) + if n_dim >= 2: + self.assertAlmostEqual(-1e4, total_stresses_yy[idx], 1) + if n_dim >= 3: + self.assertAlmostEqual(expected_total_stress_zz[idx], total_stresses_zz[idx], 4) + + self.assertAlmostEqual(0.0, efective_stresses_xx[idx], 4) + if n_dim >= 2: + self.assertAlmostEqual(expected_eff_stress_yy[idx], efective_stresses_yy[idx],4) + if n_dim >= 3: + self.assertAlmostEqual(0.0, efective_stresses_zz[idx], 4) + + self.assertAlmostEqual(0.0, green_lagrange_strains_xx[idx]) + if n_dim >= 2: + self.assertAlmostEqual(expected_strain_yy[idx], green_lagrange_strains_yy[idx]) + if n_dim >= 3: + self.assertAlmostEqual(0.0, green_lagrange_strains_zz[idx]) + + # Assert displacements + for x_displacement in x_displacements: + self.assertAlmostEqual(0.0, x_displacement) + + for node_idx in range(len(nodal_coordinates)): + #todo correct expected displacement # if n_dim >= 2: - # self.assertAlmostEqual(expected_strain_yy[idx], green_lagrange_strains_yy[idx]) - # if n_dim >= 3: - # self.assertAlmostEqual(0.0, green_lagrange_strains_zz[idx]) - - # # Assert displacements - # for x_displacement in x_displacements: - # self.assertAlmostEqual(0.0, x_displacement) - - # for node_idx in range(len(nodal_coordinates)): - # #todo correct expected displacement - # # if n_dim >= 2: - # # self.assertAlmostEqual(expected_displacements_y[node_idx], y_displacements[node_idx], 6) - # self.assertAlmostEqual(expected_water_pressure[node_idx], water_pressures[node_idx], 6) - - # if n_dim >= 3: - # for z_displacement in z_displacements: - # self.assertAlmostEqual(0.0, z_displacement) + # self.assertAlmostEqual(expected_displacements_y[node_idx], y_displacements[node_idx], 6) + self.assertAlmostEqual(expected_water_pressure[node_idx], water_pressures[node_idx], 6) + + if n_dim >= 3: + for z_displacement in z_displacements: + self.assertAlmostEqual(0.0, z_displacement) if __name__ == '__main__': KratosUnittest.main() From 348907df701f92f5130a61bf5b3582b81c319c35 Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Tue, 7 Feb 2023 13:04:09 +0100 Subject: [PATCH 06/27] Removed numpy package from test --- .../GeoMechanicsApplication/tests/test_water_pressure.py | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/GeoMechanicsApplication/tests/test_water_pressure.py b/applications/GeoMechanicsApplication/tests/test_water_pressure.py index b5d27d192349..7a79b909c54f 100644 --- a/applications/GeoMechanicsApplication/tests/test_water_pressure.py +++ b/applications/GeoMechanicsApplication/tests/test_water_pressure.py @@ -3,7 +3,6 @@ import KratosMultiphysics.KratosUnittest as KratosUnittest import test_helper -import numpy as np class KratosGeoMechanicsWaterPressureTests(KratosUnittest.TestCase): From 34c57494bd1d8db0d36f31b45a799e37ae4661cf Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Tue, 7 Feb 2023 15:20:20 +0100 Subject: [PATCH 07/27] Updated tests effected by changes to test_helper --- .../tests/test_absorbing_boundary.py | 9 ++++++--- .../tests/test_absorbing_boundary_validation.py | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py index 75b65af83a02..1e0c20eee693 100644 --- a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py +++ b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py @@ -80,11 +80,14 @@ def run_and_assert_1d_column(self, file_path, node_nbrs, direction): expected_ini_time = dist/self.vp # find index of expected time of wave arrival in time list - ini_time_idx = test_helper.find_closest_index_greater_than_value(res["time"], expected_ini_time) + res_keys = list(res.keys()) + ini_time_idx = test_helper.find_closest_index_greater_than_value(res_keys, expected_ini_time) # calculate velocity after wave arrival - dt = (res["time"][-1] - res["time"][ini_time_idx]) - velocity_part_two = (res[str(node_nbr)][-1][direction] - res[str(node_nbr)][ini_time_idx][direction])/dt + t1 = res_keys[ini_time_idx] + t2 = res_keys[-1] + dt = t2 - t1 + velocity_part_two = (res[t2][node_nbr][direction] - res[t1][node_nbr][direction])/dt # assert velocities self.assertAlmostEqual(velocity_part_two, self.expected_velocity, 2) diff --git a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary_validation.py b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary_validation.py index 004ae07e2a6f..6cf300ab1c7c 100644 --- a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary_validation.py +++ b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary_validation.py @@ -111,11 +111,14 @@ def run_and_assert_1d_column(self, file_path, node_nbrs, direction): expected_ini_time = dist/self.vp # find index of expected time of wave arrival in time list - ini_time_idx = test_helper.find_closest_index_greater_than_value(res["time"], expected_ini_time) + res_keys = list(res.keys()) + ini_time_idx = test_helper.find_closest_index_greater_than_value(res_keys, expected_ini_time) # calculate velocity after wave arrival - dt = (res["time"][-1] - res["time"][ini_time_idx]) - velocity_part_two = (res[str(node_nbr)][-1][direction] - res[str(node_nbr)][ini_time_idx][direction])/dt + t1 = res_keys[ini_time_idx] + t2 = res_keys[-1] + dt = t2 - t1 + velocity_part_two = (res[t2][node_nbr][direction] - res[t1][node_nbr][direction])/dt # assert velocities self.assertAlmostEqual(velocity_part_two, self.expected_velocity, 2) From c9ba5b3113660fe237f07eebdfedf22607e3ee05 Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Tue, 7 Feb 2023 15:56:30 +0100 Subject: [PATCH 08/27] Removed bug indicated by sonarcloud --- ...t_phreatic_multi_line_pressure_process.hpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index 0b02bce144a9..d6885298f461 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -228,17 +228,18 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process { if (mHorizontalDirectionCoordinates[index] >= rNode.Coordinates()[mHorizontalDirection]) { - break; + if (index == 0) + { + return 0; + } + else + { + return index - 1; + } } } - if (index == 0) - { - return 0; - } - else - { - return index - 1; - } + return index - 1; + } double CalculatePressure(const Node<3> &rNode) const From c3bb4062daa419ebf0912433fe3ce4c2e7c29ab0 Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Thu, 9 Feb 2023 16:04:43 +0100 Subject: [PATCH 09/27] Removed Bug with empty statement --- ...pply_constant_phreatic_multi_line_pressure_process.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index d6885298f461..81ad7435219d 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -224,9 +224,11 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process int findIndex(const Node<3>& rNode) const { int index = 0; - for(index; index < mHorizontalDirectionCoordinates.size(); index++) + auto coords = rNode.Coordinates(); + auto noCoordinates = mHorizontalDirectionCoordinates.size(); + for ( ; index < noCoordinates; ++index) { - if (mHorizontalDirectionCoordinates[index] >= rNode.Coordinates()[mHorizontalDirection]) + if (mHorizontalDirectionCoordinates[index] >= coords[mHorizontalDirection]) { if (index == 0) { @@ -238,7 +240,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process } } } - return index - 1; + return noCoordinates - 1; } From 5f6e4ae3355bcb05b2d2642e6f2358687542611e Mon Sep 17 00:00:00 2001 From: Anne van de Graaf Date: Thu, 9 Feb 2023 17:26:03 +0100 Subject: [PATCH 10/27] Use `= default` instead of an empty functionbody for destructors Destructors are special member functions that are overridden when the base class destructor is `virtual`. Don't supply empty function bodies, but use `= default` instead. Note that this is in line with C.80: "Use `=default` if you have to be explicit about using the default semantics" from the C++ Core Guidelines. --- .../apply_constant_phreatic_multi_line_pressure_process.hpp | 2 +- .../apply_phreatic_multi_line_pressure_table_process.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index 81ad7435219d..f8b5a3a92e8a 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -133,7 +133,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process ///------------------------------------------------------------------------------------ /// Destructor - ~ApplyConstantPhreaticMultiLinePressureProcess() override {} + ~ApplyConstantPhreaticMultiLinePressureProcess() override = default; ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp index 27c62b5ba892..2d3a78bfd71a 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -58,7 +58,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM ///------------------------------------------------------------------------------------ /// Destructor - ~ApplyPhreaticMultiLinePressureTableProcess() override {} + ~ApplyPhreaticMultiLinePressureTableProcess() override = default; ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- From 499d13f71306ebfb57620c6bcfaac718e75ce80d Mon Sep 17 00:00:00 2001 From: Anne van de Graaf Date: Thu, 9 Feb 2023 17:35:47 +0100 Subject: [PATCH 11/27] Removed some empty statements Some macro usages were followed by a semicolon, whereas this was not needed. As a result, we had some empty statements. Those have been removed now. --- .../apply_constant_phreatic_multi_line_pressure_process.hpp | 2 +- .../apply_phreatic_multi_line_pressure_table_process.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index f8b5a3a92e8a..1d9bcaaa8215 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -127,7 +127,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process else mPressureTensionCutOff = 0.0; - KRATOS_CATCH(""); + KRATOS_CATCH("") } ///------------------------------------------------------------------------------------ diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp index 2d3a78bfd71a..d569b4b6685e 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -52,7 +52,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER]; - KRATOS_CATCH(""); + KRATOS_CATCH("") } ///------------------------------------------------------------------------------------ @@ -109,7 +109,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM } } - KRATOS_CATCH(""); + KRATOS_CATCH("") } /// Turn back information as a string. From b2b229c977725b6c80f079bb5b82058cfd732c65 Mon Sep 17 00:00:00 2001 From: Anne van de Graaf Date: Fri, 10 Feb 2023 15:41:00 +0100 Subject: [PATCH 12/27] Renamed several local variables in Python scripts To comply with Kratos' Style Guide several variables names were converted from lowerCamelCase to snake_case. --- .../tests/test_helper.py | 14 +++---- .../tests/test_water_pressure.py | 40 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/test_helper.py b/applications/GeoMechanicsApplication/tests/test_helper.py index af8e2d6aa480..cfb082e8e67b 100644 --- a/applications/GeoMechanicsApplication/tests/test_helper.py +++ b/applications/GeoMechanicsApplication/tests/test_helper.py @@ -186,14 +186,14 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): if add_var: if line.startswith("Values"): continue; - lineSplit = line.split() - lineSplit[0] = int(lineSplit[0]) - for ind, strVal in enumerate(lineSplit[1:]): - lineSplit[ind+1] = float(strVal) - if (len(lineSplit[1:])==1): - res[time_step][lineSplit[0]] = lineSplit[1] + line_split = line.split() + line_split[0] = int(line_split[0]) + for ind, str_val in enumerate(line_split[1:]): + line_split[ind+1] = float(str_val) + if (len(line_split[1:])==1): + res[time_step][line_split[0]] = line_split[1] else: - res[time_step][lineSplit[0]] = lineSplit[1:] + res[time_step][line_split[0]] = line_split[1:] if r'"' + variable + r'"' in line: time_step = float(line.split()[3]) diff --git a/applications/GeoMechanicsApplication/tests/test_water_pressure.py b/applications/GeoMechanicsApplication/tests/test_water_pressure.py index 7a79b909c54f..1952ac5a1338 100644 --- a/applications/GeoMechanicsApplication/tests/test_water_pressure.py +++ b/applications/GeoMechanicsApplication/tests/test_water_pressure.py @@ -163,21 +163,21 @@ def test_inclined_phreatic_multi_line_time_centre(self): water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') times = [x * 0.25 for x in range(1,16)] - dHeadCentre = [0.5, -0.5, -0.5, 0.5] + d_head_centre = [0.5, -0.5, -0.5, 0.5] for ind, time in enumerate(times): # Central Head - dHeadInd = int(ind/4) # slope - if dHeadInd == 0: - lastHead = -5000 + d_head_ind = int(ind/4) # slope + if d_head_ind == 0: + last_head = -5000 else: - lastHead = (sum(dHeadCentre[0:dHeadInd]) * -10000) - 5000 - expectedBottomCentreHead = lastHead - (dHeadCentre[dHeadInd] * 10000) * (time - (4 * dHeadInd * 0.25)) + last_head = (sum(d_head_centre[0:d_head_ind]) * -10000) - 5000 + expected_bottom_centre_head = last_head - (d_head_centre[d_head_ind] * 10000) * (time - (4 * d_head_ind * 0.25)) # Bottom Row self.assertAlmostEqual(-5000, water_pressures[time][1]) - self.assertAlmostEqual(expectedBottomCentreHead, water_pressures[time][48]) + self.assertAlmostEqual(expected_bottom_centre_head, water_pressures[time][48]) self.assertAlmostEqual(-5000, water_pressures[time][186]) # Top Row @@ -201,30 +201,30 @@ def test_inclined_phreatic_multi_line_time_edge(self): water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') times = [x * 0.25 for x in range(1,16)] - dHeadLeft = [0.5, -0.5, -0.5, 0.5] - dHeadRight = [0.25, -0.25, -0.25, 0.25] + d_head_left = [0.5, -0.5, -0.5, 0.5] + d_head_right = [0.25, -0.25, -0.25, 0.25] for ind, time in enumerate(times): - dHeadInd = int(ind/4) # slope + d_head_ind = int(ind/4) # slope # Left Head - if dHeadInd == 0: - lastHead = -5000 + if d_head_ind == 0: + last_head = -5000 else: - lastHead = (sum(dHeadLeft[0:dHeadInd]) * -10000) - 5000 - expectedBottomLeftHead = lastHead - (dHeadLeft[dHeadInd] * 10000) * (time - (4 * dHeadInd * 0.25)) + last_head = (sum(d_head_left[0:d_head_ind]) * -10000) - 5000 + expected_bottom_left_head = last_head - (d_head_left[d_head_ind] * 10000) * (time - (4 * d_head_ind * 0.25)) # Left Head - if dHeadInd == 0: - lastHead = -5000 + if d_head_ind == 0: + last_head = -5000 else: - lastHead = (sum(dHeadRight[0:dHeadInd]) * -10000) - 5000 - expectedBottomRightHead = lastHead - (dHeadRight[dHeadInd] * 10000) * (time - (4 * dHeadInd * 0.25)) + last_head = (sum(d_head_right[0:d_head_ind]) * -10000) - 5000 + expected_bottom_right_head = last_head - (d_head_right[d_head_ind] * 10000) * (time - (4 * d_head_ind * 0.25)) # Bottom Row - self.assertAlmostEqual(expectedBottomLeftHead, water_pressures[time][1]) + self.assertAlmostEqual(expected_bottom_left_head, water_pressures[time][1]) self.assertAlmostEqual(-5000, water_pressures[time][48]) - self.assertAlmostEqual(expectedBottomRightHead, water_pressures[time][186]) + self.assertAlmostEqual(expected_bottom_right_head, water_pressures[time][186]) # Top Row self.assertAlmostEqual(0, water_pressures[time][187]) From 9563e167f27203978a410ef9c018856d969cd58b Mon Sep 17 00:00:00 2001 From: Anne van de Graaf Date: Fri, 10 Feb 2023 16:07:58 +0100 Subject: [PATCH 13/27] Removed some redundant overridden member functions The implementations of these overrides were identical to the implementations of their base class counterparts. In fact, all function bodies were empty. Therefore, there was no point in overriding the base class behaviour, since they were identical. Removed the overrides. --- ...y_constant_phreatic_multi_line_pressure_process.hpp | 10 ---------- ...pply_phreatic_multi_line_pressure_table_process.hpp | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index 1d9bcaaa8215..5cabf9206e26 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -137,11 +137,6 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - /// Execute method is used to execute the ApplyConstantPhreaticMultiLinePressureProcess algorithms. - void Execute() override - { - } - /// this function is designed for being called at the beginning of the computations /// right after reading the model and the groups void ExecuteInitialize() override @@ -192,11 +187,6 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process rOStream << "ApplyConstantPhreaticMultiLinePressureProcess"; } - /// Print object's data. - void PrintData(std::ostream& rOStream) const override - { - } - ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- protected: diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp index d569b4b6685e..21c8d93cf975 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -62,11 +62,6 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - /// Execute method is used to execute the ApplyPhreaticMultiLinePressureTableProcess algorithms. - void Execute() override - { - } - /// this function will be executed at every time step BEFORE performing the solve phase void ExecuteInitializeSolutionStep() override { @@ -124,11 +119,6 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM rOStream << "ApplyPhreaticMultiLinePressureTableProcess"; } - /// Print object's data. - void PrintData(std::ostream& rOStream) const override - { - } - ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- protected: From 840b972d3455944b987dc720e14632edcd309ea3 Mon Sep 17 00:00:00 2001 From: Anne van de Graaf Date: Fri, 10 Feb 2023 17:14:48 +0100 Subject: [PATCH 14/27] Fixed nearly all remaining code smells The fixes include: - Removed a few unused variables from a Python script. - Added two early exits to reduce the number of nested `if` statements. - Avoid narrowing due to implicit converions. Use `static_cast`s to make clear that the conversions are intentional. - Removed a variable from the C++ code that did not have any added value. We now use the returned value directly rather than assigning it first. - In line with C.81 "Use `=delete` when you want to disable default behavior (without wanting an alternative)" of the C++ Core Guidelines, two private copy assignment operators and two private copy constructors have been deleted. - Replaced one `typedef` by `using`. - Avoid hiding an inherited non-virtual function. - Replaced a raw `for` loop by a standard transformation. --- ...t_phreatic_multi_line_pressure_process.hpp | 76 ++++++++--------- ...atic_multi_line_pressure_table_process.hpp | 84 +++++++++---------- .../tests/test_water_pressure.py | 6 +- 3 files changed, 78 insertions(+), 88 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index 5cabf9206e26..bbb4f402860c 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -109,9 +109,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process mGravityDirectionCoordinates = mZCoordinates; } - bool mHorizontalDirectionCoordindatesSorted = std::is_sorted(mHorizontalDirectionCoordinates.begin(), mHorizontalDirectionCoordinates.end()); - - if (!mHorizontalDirectionCoordindatesSorted) + if (!std::is_sorted(mHorizontalDirectionCoordinates.begin(), mHorizontalDirectionCoordinates.end())) { KRATOS_ERROR << "The Horizontal Elements Coordinates are not ordered." << rParameters @@ -135,6 +133,12 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process /// Destructor ~ApplyConstantPhreaticMultiLinePressureProcess() override = default; + /// Assignment operator. + ApplyConstantPhreaticMultiLinePressureProcess& operator=(ApplyConstantPhreaticMultiLinePressureProcess const&) = delete; + + /// Copy constructor. + ApplyConstantPhreaticMultiLinePressureProcess(ApplyConstantPhreaticMultiLinePressureProcess const&) = delete; + ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- /// this function is designed for being called at the beginning of the computations @@ -143,33 +147,35 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process { KRATOS_TRY - if (mrModelPart.NumberOfNodes() > 0) { - const Variable &var = KratosComponents< Variable >::Get(mVariableName); - - if (mIsSeepage) { - block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { - const double pressure = CalculatePressure(rNode); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { - rNode.FastGetSolutionStepValue(var) = pressure; - if (mIsFixed) rNode.Fix(var); - } else { - rNode.Free(var); - } - }); - } else { - block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { + if (mrModelPart.NumberOfNodes() <= 0) { + return; + } + + const Variable &var = KratosComponents< Variable >::Get(mVariableName); + + if (mIsSeepage) { + block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { + const double pressure = CalculatePressure(rNode); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { + rNode.FastGetSolutionStepValue(var) = pressure; if (mIsFixed) rNode.Fix(var); - else rNode.Free(var); - const double pressure = CalculatePressure(rNode); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { - rNode.FastGetSolutionStepValue(var) = pressure; - } else { - rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; - } - }); - } + } else { + rNode.Free(var); + } + }); + } else { + block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { + if (mIsFixed) rNode.Fix(var); + else rNode.Free(var); + const double pressure = CalculatePressure(rNode); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { + rNode.FastGetSolutionStepValue(var) = pressure; + } else { + rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; + } + }); } KRATOS_CATCH("") @@ -215,7 +221,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process { int index = 0; auto coords = rNode.Coordinates(); - auto noCoordinates = mHorizontalDirectionCoordinates.size(); + auto noCoordinates = static_cast(mHorizontalDirectionCoordinates.size()); for ( ; index < noCoordinates; ++index) { if (mHorizontalDirectionCoordinates[index] >= coords[mHorizontalDirection]) @@ -255,16 +261,6 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process const double pressure = - PORE_PRESSURE_SIGN_FACTOR * mSpecificWeight * distance; return pressure; } -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -private: - - /// Assignment operator. - ApplyConstantPhreaticLinePressureProcess& operator=(ApplyConstantPhreaticMultiLinePressureProcess const& rOther); - - /// Copy constructor. - //ApplyConstantPhreaticLinePressureProcess(ApplyConstantPhreaticMultiLinePressureProcess const& rOther); - }; // Class ApplyConstantPhreaticMultiLinePressureProcess /// input stream function diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp index 21c8d93cf975..02c143286296 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -29,7 +29,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM KRATOS_CLASS_POINTER_DEFINITION(ApplyPhreaticMultiLinePressureTableProcess); /// Defining a table with double argument and result type as table type. - typedef Table TableType; + using TableType = Table; ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -40,8 +40,9 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM { KRATOS_TRY - for(unsigned int TableId: rParameters["table"].GetVector()) - { + for (auto value : rParameters["table"].GetVector()) + { + const auto TableId = static_cast(value); if (TableId > 0) { auto pTable = model_part.pGetTable(TableId); mpTable.push_back(pTable); @@ -60,6 +61,12 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM /// Destructor ~ApplyPhreaticMultiLinePressureTableProcess() override = default; + /// Assignment operator. + ApplyPhreaticMultiLinePressureTableProcess& operator=(ApplyPhreaticMultiLinePressureTableProcess const&) = delete; + + /// Copy constructor. + ApplyPhreaticMultiLinePressureTableProcess(ApplyPhreaticMultiLinePressureTableProcess const&) = delete; + ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- /// this function will be executed at every time step BEFORE performing the solve phase @@ -67,41 +74,38 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM { KRATOS_TRY - if (mrModelPart.NumberOfNodes() > 0) { - const Variable &var = KratosComponents< Variable >::Get(mVariableName); + if (mrModelPart.NumberOfNodes() <= 0) { + return; + } + + const Variable &var = KratosComponents< Variable >::Get(mVariableName); + + const double Time = mrModelPart.GetProcessInfo()[TIME]/mTimeUnitConverter; + std::vector deltaH; + std::transform(mpTable.begin(), mpTable.end(), std::back_inserter(deltaH), + [Time](auto element){return element ? element->GetValue(Time) : 0.0;}); + + if (mIsSeepage) { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { + const double pressure = CalculateTimeDependentPressure(rNode, deltaH); - const double Time = mrModelPart.GetProcessInfo()[TIME]/mTimeUnitConverter; - std::vector deltaH; - for (unsigned int i=0; i < mpTable.size(); ++i) { - if (!mpTable[i]) { - deltaH.push_back(0.0); + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { + rNode.FastGetSolutionStepValue(var) = pressure; + if (mIsFixed) rNode.Fix(var); } else { - deltaH.push_back(mpTable[i]->GetValue(Time)); + rNode.Free(var); } - } + }); + } else { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { + const double pressure = CalculateTimeDependentPressure(rNode, deltaH); - if (mIsSeepage) { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { - const double pressure = CalculatePressure(rNode, deltaH); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { - rNode.FastGetSolutionStepValue(var) = pressure; - if (mIsFixed) rNode.Fix(var); - } else { - rNode.Free(var); - } - }); - } else { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { - const double pressure = CalculatePressure(rNode, deltaH); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { - rNode.FastGetSolutionStepValue(var) = pressure; - } else { - rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; - } - }); - } + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { + rNode.FastGetSolutionStepValue(var) = pressure; + } else { + rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; + } + }); } KRATOS_CATCH("") @@ -128,7 +132,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM std::vector mpTable; double mTimeUnitConverter; - double CalculatePressure(const Node<3> &rNode, std::vector &deltaH) const + double CalculateTimeDependentPressure(const Node<3> &rNode, std::vector &deltaH) const { double height = 0.0; @@ -155,16 +159,6 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM const double pressure = - PORE_PRESSURE_SIGN_FACTOR * mSpecificWeight * distance; return pressure; } - -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -private: - - /// Assignment operator. - ApplyPhreaticMultiLinePressureTableProcess& operator=(ApplyPhreaticMultiLinePressureTableProcess const& rOther); - - /// Copy constructor. - //ApplyPhreaticMultiLinePressureTableProcess(ApplyPhreaticMultiLinePressureTableProcess const& rOther); }; // Class ApplyPhreaticMultiLinePressureTableProcess /// input stream function diff --git a/applications/GeoMechanicsApplication/tests/test_water_pressure.py b/applications/GeoMechanicsApplication/tests/test_water_pressure.py index 1952ac5a1338..c80237910141 100644 --- a/applications/GeoMechanicsApplication/tests/test_water_pressure.py +++ b/applications/GeoMechanicsApplication/tests/test_water_pressure.py @@ -55,7 +55,7 @@ def test_inclined_phreatic_line_time(self): """ test_name = 'test_inclinded_phreatic_line_time_dependent' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) + test_helper.run_kratos(file_path) res_path = os.path.join(file_path, test_name + '.post.res') @@ -156,7 +156,7 @@ def test_inclined_phreatic_multi_line_time_centre(self): """ test_name = 'test_inclinded_phreatic_multi_line_time_dependent_centre' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) + test_helper.run_kratos(file_path) res_path = os.path.join(file_path, test_name + '.post.res') @@ -194,7 +194,7 @@ def test_inclined_phreatic_multi_line_time_edge(self): """ test_name = 'test_inclinded_phreatic_multi_line_time_dependent_edges' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) - simulation = test_helper.run_kratos(file_path) + test_helper.run_kratos(file_path) res_path = os.path.join(file_path, test_name + '.post.res') From bd145e82c1f50296d1ec01b0e8f04d5d74751a25 Mon Sep 17 00:00:00 2001 From: Anne van de Graaf Date: Tue, 14 Feb 2023 10:48:33 +0100 Subject: [PATCH 15/27] Fixed remaining code smells - Attempted to reduce the Cognitive Complexity of a Python function. * Reduced the maximum number of nested `if` statements. * Reordered some code to make it read more naturally. * Renamed a few variables. - Converted several protected data members to private data members. For most of them getters have been added, too. In this way, we comply with C.133: "Avoid `protected` data" of the C++ Core Guidelines. - Removed two unused (protected) data members. --- ...t_phreatic_multi_line_pressure_process.hpp | 161 ++++++++++++------ ...atic_multi_line_pressure_table_process.hpp | 32 ++-- .../tests/test_helper.py | 46 ++--- 3 files changed, 150 insertions(+), 89 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index bbb4f402860c..d16215836db0 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -72,53 +72,50 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process mIsSeepage = rParameters["is_seepage"].GetBool(); mGravityDirection = rParameters["gravity_direction"].GetInt(); mOutOfPlaneDirection = rParameters["out_of_plane_direction"].GetInt(); - if (mGravityDirection == mOutOfPlaneDirection) + if (GravityDirection() == OutOfPlaneDirection()) KRATOS_ERROR << "Gravity direction cannot be the same as Out-of-Plane directions" << rParameters << std::endl; mHorizontalDirection = 0; for (unsigned int i=0; i &var = KratosComponents< Variable >::Get(mVariableName); + const Variable &var = KratosComponents< Variable >::Get(VariableName()); - if (mIsSeepage) { + if (IsSeepage()) { block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { const double pressure = CalculatePressure(rNode); if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { rNode.FastGetSolutionStepValue(var) = pressure; - if (mIsFixed) rNode.Fix(var); + if (IsFixed()) rNode.Fix(var); } else { rNode.Free(var); } }); } else { block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { - if (mIsFixed) rNode.Fix(var); - else rNode.Free(var); + if (IsFixed()) rNode.Fix(var); + else rNode.Free(var); const double pressure = CalculatePressure(rNode); - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { rNode.FastGetSolutionStepValue(var) = pressure; } else { - rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; + rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); } }); } @@ -193,6 +190,71 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process rOStream << "ApplyConstantPhreaticMultiLinePressureProcess"; } + const std::string& VariableName() const + { + return mVariableName; + } + + bool IsFixed() const + { + return mIsFixed; + } + + bool IsSeepage() const + { + return mIsSeepage; + } + + unsigned int GravityDirection() const + { + return mGravityDirection; + } + + double SpecificWeight() const + { + return mSpecificWeight; + } + + unsigned int OutOfPlaneDirection() const + { + return mOutOfPlaneDirection; + } + + unsigned int HorizontalDirection() const + { + return mHorizontalDirection; + } + + const Vector& HorizontalDirectionCoordinates() const + { + return mHorizontalDirectionCoordinates; + } + + const Vector& GravityDirectionCoordinates() const + { + return mGravityDirectionCoordinates; + } + + const Vector& XCoordinates() const + { + return mXCoordinates; + } + + const Vector& YCoordinates() const + { + return mYCoordinates; + } + + const Vector& ZCoordinates() const + { + return mZCoordinates; + } + + double PressureTensionCutOff() const + { + return mPressureTensionCutOff; + } + ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- protected: @@ -200,31 +262,15 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process /// Member Variables ModelPart& mrModelPart; - std::string mVariableName; - bool mIsFixed; - bool mIsSeepage; - unsigned int mGravityDirection; - double mSpecificWeight; - unsigned int mOutOfPlaneDirection; - unsigned int mHorizontalDirection; - Vector mHorizontalDirectionCoordinates; - Vector mGravityDirectionCoordinates; - Vector mXCoordinates; - Vector mYCoordinates; - Vector mZCoordinates; - - double mMinHorizontalCoordinate; - double mMaxHorizontalCoordinate; - double mPressureTensionCutOff; int findIndex(const Node<3>& rNode) const { int index = 0; auto coords = rNode.Coordinates(); - auto noCoordinates = static_cast(mHorizontalDirectionCoordinates.size()); + auto noCoordinates = static_cast(HorizontalDirectionCoordinates().size()); for ( ; index < noCoordinates; ++index) { - if (mHorizontalDirectionCoordinates[index] >= coords[mHorizontalDirection]) + if (HorizontalDirectionCoordinates()[index] >= coords[HorizontalDirection()]) { if (index == 0) { @@ -252,15 +298,32 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process firstPointIndex = findIndex(rNode); secondPointIndex = firstPointIndex + 1; - slope = (mGravityDirectionCoordinates[secondPointIndex] - mGravityDirectionCoordinates[firstPointIndex]) / - (mHorizontalDirectionCoordinates[secondPointIndex] - mHorizontalDirectionCoordinates[firstPointIndex]); + slope = (GravityDirectionCoordinates()[secondPointIndex] - GravityDirectionCoordinates()[firstPointIndex]) / + (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); - height = slope * (rNode.Coordinates()[mHorizontalDirection] - mHorizontalDirectionCoordinates[firstPointIndex]) + mGravityDirectionCoordinates[firstPointIndex]; + height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + GravityDirectionCoordinates()[firstPointIndex]; - const double distance = height - rNode.Coordinates()[mGravityDirection]; - const double pressure = - PORE_PRESSURE_SIGN_FACTOR * mSpecificWeight * distance; + const double distance = height - rNode.Coordinates()[GravityDirection()]; + const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; return pressure; } + +///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +private: + std::string mVariableName; + bool mIsFixed; + bool mIsSeepage; + unsigned int mGravityDirection; + double mSpecificWeight; + unsigned int mOutOfPlaneDirection; + unsigned int mHorizontalDirection; + Vector mHorizontalDirectionCoordinates; + Vector mGravityDirectionCoordinates; + Vector mXCoordinates; + Vector mYCoordinates; + Vector mZCoordinates; + double mPressureTensionCutOff; }; // Class ApplyConstantPhreaticMultiLinePressureProcess /// input stream function diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp index 02c143286296..ee1ad93ae08a 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -78,20 +78,20 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM return; } - const Variable &var = KratosComponents< Variable >::Get(mVariableName); + const Variable &var = KratosComponents< Variable >::Get(VariableName()); const double Time = mrModelPart.GetProcessInfo()[TIME]/mTimeUnitConverter; std::vector deltaH; std::transform(mpTable.begin(), mpTable.end(), std::back_inserter(deltaH), [Time](auto element){return element ? element->GetValue(Time) : 0.0;}); - if (mIsSeepage) { + if (IsSeepage()) { block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { const double pressure = CalculateTimeDependentPressure(rNode, deltaH); if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { rNode.FastGetSolutionStepValue(var) = pressure; - if (mIsFixed) rNode.Fix(var); + if (IsFixed()) rNode.Fix(var); } else { rNode.Free(var); } @@ -100,10 +100,10 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { const double pressure = CalculateTimeDependentPressure(rNode, deltaH); - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < mPressureTensionCutOff) { + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { rNode.FastGetSolutionStepValue(var) = pressure; } else { - rNode.FastGetSolutionStepValue(var) = mPressureTensionCutOff; + rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); } }); } @@ -126,12 +126,6 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- protected: - - /// Member Variables - - std::vector mpTable; - double mTimeUnitConverter; - double CalculateTimeDependentPressure(const Node<3> &rNode, std::vector &deltaH) const { @@ -146,19 +140,23 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM firstPointIndex = findIndex(rNode); secondPointIndex = firstPointIndex + 1; - y[0] = deltaH[firstPointIndex] + mGravityDirectionCoordinates[firstPointIndex]; - y[1] = deltaH[secondPointIndex] + mGravityDirectionCoordinates[secondPointIndex]; + y[0] = deltaH[firstPointIndex] + GravityDirectionCoordinates()[firstPointIndex]; + y[1] = deltaH[secondPointIndex] + GravityDirectionCoordinates()[secondPointIndex]; slope = (y[1] - y[0]) - / (mHorizontalDirectionCoordinates[secondPointIndex] - mHorizontalDirectionCoordinates[firstPointIndex]); + / (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); - height = slope * (rNode.Coordinates()[mHorizontalDirection] - mHorizontalDirectionCoordinates[firstPointIndex]) + y[0]; + height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + y[0]; - const double distance = height - rNode.Coordinates()[mGravityDirection]; - const double pressure = - PORE_PRESSURE_SIGN_FACTOR * mSpecificWeight * distance; + const double distance = height - rNode.Coordinates()[GravityDirection()]; + const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; return pressure; } + +private: + std::vector mpTable; + double mTimeUnitConverter; }; // Class ApplyPhreaticMultiLinePressureTableProcess /// input stream function diff --git a/applications/GeoMechanicsApplication/tests/test_helper.py b/applications/GeoMechanicsApplication/tests/test_helper.py index cfb082e8e67b..d38638acac36 100644 --- a/applications/GeoMechanicsApplication/tests/test_helper.py +++ b/applications/GeoMechanicsApplication/tests/test_helper.py @@ -172,33 +172,33 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): # read data with open(filename, "r") as f: - all_data = f.readlines() + all_lines = f.readlines() - add_var = False + process_values = False res = {} # read all data at each time step of variable - for line in all_data: - - if "End Values" in line and add_var: - add_var = False - - if add_var: - if line.startswith("Values"): - continue; - line_split = line.split() - line_split[0] = int(line_split[0]) - for ind, str_val in enumerate(line_split[1:]): - line_split[ind+1] = float(str_val) - if (len(line_split[1:])==1): - res[time_step][line_split[0]] = line_split[1] - else: - res[time_step][line_split[0]] = line_split[1:] - - if r'"' + variable + r'"' in line: - time_step = float(line.split()[3]) - res[time_step] = {} - add_var=True + for line in all_lines: + if not process_values: + if f'"{variable}"' in line: + time_step = float(line.split()[3]) + res[time_step] = {} + process_values = True + continue + + if line.startswith("Values"): + continue + + if "End Values" in line: + process_values = False + continue + + words = line.split() + node_index = int(words[0]) + values = [float(word) for word in words[1:]] + if len(values) == 1: + values = values[0] + res[time_step][node_index] = values return res From 1be5e179e86a4e66b0e95831a2bfb59f6c0a94cd Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Thu, 25 May 2023 10:21:07 +0200 Subject: [PATCH 16/27] =?UTF-8?q?Updated=20Node<3>=20=E2=86=92=20Node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pply_constant_phreatic_multi_line_pressure_process.hpp | 8 ++++---- .../apply_phreatic_multi_line_pressure_table_process.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp index d16215836db0..54e1445c0b7c 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp @@ -151,7 +151,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process const Variable &var = KratosComponents< Variable >::Get(VariableName()); if (IsSeepage()) { - block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { + block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { const double pressure = CalculatePressure(rNode); if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { @@ -162,7 +162,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process } }); } else { - block_for_each(mrModelPart.Nodes(), [&var, this](Node<3>& rNode) { + block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { if (IsFixed()) rNode.Fix(var); else rNode.Free(var); const double pressure = CalculatePressure(rNode); @@ -263,7 +263,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process ModelPart& mrModelPart; - int findIndex(const Node<3>& rNode) const + int findIndex(const Node& rNode) const { int index = 0; auto coords = rNode.Coordinates(); @@ -286,7 +286,7 @@ class ApplyConstantPhreaticMultiLinePressureProcess : public Process } - double CalculatePressure(const Node<3> &rNode) const + double CalculatePressure(const Node &rNode) const { double height = 0.0; int firstPointIndex; diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp index ee1ad93ae08a..dfe3c7464d6d 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -86,7 +86,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM [Time](auto element){return element ? element->GetValue(Time) : 0.0;}); if (IsSeepage()) { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { const double pressure = CalculateTimeDependentPressure(rNode, deltaH); if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { @@ -97,7 +97,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM } }); } else { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node<3>& rNode) { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { const double pressure = CalculateTimeDependentPressure(rNode, deltaH); if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { @@ -126,7 +126,7 @@ class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticM ///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- protected: - double CalculateTimeDependentPressure(const Node<3> &rNode, std::vector &deltaH) const + double CalculateTimeDependentPressure(const Node &rNode, std::vector &deltaH) const { double height = 0.0; From f2d38dc5f6626d526933b84530f5539389ffff40 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 9 Oct 2023 16:04:43 +0200 Subject: [PATCH 17/27] Fix tests after merge with master --- .../ProjectParameters.json | 2 -- .../ProjectParameters.json | 2 -- .../ProjectParameters.json | 2 -- .../ProjectParameters.json | 2 -- 4 files changed, 8 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json index dff094f8f91e..6d03246f222c 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json @@ -11,7 +11,6 @@ "solver_type": "U_Pw", "model_part_name": "PorousDomain", "domain_size": 2, - "start_time": 0.0, "model_import_settings": { "input_type": "mdpa", "input_filename": "test_inclinded_phreatic_multi_line_time_dependent_centre" @@ -49,7 +48,6 @@ "number_cycles": 100, "reduction_factor": 0.5, "increase_factor": 2.0, - "realised_factor": 0.9999, "desired_iterations": 4, "max_radius_factor": 10.0, "min_radius_factor": 0.1, diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json index 8a82b0de30b1..a8b61af331cb 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json @@ -11,7 +11,6 @@ "solver_type": "U_Pw", "model_part_name": "PorousDomain", "domain_size": 2, - "start_time": 0.0, "model_import_settings": { "input_type": "mdpa", "input_filename": "test_inclinded_phreatic_multi_line_time_dependent_edges" @@ -49,7 +48,6 @@ "number_cycles": 100, "reduction_factor": 0.5, "increase_factor": 2.0, - "realised_factor": 0.9999, "desired_iterations": 4, "max_radius_factor": 10.0, "min_radius_factor": 0.1, diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json index 6205be5f7a82..bdcc21c3d212 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line.gid/ProjectParameters.json @@ -11,7 +11,6 @@ "solver_type": "U_Pw", "model_part_name": "PorousDomain", "domain_size": 2, - "start_time": 0.0, "model_import_settings": { "input_type": "mdpa", "input_filename": "test_inclined_phreatic_multi_line" @@ -48,7 +47,6 @@ "number_cycles": 100, "reduction_factor": 0.5, "increase_factor": 2.0, - "realised_factor": 0.9999, "desired_iterations": 4, "max_radius_factor": 10.0, "min_radius_factor": 0.1, diff --git a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json index 82e4d6b94fff..46d0b755d872 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_3_points.gid/ProjectParameters.json @@ -11,7 +11,6 @@ "solver_type": "U_Pw", "model_part_name": "PorousDomain", "domain_size": 2, - "start_time": 0.0, "model_import_settings": { "input_type": "mdpa", "input_filename": "test_inclined_phreatic_multi_line" @@ -48,7 +47,6 @@ "number_cycles": 100, "reduction_factor": 0.5, "increase_factor": 2.0, - "realised_factor": 0.9999, "desired_iterations": 4, "max_radius_factor": 10.0, "min_radius_factor": 0.1, From 6b59fc16fdcf79f5049ef2f0199b63f43536dda8 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 9 Oct 2023 16:34:31 +0200 Subject: [PATCH 18/27] Cleaned up the constant phreatic multi line pressure process --- ...t_phreatic_multi_line_pressure_process.cpp | 285 +++++++++++++++ ...ant_phreatic_multi_line_pressure_process.h | 99 +++++ ...t_phreatic_multi_line_pressure_process.hpp | 346 ------------------ ...atic_multi_line_pressure_table_process.hpp | 2 +- .../add_custom_processes_to_python.cpp | 2 +- 5 files changed, 386 insertions(+), 348 deletions(-) create mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp create mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h delete mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp new file mode 100644 index 000000000000..4193adcccec6 --- /dev/null +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp @@ -0,0 +1,285 @@ +// KRATOS___ +// // ) ) +// // ___ ___ +// // ____ //___) ) // ) ) +// // / / // // / / +// ((____/ / ((____ ((___/ / MECHANICS +// +// License: geo_mechanics_application/license.txt +// +// Main authors: Vahid Galavi +// Jonathan Nuttall + +#include "apply_constant_phreatic_multi_line_pressure_process.h" + +namespace Kratos +{ + +ApplyConstantPhreaticMultiLinePressureProcess::ApplyConstantPhreaticMultiLinePressureProcess(ModelPart& model_part, + Parameters rParameters) + : Process(Flags()) , mrModelPart(model_part) +{ + KRATOS_TRY + + InitializeParameters(rParameters); + + mVariableName = rParameters["variable_name"].GetString(); + mIsFixed = rParameters["is_fixed"].GetBool(); + mIsSeepage = rParameters["is_seepage"].GetBool(); + mSpecificWeight = rParameters["specific_weight"].GetDouble(); + if (rParameters.Has("pressure_tension_cut_off")) + mPressureTensionCutOff = rParameters["pressure_tension_cut_off"].GetDouble(); + else + mPressureTensionCutOff = 0.0; + mOutOfPlaneDirection = rParameters["out_of_plane_direction"].GetInt(); + + InitializeCoordinates(rParameters); + InitializeGravityDirection(rParameters); + InitializeHorizontalDirection(); + + ValidateCoordinates(rParameters); + + KRATOS_CATCH("") +} + +void ApplyConstantPhreaticMultiLinePressureProcess::InitializeParameters(Parameters& rParameters) const +{ + Parameters default_parameters(R"( + { + "model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME", + "variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME", + "is_fixed": false, + "is_seepage": false, + "gravity_direction": 1, + "out_of_plane_direction": 2, + "x_coordinates": [0.0,1.0], + "y_coordinates": [1.0,0.5], + "z_coordinates": [0.0,0.0], + "specific_weight" : 10000.0, + "pressure_tension_cut_off" : 0.0, + "table" : [0,1] + } )" ); + + // Some values are mandatory, since no meaningful default value exist. For this reason try accessing to them + // So that an error is thrown if they don't exist + rParameters["x_coordinates"]; + rParameters["y_coordinates"]; + rParameters["z_coordinates"]; + rParameters["variable_name"]; + rParameters["model_part_name"]; + + // Now validate the defaults again -- this also ensures no type mismatch + rParameters.ValidateAndAssignDefaults(default_parameters); +} + +void ApplyConstantPhreaticMultiLinePressureProcess::ValidateCoordinates(const Parameters &rParameters) const +{ + if (GravityDirection() == OutOfPlaneDirection()) + { + KRATOS_ERROR << "Gravity direction cannot be the same as Out-of-Plane directions" + << rParameters + << std::endl; + } + + if (!std::is_sorted(HorizontalDirectionCoordinates().begin(), HorizontalDirectionCoordinates().end())) + { + KRATOS_ERROR << "The Horizontal Elements Coordinates are not ordered." + << rParameters + << std::endl; + } +} + +void ApplyConstantPhreaticMultiLinePressureProcess::InitializeCoordinates(const Parameters &rParameters) +{ + mXCoordinates = rParameters["x_coordinates"].GetVector(); + mYCoordinates = rParameters["y_coordinates"].GetVector(); + mZCoordinates = rParameters["z_coordinates"].GetVector(); +} + +void ApplyConstantPhreaticMultiLinePressureProcess::InitializeGravityDirection(const Parameters &rParameters) +{ + mGravityDirection = rParameters["gravity_direction"].GetInt(); + switch (GravityDirection()) { + case 0: + mGravityDirectionCoordinates = XCoordinates(); + break; + case 1: + mGravityDirectionCoordinates = YCoordinates(); + break; + case 2: + mGravityDirectionCoordinates = ZCoordinates(); + break; + default: + KRATOS_ERROR << "The Gravity direction is invalid"; + } +} + +void ApplyConstantPhreaticMultiLinePressureProcess::InitializeHorizontalDirection() +{ + mHorizontalDirection = 0; + for (unsigned int i=0; i &var = KratosComponents< Variable >::Get(VariableName()); + + if (IsSeepage()) { + block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { + const double pressure = CalculatePressure(rNode); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) + { + rNode.FastGetSolutionStepValue(var) = pressure; + if (IsFixed()) rNode.Fix(var); + } + else { + rNode.Free(var); + } + }); + } else { + block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { + if (IsFixed()) rNode.Fix(var); + else rNode.Free(var); + + const double pressure = CalculatePressure(rNode); + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { + rNode.FastGetSolutionStepValue(var) = pressure; + } + else { + rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); + } + }); + } + + KRATOS_CATCH("") +} + +std::string ApplyConstantPhreaticMultiLinePressureProcess::Info() const +{ + return "ApplyConstantPhreaticMultiLinePressureProcess"; +} + +void ApplyConstantPhreaticMultiLinePressureProcess::PrintInfo(std::ostream &rOStream) const +{ + rOStream << "ApplyConstantPhreaticMultiLinePressureProcess"; +} + +const std::string &ApplyConstantPhreaticMultiLinePressureProcess::VariableName() const +{ + return mVariableName; +} + +bool ApplyConstantPhreaticMultiLinePressureProcess::IsFixed() const +{ + return mIsFixed; +} + +bool ApplyConstantPhreaticMultiLinePressureProcess::IsSeepage() const +{ + return mIsSeepage; +} + +unsigned int ApplyConstantPhreaticMultiLinePressureProcess::GravityDirection() const +{ + return mGravityDirection; +} + +double ApplyConstantPhreaticMultiLinePressureProcess::SpecificWeight() const +{ + return mSpecificWeight; +} + +unsigned int ApplyConstantPhreaticMultiLinePressureProcess::OutOfPlaneDirection() const +{ + return mOutOfPlaneDirection; +} + +unsigned int ApplyConstantPhreaticMultiLinePressureProcess::HorizontalDirection() const +{ + return mHorizontalDirection; +} + +const Vector &ApplyConstantPhreaticMultiLinePressureProcess::HorizontalDirectionCoordinates() const +{ + return mHorizontalDirectionCoordinates; +} + +const Vector &ApplyConstantPhreaticMultiLinePressureProcess::GravityDirectionCoordinates() const +{ + return mGravityDirectionCoordinates; +} + +const Vector &ApplyConstantPhreaticMultiLinePressureProcess::XCoordinates() const +{ + return mXCoordinates; +} + +const Vector &ApplyConstantPhreaticMultiLinePressureProcess::YCoordinates() const +{ + return mYCoordinates; +} + +const Vector &ApplyConstantPhreaticMultiLinePressureProcess::ZCoordinates() const +{ + return mZCoordinates; +} + +double ApplyConstantPhreaticMultiLinePressureProcess::PressureTensionCutOff() const +{ + return mPressureTensionCutOff; +} + +int ApplyConstantPhreaticMultiLinePressureProcess::findIndex(const Node &rNode) const +{ + const auto& coords = rNode.Coordinates(); + const auto number_of_coordinates = static_cast(HorizontalDirectionCoordinates().size()); + for (int index = 0; index < number_of_coordinates; ++index) + { + if (HorizontalDirectionCoordinates()[index] >= coords[HorizontalDirection()]) + { + return index == 0 ? index : index - 1; + } + } + + return number_of_coordinates - 1; +} + +double ApplyConstantPhreaticMultiLinePressureProcess::CalculatePressure(const Node &rNode) const +{ + double height = 0.0; + + // find nodes in horizontalDirectionCoordinates + const int firstPointIndex = findIndex(rNode); + const int secondPointIndex = firstPointIndex + 1; + + const double slope = (GravityDirectionCoordinates()[secondPointIndex] - GravityDirectionCoordinates()[firstPointIndex]) / + (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); + + height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + GravityDirectionCoordinates()[firstPointIndex]; + + const double distance = height - rNode.Coordinates()[GravityDirection()]; + const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; + return pressure; +} + +} \ No newline at end of file diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h new file mode 100644 index 000000000000..baf62ee7819c --- /dev/null +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h @@ -0,0 +1,99 @@ +// KRATOS___ +// // ) ) +// // ___ ___ +// // ____ //___) ) // ) ) +// // / / // // / / +// ((____/ / ((____ ((___/ / MECHANICS +// +// License: geo_mechanics_application/license.txt +// +// Main authors: Vahid Galavi +// Jonathan Nuttall + +#pragma once + +#include +#include "includes/kratos_flags.h" +#include "includes/kratos_parameters.h" +#include "processes/process.h" + +#include "geo_mechanics_application_variables.h" + +namespace Kratos +{ + +class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyConstantPhreaticMultiLinePressureProcess : public Process +{ + +public: + KRATOS_CLASS_POINTER_DEFINITION(ApplyConstantPhreaticMultiLinePressureProcess); + + ApplyConstantPhreaticMultiLinePressureProcess(ModelPart& model_part, Parameters rParameters); + ~ApplyConstantPhreaticMultiLinePressureProcess() override = default; + ApplyConstantPhreaticMultiLinePressureProcess& operator=(ApplyConstantPhreaticMultiLinePressureProcess const&) = delete; + ApplyConstantPhreaticMultiLinePressureProcess(ApplyConstantPhreaticMultiLinePressureProcess const&) = delete; + + /// this function is designed for being called at the beginning of the computations + /// right after reading the model and the groups + void ExecuteInitialize() override; + + std::string Info() const override; + void PrintInfo(std::ostream& rOStream) const override; + const std::string& VariableName() const; + bool IsFixed() const; + bool IsSeepage() const; + unsigned int GravityDirection() const; + double SpecificWeight() const; + unsigned int OutOfPlaneDirection() const; + unsigned int HorizontalDirection() const; + const Vector& HorizontalDirectionCoordinates() const; + const Vector& GravityDirectionCoordinates() const; + const Vector& XCoordinates() const; + const Vector& YCoordinates() const; + const Vector& ZCoordinates() const; + double PressureTensionCutOff() const; + +protected: + ModelPart& mrModelPart; + int findIndex(const Node& rNode) const; + double CalculatePressure(const Node &rNode) const; + +private: + std::string mVariableName; + bool mIsFixed; + bool mIsSeepage; + unsigned int mGravityDirection; + double mSpecificWeight; + unsigned int mOutOfPlaneDirection; + unsigned int mHorizontalDirection; + Vector mHorizontalDirectionCoordinates; + Vector mGravityDirectionCoordinates; + Vector mXCoordinates; + Vector mYCoordinates; + Vector mZCoordinates; + double mPressureTensionCutOff; + + void InitializeHorizontalDirection(); + void InitializeGravityDirection(const Parameters &rParameters); + void InitializeCoordinates(const Parameters &rParameters); + void ValidateCoordinates(const Parameters &rParameters) const; + + void InitializeParameters(Parameters &rParameters) const; +}; // Class ApplyConstantPhreaticMultiLinePressureProcess + +/// input stream function +inline std::istream& operator >> (std::istream& rIStream, + ApplyConstantPhreaticMultiLinePressureProcess& rThis); + +/// output stream function +inline std::ostream& operator << (std::ostream& rOStream, + const ApplyConstantPhreaticMultiLinePressureProcess& rThis) +{ + rThis.PrintInfo(rOStream); + rOStream << std::endl; + rThis.PrintData(rOStream); + + return rOStream; +} + +} // namespace Kratos. \ No newline at end of file diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp deleted file mode 100644 index 54e1445c0b7c..000000000000 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp +++ /dev/null @@ -1,346 +0,0 @@ -// KRATOS___ -// // ) ) -// // ___ ___ -// // ____ //___) ) // ) ) -// // / / // // / / -// ((____/ / ((____ ((___/ / MECHANICS -// -// License: geo_mechanics_application/license.txt -// -// Main authors: Vahid Galavi -// Jonathan Nuttall - -#if !defined(KRATOS_GEO_APPLY_CONSTANT_PHREATIC_MULTI_LINE_PRESSURE_PROCESS ) -#define KRATOS_GEO_APPLY_CONSTANT_PHREATIC_MULTI_LINE_PRESSURE_PROCESS - -#include -#include "includes/kratos_flags.h" -#include "includes/kratos_parameters.h" -#include "processes/process.h" - -#include "geo_mechanics_application_variables.h" - -namespace Kratos -{ - -class ApplyConstantPhreaticMultiLinePressureProcess : public Process -{ - -public: - - KRATOS_CLASS_POINTER_DEFINITION(ApplyConstantPhreaticMultiLinePressureProcess); - -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - /// Constructor - ApplyConstantPhreaticMultiLinePressureProcess(ModelPart& model_part, - Parameters rParameters - ) : Process(Flags()) , mrModelPart(model_part) - { - KRATOS_TRY - - //only include validation with c++11 since raw_literals do not exist in c++03 - Parameters default_parameters( R"( - { - "model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME", - "variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME", - "is_fixed": false, - "is_seepage": false, - "gravity_direction": 1, - "out_of_plane_direction": 2, - "x_coordinates": [0.0,1.0], - "y_coordinates": [1.0,0.5], - "z_coordinates": [0.0,0.0], - "specific_weight" : 10000.0, - "pressure_tension_cut_off" : 0.0, - "table" : [0,1] - } )" ); - - // Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them - // So that an error is thrown if they don't exist - rParameters["x_coordinates"]; - rParameters["y_coordinates"]; - rParameters["z_coordinates"]; - rParameters["variable_name"]; - rParameters["model_part_name"]; - - // Now validate agains defaults -- this also ensures no type mismatch - rParameters.ValidateAndAssignDefaults(default_parameters); - - mVariableName = rParameters["variable_name"].GetString(); - mIsFixed = rParameters["is_fixed"].GetBool(); - mIsSeepage = rParameters["is_seepage"].GetBool(); - mGravityDirection = rParameters["gravity_direction"].GetInt(); - mOutOfPlaneDirection = rParameters["out_of_plane_direction"].GetInt(); - if (GravityDirection() == OutOfPlaneDirection()) - KRATOS_ERROR << "Gravity direction cannot be the same as Out-of-Plane directions" - << rParameters - << std::endl; - - mHorizontalDirection = 0; - for (unsigned int i=0; i &var = KratosComponents< Variable >::Get(VariableName()); - - if (IsSeepage()) { - block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { - const double pressure = CalculatePressure(rNode); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { - rNode.FastGetSolutionStepValue(var) = pressure; - if (IsFixed()) rNode.Fix(var); - } else { - rNode.Free(var); - } - }); - } else { - block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { - if (IsFixed()) rNode.Fix(var); - else rNode.Free(var); - const double pressure = CalculatePressure(rNode); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { - rNode.FastGetSolutionStepValue(var) = pressure; - } else { - rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); - } - }); - } - - KRATOS_CATCH("") - } - - /// Turn back information as a string. - std::string Info() const override - { - return "ApplyConstantPhreaticMultiLinePressureProcess"; - } - - /// Print information about this object. - void PrintInfo(std::ostream& rOStream) const override - { - rOStream << "ApplyConstantPhreaticMultiLinePressureProcess"; - } - - const std::string& VariableName() const - { - return mVariableName; - } - - bool IsFixed() const - { - return mIsFixed; - } - - bool IsSeepage() const - { - return mIsSeepage; - } - - unsigned int GravityDirection() const - { - return mGravityDirection; - } - - double SpecificWeight() const - { - return mSpecificWeight; - } - - unsigned int OutOfPlaneDirection() const - { - return mOutOfPlaneDirection; - } - - unsigned int HorizontalDirection() const - { - return mHorizontalDirection; - } - - const Vector& HorizontalDirectionCoordinates() const - { - return mHorizontalDirectionCoordinates; - } - - const Vector& GravityDirectionCoordinates() const - { - return mGravityDirectionCoordinates; - } - - const Vector& XCoordinates() const - { - return mXCoordinates; - } - - const Vector& YCoordinates() const - { - return mYCoordinates; - } - - const Vector& ZCoordinates() const - { - return mZCoordinates; - } - - double PressureTensionCutOff() const - { - return mPressureTensionCutOff; - } - -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -protected: - - /// Member Variables - - ModelPart& mrModelPart; - - int findIndex(const Node& rNode) const - { - int index = 0; - auto coords = rNode.Coordinates(); - auto noCoordinates = static_cast(HorizontalDirectionCoordinates().size()); - for ( ; index < noCoordinates; ++index) - { - if (HorizontalDirectionCoordinates()[index] >= coords[HorizontalDirection()]) - { - if (index == 0) - { - return 0; - } - else - { - return index - 1; - } - } - } - return noCoordinates - 1; - - } - - double CalculatePressure(const Node &rNode) const - { - double height = 0.0; - int firstPointIndex; - int secondPointIndex; - double slope; - - // find nodes in horizontalDirectionCoordinates - - firstPointIndex = findIndex(rNode); - secondPointIndex = firstPointIndex + 1; - - slope = (GravityDirectionCoordinates()[secondPointIndex] - GravityDirectionCoordinates()[firstPointIndex]) / - (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); - - height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + GravityDirectionCoordinates()[firstPointIndex]; - - const double distance = height - rNode.Coordinates()[GravityDirection()]; - const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; - return pressure; - } - -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -private: - std::string mVariableName; - bool mIsFixed; - bool mIsSeepage; - unsigned int mGravityDirection; - double mSpecificWeight; - unsigned int mOutOfPlaneDirection; - unsigned int mHorizontalDirection; - Vector mHorizontalDirectionCoordinates; - Vector mGravityDirectionCoordinates; - Vector mXCoordinates; - Vector mYCoordinates; - Vector mZCoordinates; - double mPressureTensionCutOff; -}; // Class ApplyConstantPhreaticMultiLinePressureProcess - -/// input stream function -inline std::istream& operator >> (std::istream& rIStream, - ApplyConstantPhreaticMultiLinePressureProcess& rThis); - -/// output stream function -inline std::ostream& operator << (std::ostream& rOStream, - const ApplyConstantPhreaticMultiLinePressureProcess& rThis) -{ - rThis.PrintInfo(rOStream); - rOStream << std::endl; - rThis.PrintData(rOStream); - - return rOStream; -} - -} // namespace Kratos. - -#endif /* KRATOS_GEO_APPLY_CONSTANT_PHREATIC_MULTI_LINE_PRESSURE_PROCESS defined */ diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp index dfe3c7464d6d..e8e6e75a43c4 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp @@ -15,7 +15,7 @@ #include "includes/table.h" -#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp" +#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.h" #include "geo_mechanics_application_variables.h" namespace Kratos diff --git a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp index 225772897ee1..f008fb88ad66 100644 --- a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp +++ b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp @@ -25,7 +25,7 @@ #include "custom_processes/apply_constant_boundary_hydrostatic_pressure_process.hpp" #include "custom_processes/apply_boundary_hydrostatic_pressure_table_process.hpp" #include "custom_processes/apply_constant_phreatic_line_pressure_process.hpp" -#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.hpp" +#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.h" #include "custom_processes/apply_phreatic_line_pressure_table_process.hpp" #include "custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp" #include "custom_processes/apply_constant_boundary_phreatic_line_pressure_process.hpp" From 4a0c5afc368d83d747c7c0db28a0d0540edbb4a9 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Mon, 9 Oct 2023 17:03:45 +0200 Subject: [PATCH 19/27] Cleaned up the phreatic multi line pressure table process --- ...atic_multi_line_pressure_table_process.cpp | 125 ++++++++++++ ...reatic_multi_line_pressure_table_process.h | 64 +++++++ ...atic_multi_line_pressure_table_process.hpp | 180 ------------------ .../add_custom_processes_to_python.cpp | 9 +- 4 files changed, 193 insertions(+), 185 deletions(-) create mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp create mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h delete mode 100644 applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp new file mode 100644 index 000000000000..c62a18759e22 --- /dev/null +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp @@ -0,0 +1,125 @@ +// KRATOS___ +// // ) ) +// // ___ ___ +// // ____ //___) ) // ) ) +// // / / // // / / +// ((____/ / ((____ ((___/ / MECHANICS +// +// License: geo_mechanics_application/license.txt +// +// Main authors: Vahid Galavi +// Jonathan Nuttall + +#include "apply_phreatic_multi_line_pressure_table_process.h" +#include "geo_mechanics_application_variables.h" + +namespace Kratos +{ + +ApplyPhreaticMultiLinePressureTableProcess::ApplyPhreaticMultiLinePressureTableProcess(ModelPart& model_part, +Parameters rParameters +) : ApplyConstantPhreaticMultiLinePressureProcess(model_part, rParameters) +{ + KRATOS_TRY + + for (auto value : rParameters["table"].GetVector()) + { + const auto TableId = static_cast(value); + if (TableId > 0) + { + auto pTable = model_part.pGetTable(TableId); + mpTable.push_back(pTable); + } + else + { + mpTable.push_back(nullptr); + } + } + + mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER]; + + KRATOS_CATCH("") +} + +void ApplyPhreaticMultiLinePressureTableProcess::ExecuteInitializeSolutionStep() +{ + KRATOS_TRY + + if (mrModelPart.NumberOfNodes() <= 0) { + return; + } + + const Variable &var = KratosComponents< Variable >::Get(VariableName()); + + const double Time = mrModelPart.GetProcessInfo()[TIME]/mTimeUnitConverter; + std::vector deltaH; + std::transform(mpTable.begin(), mpTable.end(), std::back_inserter(deltaH), + [Time](auto element){return element ? element->GetValue(Time) : 0.0;}); + + if (IsSeepage()) { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { + const double pressure = CalculateTimeDependentPressure(rNode, deltaH); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { + rNode.FastGetSolutionStepValue(var) = pressure; + if (IsFixed()) rNode.Fix(var); + } else { + rNode.Free(var); + } + }); + } else { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { + const double pressure = CalculateTimeDependentPressure(rNode, deltaH); + + if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { + rNode.FastGetSolutionStepValue(var) = pressure; + } else { + rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); + } + }); + } + + KRATOS_CATCH("") +} + +std::string ApplyPhreaticMultiLinePressureTableProcess::Info() const +{ + return "ApplyPhreaticMultiLinePressureTableProcess"; +} + +void ApplyPhreaticMultiLinePressureTableProcess::PrintInfo(std::ostream &rOStream) const +{ + rOStream << "ApplyPhreaticMultiLinePressureTableProcess"; +} + +double ApplyPhreaticMultiLinePressureTableProcess::CalculateTimeDependentPressure(const Node &rNode, + std::vector &deltaH) const +{ + + double height = 0.0; + int firstPointIndex; + int secondPointIndex; + double slope; + array_1d y; + + // find nodes in horizontalDirectionCoordinates + + firstPointIndex = findIndex(rNode); + secondPointIndex = firstPointIndex + 1; + + y[0] = deltaH[firstPointIndex] + GravityDirectionCoordinates()[firstPointIndex]; + y[1] = deltaH[secondPointIndex] + GravityDirectionCoordinates()[secondPointIndex]; + + slope = (y[1] - y[0]) + / (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); + + + height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + y[0]; + + const double distance = height - rNode.Coordinates()[GravityDirection()]; + const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; + return pressure; +} + + +} diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h new file mode 100644 index 000000000000..d76196bd7a38 --- /dev/null +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h @@ -0,0 +1,64 @@ +// KRATOS___ +// // ) ) +// // ___ ___ +// // ____ //___) ) // ) ) +// // / / // // / / +// ((____/ / ((____ ((___/ / MECHANICS +// +// License: geo_mechanics_application/license.txt +// +// Main authors: Vahid Galavi +// Jonathan Nuttall + +#pragma once + +#include "includes/table.h" + +#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.h" + +namespace Kratos +{ + +class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticMultiLinePressureProcess +{ + +public: + + KRATOS_CLASS_POINTER_DEFINITION(ApplyPhreaticMultiLinePressureTableProcess); + + ApplyPhreaticMultiLinePressureTableProcess(ModelPart& model_part, Parameters rParameters); + ~ApplyPhreaticMultiLinePressureTableProcess() override = default; + ApplyPhreaticMultiLinePressureTableProcess& operator=(ApplyPhreaticMultiLinePressureTableProcess const&) = delete; + ApplyPhreaticMultiLinePressureTableProcess(ApplyPhreaticMultiLinePressureTableProcess const&) = delete; + + /// this function will be executed at every time step BEFORE performing the solve phase + void ExecuteInitializeSolutionStep() override; + std::string Info() const override; + void PrintInfo(std::ostream& rOStream) const override; + +private: + using TableType = Table; + std::vector mpTable; + double mTimeUnitConverter; + + double CalculateTimeDependentPressure(const Node &rNode, std::vector &deltaH) const; +}; // Class ApplyPhreaticMultiLinePressureTableProcess + +/// input stream function +inline std::istream& operator >> (std::istream& rIStream, + ApplyPhreaticMultiLinePressureTableProcess& rThis); + +/// output stream function +inline std::ostream& operator << (std::ostream& rOStream, + const ApplyPhreaticMultiLinePressureTableProcess& rThis) +{ + rThis.PrintInfo(rOStream); + rOStream << std::endl; + rThis.PrintData(rOStream); + + return rOStream; +} + + +} // namespace Kratos. + diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp deleted file mode 100644 index e8e6e75a43c4..000000000000 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp +++ /dev/null @@ -1,180 +0,0 @@ -// KRATOS___ -// // ) ) -// // ___ ___ -// // ____ //___) ) // ) ) -// // / / // // / / -// ((____/ / ((____ ((___/ / MECHANICS -// -// License: geo_mechanics_application/license.txt -// -// Main authors: Vahid Galavi -// - -#if !defined(KRATOS_GEO_APPLY_PHREATIC_MULTI_LINE_PRESSURE_TABLE_PROCESS ) -#define KRATOS_GEO_APPLY_PHREATIC_MULTI_LINE_PRESSURE_TABLE_PROCESS - -#include "includes/table.h" - -#include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.h" -#include "geo_mechanics_application_variables.h" - -namespace Kratos -{ - -class ApplyPhreaticMultiLinePressureTableProcess : public ApplyConstantPhreaticMultiLinePressureProcess -{ - -public: - - KRATOS_CLASS_POINTER_DEFINITION(ApplyPhreaticMultiLinePressureTableProcess); - - /// Defining a table with double argument and result type as table type. - using TableType = Table; - -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - /// Constructor - ApplyPhreaticMultiLinePressureTableProcess(ModelPart& model_part, - Parameters rParameters - ) : ApplyConstantPhreaticMultiLinePressureProcess(model_part, rParameters) - { - KRATOS_TRY - - for (auto value : rParameters["table"].GetVector()) - { - const auto TableId = static_cast(value); - if (TableId > 0) { - auto pTable = model_part.pGetTable(TableId); - mpTable.push_back(pTable); - } else { - mpTable.push_back(nullptr); - } - } - - mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER]; - - KRATOS_CATCH("") - } - - ///------------------------------------------------------------------------------------ - - /// Destructor - ~ApplyPhreaticMultiLinePressureTableProcess() override = default; - - /// Assignment operator. - ApplyPhreaticMultiLinePressureTableProcess& operator=(ApplyPhreaticMultiLinePressureTableProcess const&) = delete; - - /// Copy constructor. - ApplyPhreaticMultiLinePressureTableProcess(ApplyPhreaticMultiLinePressureTableProcess const&) = delete; - -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - /// this function will be executed at every time step BEFORE performing the solve phase - void ExecuteInitializeSolutionStep() override - { - KRATOS_TRY - - if (mrModelPart.NumberOfNodes() <= 0) { - return; - } - - const Variable &var = KratosComponents< Variable >::Get(VariableName()); - - const double Time = mrModelPart.GetProcessInfo()[TIME]/mTimeUnitConverter; - std::vector deltaH; - std::transform(mpTable.begin(), mpTable.end(), std::back_inserter(deltaH), - [Time](auto element){return element ? element->GetValue(Time) : 0.0;}); - - if (IsSeepage()) { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { - const double pressure = CalculateTimeDependentPressure(rNode, deltaH); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { - rNode.FastGetSolutionStepValue(var) = pressure; - if (IsFixed()) rNode.Fix(var); - } else { - rNode.Free(var); - } - }); - } else { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { - const double pressure = CalculateTimeDependentPressure(rNode, deltaH); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { - rNode.FastGetSolutionStepValue(var) = pressure; - } else { - rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); - } - }); - } - - KRATOS_CATCH("") - } - - /// Turn back information as a string. - std::string Info() const override - { - return "ApplyPhreaticMultiLinePressureTableProcess"; - } - - /// Print information about this object. - void PrintInfo(std::ostream& rOStream) const override - { - rOStream << "ApplyPhreaticMultiLinePressureTableProcess"; - } - -///---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -protected: - double CalculateTimeDependentPressure(const Node &rNode, std::vector &deltaH) const - { - - double height = 0.0; - int firstPointIndex; - int secondPointIndex; - double slope; - array_1d y; - - // find nodes in horizontalDirectionCoordinates - - firstPointIndex = findIndex(rNode); - secondPointIndex = firstPointIndex + 1; - - y[0] = deltaH[firstPointIndex] + GravityDirectionCoordinates()[firstPointIndex]; - y[1] = deltaH[secondPointIndex] + GravityDirectionCoordinates()[secondPointIndex]; - - slope = (y[1] - y[0]) - / (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); - - - height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + y[0]; - - const double distance = height - rNode.Coordinates()[GravityDirection()]; - const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; - return pressure; - } - -private: - std::vector mpTable; - double mTimeUnitConverter; -}; // Class ApplyPhreaticMultiLinePressureTableProcess - -/// input stream function -inline std::istream& operator >> (std::istream& rIStream, - ApplyPhreaticMultiLinePressureTableProcess& rThis); - -/// output stream function -inline std::ostream& operator << (std::ostream& rOStream, - const ApplyPhreaticMultiLinePressureTableProcess& rThis) -{ - rThis.PrintInfo(rOStream); - rOStream << std::endl; - rThis.PrintData(rOStream); - - return rOStream; -} - - -} // namespace Kratos. - -#endif /* KRATOS_GEO_APPLY_PHREATIC_MULTI_LINE_PRESSURE_TABLE_PROCESS defined */ \ No newline at end of file diff --git a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp index f008fb88ad66..23376d80e84f 100644 --- a/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp +++ b/applications/GeoMechanicsApplication/custom_python/add_custom_processes_to_python.cpp @@ -27,7 +27,7 @@ #include "custom_processes/apply_constant_phreatic_line_pressure_process.hpp" #include "custom_processes/apply_constant_phreatic_multi_line_pressure_process.h" #include "custom_processes/apply_phreatic_line_pressure_table_process.hpp" -#include "custom_processes/apply_phreatic_multi_line_pressure_table_process.hpp" +#include "custom_processes/apply_phreatic_multi_line_pressure_table_process.h" #include "custom_processes/apply_constant_boundary_phreatic_line_pressure_process.hpp" #include "custom_processes/apply_boundary_phreatic_line_pressure_table_process.hpp" #include "custom_processes/apply_constant_phreatic_surface_pressure_process.hpp" @@ -45,8 +45,8 @@ #include "custom_processes/set_multiple_moving_loads.h" #include "custom_processes/apply_vector_constraints_table_process.hpp" -namespace Kratos { -namespace Python { +namespace Kratos::Python +{ void AddCustomProcessesToPython(pybind11::module& m) { @@ -153,5 +153,4 @@ void AddCustomProcessesToPython(pybind11::module& m) .def(py::init()); } -} // Namespace Python. -} // Namespace Kratos +} // Namespace Kratos::Python. From 18375304d73a3c707a5170a7df6af4889b642cdf Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 10 Oct 2023 09:10:36 +0200 Subject: [PATCH 20/27] Remove unnecessary if statement for default parameter --- .../apply_constant_phreatic_multi_line_pressure_process.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp index 4193adcccec6..b8b29da4d134 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp @@ -27,10 +27,7 @@ ApplyConstantPhreaticMultiLinePressureProcess::ApplyConstantPhreaticMultiLinePre mIsFixed = rParameters["is_fixed"].GetBool(); mIsSeepage = rParameters["is_seepage"].GetBool(); mSpecificWeight = rParameters["specific_weight"].GetDouble(); - if (rParameters.Has("pressure_tension_cut_off")) - mPressureTensionCutOff = rParameters["pressure_tension_cut_off"].GetDouble(); - else - mPressureTensionCutOff = 0.0; + mPressureTensionCutOff = rParameters["pressure_tension_cut_off"].GetDouble(); mOutOfPlaneDirection = rParameters["out_of_plane_direction"].GetInt(); InitializeCoordinates(rParameters); From 86e43098d12f2389351e5d1060b3fd24d8d750af Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 10 Oct 2023 11:22:22 +0200 Subject: [PATCH 21/27] Made new classes more consistent with already existing classes and removed duplicate code --- ...t_phreatic_multi_line_pressure_process.cpp | 64 ++++++++++--------- ...ant_phreatic_multi_line_pressure_process.h | 4 +- ...atic_multi_line_pressure_table_process.cpp | 59 ++++------------- ...reatic_multi_line_pressure_table_process.h | 2 - 4 files changed, 47 insertions(+), 82 deletions(-) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp index b8b29da4d134..559927861146 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.cpp @@ -25,6 +25,7 @@ ApplyConstantPhreaticMultiLinePressureProcess::ApplyConstantPhreaticMultiLinePre mVariableName = rParameters["variable_name"].GetString(); mIsFixed = rParameters["is_fixed"].GetBool(); + mIsFixedProvided = rParameters.Has("is_fixed"); mIsSeepage = rParameters["is_seepage"].GetBool(); mSpecificWeight = rParameters["specific_weight"].GetDouble(); mPressureTensionCutOff = rParameters["pressure_tension_cut_off"].GetDouble(); @@ -140,33 +141,21 @@ void ApplyConstantPhreaticMultiLinePressureProcess::ExecuteInitialize() const Variable &var = KratosComponents< Variable >::Get(VariableName()); - if (IsSeepage()) { - block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { - const double pressure = CalculatePressure(rNode); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) - { + block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { + const double pressure = CalculatePressure(rNode); + if (IsSeepage()) { + if (pressure < PORE_PRESSURE_SIGN_FACTOR * PressureTensionCutOff()) { rNode.FastGetSolutionStepValue(var) = pressure; if (IsFixed()) rNode.Fix(var); + } else { + if (IsFixedProvided()) rNode.Free(var); } - else { - rNode.Free(var); - } - }); - } else { - block_for_each(mrModelPart.Nodes(), [&var, this](Node& rNode) { + } else { if (IsFixed()) rNode.Fix(var); - else rNode.Free(var); - - const double pressure = CalculatePressure(rNode); - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { - rNode.FastGetSolutionStepValue(var) = pressure; - } - else { - rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); - } - }); - } + else if (IsFixedProvided()) rNode.Free(var); + rNode.FastGetSolutionStepValue(var) = std::min(pressure, PORE_PRESSURE_SIGN_FACTOR * PressureTensionCutOff()); + } + }); KRATOS_CATCH("") } @@ -191,6 +180,11 @@ bool ApplyConstantPhreaticMultiLinePressureProcess::IsFixed() const return mIsFixed; } +bool ApplyConstantPhreaticMultiLinePressureProcess::IsFixedProvided() const +{ + return mIsFixedProvided; +} + bool ApplyConstantPhreaticMultiLinePressureProcess::IsSeepage() const { return mIsSeepage; @@ -261,22 +255,30 @@ int ApplyConstantPhreaticMultiLinePressureProcess::findIndex(const Node &rNode) return number_of_coordinates - 1; } -double ApplyConstantPhreaticMultiLinePressureProcess::CalculatePressure(const Node &rNode) const +double ApplyConstantPhreaticMultiLinePressureProcess::CalculatePressure(const Node &rNode, + std::vector deltaH) const { - double height = 0.0; - // find nodes in horizontalDirectionCoordinates const int firstPointIndex = findIndex(rNode); const int secondPointIndex = firstPointIndex + 1; - const double slope = (GravityDirectionCoordinates()[secondPointIndex] - GravityDirectionCoordinates()[firstPointIndex]) / - (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); + array_1d y; + y[0] = GravityDirectionCoordinates()[firstPointIndex]; + y[1] = GravityDirectionCoordinates()[secondPointIndex]; + + if (!deltaH.empty()) + { + y[0] += deltaH[firstPointIndex]; + y[1] += deltaH[secondPointIndex]; + } + - height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + GravityDirectionCoordinates()[firstPointIndex]; + const double slope = (y[1] - y[0]) + / (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); + const double height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + y[0]; const double distance = height - rNode.Coordinates()[GravityDirection()]; - const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; - return pressure; + return - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; } } \ No newline at end of file diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h index baf62ee7819c..a66038c3cd18 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h +++ b/applications/GeoMechanicsApplication/custom_processes/apply_constant_phreatic_multi_line_pressure_process.h @@ -52,15 +52,17 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyConstantPhreaticMultiLinePressu const Vector& YCoordinates() const; const Vector& ZCoordinates() const; double PressureTensionCutOff() const; + bool IsFixedProvided() const; protected: ModelPart& mrModelPart; int findIndex(const Node& rNode) const; - double CalculatePressure(const Node &rNode) const; + double CalculatePressure(const Node& rNode, std::vector deltaH = {}) const; private: std::string mVariableName; bool mIsFixed; + bool mIsFixedProvided; bool mIsSeepage; unsigned int mGravityDirection; double mSpecificWeight; diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp index c62a18759e22..053e38e9a497 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.cpp @@ -56,28 +56,21 @@ void ApplyPhreaticMultiLinePressureTableProcess::ExecuteInitializeSolutionStep() std::transform(mpTable.begin(), mpTable.end(), std::back_inserter(deltaH), [Time](auto element){return element ? element->GetValue(Time) : 0.0;}); - if (IsSeepage()) { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { - const double pressure = CalculateTimeDependentPressure(rNode, deltaH); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < 0) { + block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { + const double pressure = CalculatePressure(rNode, deltaH); + if (IsSeepage()) { + if (pressure < PORE_PRESSURE_SIGN_FACTOR * PressureTensionCutOff()) { rNode.FastGetSolutionStepValue(var) = pressure; if (IsFixed()) rNode.Fix(var); } else { - rNode.Free(var); + if (IsFixedProvided()) rNode.Free(var); } - }); - } else { - block_for_each(mrModelPart.Nodes(), [&var, &deltaH, this](Node& rNode) { - const double pressure = CalculateTimeDependentPressure(rNode, deltaH); - - if ((PORE_PRESSURE_SIGN_FACTOR * pressure) < PressureTensionCutOff()) { - rNode.FastGetSolutionStepValue(var) = pressure; - } else { - rNode.FastGetSolutionStepValue(var) = PressureTensionCutOff(); - } - }); - } + } else { + if (IsFixed()) rNode.Fix(var); + else if (IsFixedProvided()) rNode.Free(var); + rNode.FastGetSolutionStepValue(var) = std::min(pressure, PORE_PRESSURE_SIGN_FACTOR * PressureTensionCutOff()); + } + }); KRATOS_CATCH("") } @@ -92,34 +85,4 @@ void ApplyPhreaticMultiLinePressureTableProcess::PrintInfo(std::ostream &rOStrea rOStream << "ApplyPhreaticMultiLinePressureTableProcess"; } -double ApplyPhreaticMultiLinePressureTableProcess::CalculateTimeDependentPressure(const Node &rNode, - std::vector &deltaH) const -{ - - double height = 0.0; - int firstPointIndex; - int secondPointIndex; - double slope; - array_1d y; - - // find nodes in horizontalDirectionCoordinates - - firstPointIndex = findIndex(rNode); - secondPointIndex = firstPointIndex + 1; - - y[0] = deltaH[firstPointIndex] + GravityDirectionCoordinates()[firstPointIndex]; - y[1] = deltaH[secondPointIndex] + GravityDirectionCoordinates()[secondPointIndex]; - - slope = (y[1] - y[0]) - / (HorizontalDirectionCoordinates()[secondPointIndex] - HorizontalDirectionCoordinates()[firstPointIndex]); - - - height = slope * (rNode.Coordinates()[HorizontalDirection()] - HorizontalDirectionCoordinates()[firstPointIndex]) + y[0]; - - const double distance = height - rNode.Coordinates()[GravityDirection()]; - const double pressure = - PORE_PRESSURE_SIGN_FACTOR * SpecificWeight() * distance; - return pressure; -} - - } diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h index d76196bd7a38..412a77c0425d 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h +++ b/applications/GeoMechanicsApplication/custom_processes/apply_phreatic_multi_line_pressure_table_process.h @@ -40,8 +40,6 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyPhreaticMultiLinePressureTableP using TableType = Table; std::vector mpTable; double mTimeUnitConverter; - - double CalculateTimeDependentPressure(const Node &rNode, std::vector &deltaH) const; }; // Class ApplyPhreaticMultiLinePressureTableProcess /// input stream function From cdab328251d331017350bd9e22a4effd999a99ec Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Tue, 10 Oct 2023 13:38:26 +0200 Subject: [PATCH 22/27] Added the multiline processes to the new C++ class for apply scalar constraints table process --- ...apply_scalar_constraints_table_process.cpp | 29 +++++++++++++++++++ .../apply_scalar_constraints_table_process.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.cpp b/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.cpp index 3981c7897448..8d6966f94c69 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.cpp +++ b/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.cpp @@ -21,6 +21,7 @@ #include "apply_constant_interpolate_line_pressure_process.hpp" #include "apply_constant_phreatic_surface_pressure_process.hpp" #include "apply_phreatic_surface_pressure_table_process.hpp" +#include "apply_phreatic_multi_line_pressure_table_process.h" namespace { @@ -96,6 +97,8 @@ void ApplyScalarConstraintsTableProcess::MakeProcessForFluidPressureType(const P MakeProcessForHydrostaticFluidPressure(rProcessSettings, std::move(NamesOfSettingsToCopy)); } else if (fluid_pressure_type == "Phreatic_Line") { MakeProcessForPhreaticLine(rProcessSettings, std::move(NamesOfSettingsToCopy)); + } else if (fluid_pressure_type == "Phreatic_Multi_Line") { + MakeProcessForPhreaticMultiLine(rProcessSettings, std::move(NamesOfSettingsToCopy)); } else if (fluid_pressure_type == "Interpolate_Line") { MakeProcessForInterpolatedLine(rProcessSettings, std::move(NamesOfSettingsToCopy)); } else if (fluid_pressure_type == "Phreatic_Surface") { @@ -166,6 +169,32 @@ void ApplyScalarConstraintsTableProcess::MakeProcessForPhreaticLine(const Parame } } +void ApplyScalarConstraintsTableProcess::MakeProcessForPhreaticMultiLine(const Parameters& rProcessSettings, + std::vector NamesOfSettingsToCopy) +{ + NamesOfSettingsToCopy.insert(NamesOfSettingsToCopy.end(), {"gravity_direction", + "out_of_plane_direction", + "x_coordinates", + "y_coordinates", + "z_coordinates", + "specific_weight"}); + AppendParameterNameIfExists("pressure_tension_cut_off", rProcessSettings, NamesOfSettingsToCopy); + AppendParameterNameIfExists("is_seepage", rProcessSettings, NamesOfSettingsToCopy); + + if (HasTableAttached(rProcessSettings)) { + NamesOfSettingsToCopy.emplace_back("table"); + mProcess = std::make_unique(mrModelPart, + ExtractParameters(rProcessSettings, + NamesOfSettingsToCopy)); + } + else + { + mProcess = std::make_unique(mrModelPart, + ExtractParameters(rProcessSettings, + NamesOfSettingsToCopy)); + } +} + void ApplyScalarConstraintsTableProcess::MakeProcessForPhreaticSurface(const Parameters& rProcessSettings, std::vector NamesOfSettingsToCopy) { diff --git a/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.h b/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.h index ae2cbbb2d77b..5704fd79bd41 100644 --- a/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.h +++ b/applications/GeoMechanicsApplication/custom_processes/apply_scalar_constraints_table_process.h @@ -49,6 +49,8 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyScalarConstraintsTableProcess : std::vector NamesOfSettingsToCopy); void MakeProcessForPhreaticLine(const Parameters& rProcessSettings, std::vector NamesOfSettingsToCopy); + void MakeProcessForPhreaticMultiLine(const Parameters& rProcessSettings, + std::vector NamesOfSettingsToCopy); void MakeProcessForPhreaticSurface(const Parameters& rProcessSettings, std::vector NamesOfSettingsToCopy); void MakeProcessForInterpolatedLine(const Parameters& rProcessSettings, From 413ebde9642d7add168307a20b252eeb9fe03de3 Mon Sep 17 00:00:00 2001 From: Richard Faasse Date: Wed, 11 Oct 2023 15:53:44 +0200 Subject: [PATCH 23/27] Cleaned up the tests and reverted some test_helper functionality that's no longer needed --- .../tests/test_helper.py | 72 ++++++--- .../MaterialParameters.json | 0 .../ProjectParameters.json | 6 +- .../test_inclined_phreatic_line.mdpa} | 0 .../MaterialParameters.json | 0 .../ProjectParameters.json | 6 +- ...nclined_phreatic_line_time_dependent.mdpa} | 0 .../MaterialParameters.json | 0 .../ProjectParameters.json | 6 +- ...tic_multi_line_time_dependent_centre.mdpa} | 0 .../MaterialParameters.json | 0 .../ProjectParameters.json | 6 +- ...atic_multi_line_time_dependent_edges.mdpa} | 0 .../tests/test_water_pressure.py | 146 +++++++++--------- 14 files changed, 139 insertions(+), 103 deletions(-) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_line.gid => test_inclined_phreatic_line.gid}/MaterialParameters.json (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_line.gid => test_inclined_phreatic_line.gid}/ProjectParameters.json (97%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_line.gid/test_inclinded_phreatic_line.mdpa => test_inclined_phreatic_line.gid/test_inclined_phreatic_line.mdpa} (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_line_time_dependent.gid => test_inclined_phreatic_line_time_dependent.gid}/MaterialParameters.json (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_line_time_dependent.gid => test_inclined_phreatic_line_time_dependent.gid}/ProjectParameters.json (97%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_line_time_dependent.gid/test_inclinded_phreatic_line_time_dependent.mdpa => test_inclined_phreatic_line_time_dependent.gid/test_inclined_phreatic_line_time_dependent.mdpa} (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent_centre.gid => test_inclined_phreatic_multi_line_time_dependent_centre.gid}/MaterialParameters.json (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent_centre.gid => test_inclined_phreatic_multi_line_time_dependent_centre.gid}/ProjectParameters.json (96%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent_centre.gid/test_inclinded_phreatic_multi_line_time_dependent_centre.mdpa => test_inclined_phreatic_multi_line_time_dependent_centre.gid/test_inclined_phreatic_multi_line_time_dependent_centre.mdpa} (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent_edges.gid => test_inclined_phreatic_multi_line_time_dependent_edges.gid}/MaterialParameters.json (100%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent_edges.gid => test_inclined_phreatic_multi_line_time_dependent_edges.gid}/ProjectParameters.json (96%) rename applications/GeoMechanicsApplication/tests/{test_inclinded_phreatic_multi_line_time_dependent_edges.gid/test_inclinded_phreatic_multi_line_time_dependent_edges.mdpa => test_inclined_phreatic_multi_line_time_dependent_edges.gid/test_inclined_phreatic_multi_line_time_dependent_edges.mdpa} (100%) diff --git a/applications/GeoMechanicsApplication/tests/test_helper.py b/applications/GeoMechanicsApplication/tests/test_helper.py index ea9f0114be67..4aa84f8be370 100644 --- a/applications/GeoMechanicsApplication/tests/test_helper.py +++ b/applications/GeoMechanicsApplication/tests/test_helper.py @@ -172,33 +172,51 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): # read data with open(filename, "r") as f: - all_lines = f.readlines() + all_data = f.readlines() - process_values = False - res = {} + add_var = False + + data = [] + time_steps = [] + all_var_data = [] # read all data at each time step of variable - for line in all_lines: - if not process_values: - if f'"{variable}"' in line: - time_step = float(line.split()[3]) - res[time_step] = {} - process_values = True - continue + for line in all_data: - if line.startswith("Values"): - continue + if "End Values" in line and add_var: + add_var = False + all_var_data.append(data) + data = [] + if add_var: + data.append(line) - if "End Values" in line: - process_values = False - continue + if r'"' + variable + r'"' in line: + time_step = float(line.split()[3]) - words = line.split() - node_index = int(words[0]) - values = [float(word) for word in words[1:]] - if len(values) == 1: - values = values[0] - res[time_step][node_index] = values + time_steps.append(time_step) + add_var=True + + # initialise results dictionary + res = {"time": time_steps} + + for var_data in all_var_data: + var_data.pop(0) + + # convert var data to floats + for i, _ in enumerate(var_data): + line = var_data[i].split() + line[1] = float(line[1]) + line[2] = float(line[2]) + line[3] = float(line[3]) + var_data[i] = line + + # add node numbers as dict keys + for line in var_data: + res[line[0]] = [] + + for var_data in all_var_data: + for line in var_data: + res[line[0]].append(line[1:]) return res @@ -510,3 +528,15 @@ def _strip_off_quotes(self, quoted_string): assert(quoted_string[0] == '"') assert(quoted_string[-1] == '"') return quoted_string[1:-1] + + @staticmethod + def get_values_at_time(time, property_results): + for time_results in property_results: + if time_results["time"] == time: + return time_results["values"] + + @staticmethod + def get_value_at_node(node, time_results): + for node_results in time_results: + if node_results["node"] == node: + return node_results["value"] diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line.gid/MaterialParameters.json similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line.gid/MaterialParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line.gid/MaterialParameters.json diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line.gid/ProjectParameters.json similarity index 97% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line.gid/ProjectParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line.gid/ProjectParameters.json index 62b6f11884a8..c01d45de6b00 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line.gid/ProjectParameters.json @@ -1,6 +1,6 @@ { "problem_data": { - "problem_name": "test_inclinded_phreatic_line", + "problem_name": "test_inclined_phreatic_line", "start_time": 0.0, "end_time": 1.0, "echo_level": 1, @@ -13,7 +13,7 @@ "domain_size": 2, "model_import_settings": { "input_type": "mdpa", - "input_filename": "test_inclinded_phreatic_line" + "input_filename": "test_inclined_phreatic_line" }, "material_import_settings": { "materials_filename": "MaterialParameters.json" @@ -79,7 +79,7 @@ "process_name": "GiDOutputProcess", "Parameters": { "model_part_name": "PorousDomain.porous_computational_model_part", - "output_name": "test_inclinded_phreatic_line", + "output_name": "test_inclined_phreatic_line", "postprocess_parameters": { "result_file_configuration": { "gidpost_flags": { diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line.gid/test_inclinded_phreatic_line.mdpa b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line.gid/test_inclined_phreatic_line.mdpa similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line.gid/test_inclinded_phreatic_line.mdpa rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line.gid/test_inclined_phreatic_line.mdpa diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line_time_dependent.gid/MaterialParameters.json similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/MaterialParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line_time_dependent.gid/MaterialParameters.json diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line_time_dependent.gid/ProjectParameters.json similarity index 97% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line_time_dependent.gid/ProjectParameters.json index 97d1ab5d6b43..687042f4b312 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line_time_dependent.gid/ProjectParameters.json @@ -1,6 +1,6 @@ { "problem_data": { - "problem_name": "test_inclinded_phreatic_line_time_dependent", + "problem_name": "test_inclined_phreatic_line_time_dependent", "start_time": 0.0, "end_time": 1.0, "echo_level": 1, @@ -13,7 +13,7 @@ "domain_size": 2, "model_import_settings": { "input_type": "mdpa", - "input_filename": "test_inclinded_phreatic_line_time_dependent" + "input_filename": "test_inclined_phreatic_line_time_dependent" }, "material_import_settings": { "materials_filename": "MaterialParameters.json" @@ -79,7 +79,7 @@ "process_name": "GiDOutputProcess", "Parameters": { "model_part_name": "PorousDomain.porous_computational_model_part", - "output_name": "test_inclinded_phreatic_line_time_dependent", + "output_name": "test_inclined_phreatic_line_time_dependent", "postprocess_parameters": { "result_file_configuration": { "gidpost_flags": { diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/test_inclinded_phreatic_line_time_dependent.mdpa b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line_time_dependent.gid/test_inclined_phreatic_line_time_dependent.mdpa similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_line_time_dependent.gid/test_inclinded_phreatic_line_time_dependent.mdpa rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_line_time_dependent.gid/test_inclined_phreatic_line_time_dependent.mdpa diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_centre.gid/MaterialParameters.json similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/MaterialParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_centre.gid/MaterialParameters.json diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json similarity index 96% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json index 6d03246f222c..a7aa322588fc 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_centre.gid/ProjectParameters.json @@ -1,6 +1,6 @@ { "problem_data": { - "problem_name": "test_inclinded_phreatic_multi_line_time_dependent_centre", + "problem_name": "test_inclined_phreatic_multi_line_time_dependent_centre", "start_time": 0.0, "end_time": 4.0, "echo_level": 1, @@ -13,7 +13,7 @@ "domain_size": 2, "model_import_settings": { "input_type": "mdpa", - "input_filename": "test_inclinded_phreatic_multi_line_time_dependent_centre" + "input_filename": "test_inclined_phreatic_multi_line_time_dependent_centre" }, "material_import_settings": { "materials_filename": "MaterialParameters.json" @@ -80,7 +80,7 @@ "process_name": "GiDOutputProcess", "Parameters": { "model_part_name": "PorousDomain.porous_computational_model_part", - "output_name": "test_inclinded_phreatic_multi_line_time_dependent_centre", + "output_name": "test_inclined_phreatic_multi_line_time_dependent_centre", "postprocess_parameters": { "result_file_configuration": { "gidpost_flags": { diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/test_inclinded_phreatic_multi_line_time_dependent_centre.mdpa b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_centre.gid/test_inclined_phreatic_multi_line_time_dependent_centre.mdpa similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_centre.gid/test_inclinded_phreatic_multi_line_time_dependent_centre.mdpa rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_centre.gid/test_inclined_phreatic_multi_line_time_dependent_centre.mdpa diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_edges.gid/MaterialParameters.json diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json similarity index 96% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json index a8b61af331cb..25e0ef307fc3 100644 --- a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json +++ b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_edges.gid/ProjectParameters.json @@ -1,6 +1,6 @@ { "problem_data": { - "problem_name": "test_inclinded_phreatic_multi_line_time_dependent_edges", + "problem_name": "test_inclined_phreatic_multi_line_time_dependent_edges", "start_time": 0.0, "end_time": 4.0, "echo_level": 1, @@ -13,7 +13,7 @@ "domain_size": 2, "model_import_settings": { "input_type": "mdpa", - "input_filename": "test_inclinded_phreatic_multi_line_time_dependent_edges" + "input_filename": "test_inclined_phreatic_multi_line_time_dependent_edges" }, "material_import_settings": { "materials_filename": "MaterialParameters.json" @@ -80,7 +80,7 @@ "process_name": "GiDOutputProcess", "Parameters": { "model_part_name": "PorousDomain.porous_computational_model_part", - "output_name": "test_inclinded_phreatic_multi_line_time_dependent_edges", + "output_name": "test_inclined_phreatic_multi_line_time_dependent_edges", "postprocess_parameters": { "result_file_configuration": { "gidpost_flags": { diff --git a/applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/test_inclinded_phreatic_multi_line_time_dependent_edges.mdpa b/applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_edges.gid/test_inclined_phreatic_multi_line_time_dependent_edges.mdpa similarity index 100% rename from applications/GeoMechanicsApplication/tests/test_inclinded_phreatic_multi_line_time_dependent_edges.gid/test_inclinded_phreatic_multi_line_time_dependent_edges.mdpa rename to applications/GeoMechanicsApplication/tests/test_inclined_phreatic_multi_line_time_dependent_edges.gid/test_inclined_phreatic_multi_line_time_dependent_edges.mdpa diff --git a/applications/GeoMechanicsApplication/tests/test_water_pressure.py b/applications/GeoMechanicsApplication/tests/test_water_pressure.py index c80237910141..5b4610067aa0 100644 --- a/applications/GeoMechanicsApplication/tests/test_water_pressure.py +++ b/applications/GeoMechanicsApplication/tests/test_water_pressure.py @@ -1,9 +1,9 @@ -import sys import os import KratosMultiphysics.KratosUnittest as KratosUnittest import test_helper +result_extension = '.post.res' class KratosGeoMechanicsWaterPressureTests(KratosUnittest.TestCase): """ @@ -20,11 +20,11 @@ def tearDown(self): def test_inclined_phreatic_line(self): """ - test hydrostatic water pressure under an inclided phreatic line ranging over the width of the geometry + test hydrostatic water pressure under an inclined phreatic line ranging over the width of the geometry :return: """ - test_name = 'test_inclinded_phreatic_line' + test_name = 'test_inclined_phreatic_line' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) simulation = test_helper.run_kratos(file_path) @@ -46,50 +46,51 @@ def test_inclined_phreatic_line(self): self.assertAlmostEqual(0, p_top_middle) self.assertAlmostEqual(0, p_top_right) - def test_inclined_phreatic_line_time(self): """ - test hydrostatic water pressure under an inclided phreatic line ranging over the width of the geometry + test hydrostatic water pressure under an inclined phreatic line ranging over the width of the geometry :return: """ - test_name = 'test_inclinded_phreatic_line_time_dependent' + test_name = 'test_inclined_phreatic_line_time_dependent' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) test_helper.run_kratos(file_path) - res_path = os.path.join(file_path, test_name + '.post.res') - - water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') - - # Time = 0.25 + res_path = os.path.join(file_path, test_name + result_extension) - # Bottom Row - self.assertAlmostEqual(-6250, water_pressures[0.25][1]) - self.assertAlmostEqual(-3125, water_pressures[0.25][48]) - self.assertAlmostEqual(0, water_pressures[0.25][186]) + reader = test_helper.GiDOutputFileReader() + simulation_output = reader.read_output_from(res_path) + water_pressures = simulation_output["results"]["WATER_PRESSURE"] - # Top Row - self.assertAlmostEqual(0, water_pressures[0.25][187]) - self.assertAlmostEqual(0, water_pressures[0.25][223]) - self.assertAlmostEqual(0, water_pressures[0.25][251]) - - # Time = 0.75 - self.assertAlmostEqual(-8750, water_pressures[0.75][1]) - self.assertAlmostEqual(-4375, water_pressures[0.75][48]) - self.assertAlmostEqual(0, water_pressures[0.75][186]) - - self.assertAlmostEqual(0, water_pressures[0.75][187]) - self.assertAlmostEqual(0, water_pressures[0.75][223]) - self.assertAlmostEqual(0, water_pressures[0.75][251]) - - # Time = 1.0 - self.assertAlmostEqual(-10000, water_pressures[1.0][1]) - self.assertAlmostEqual(-5000, water_pressures[1.0][48]) - self.assertAlmostEqual(0, water_pressures[1.0][186]) + bottom_nodes = [1, 48, 186] # Bottom Left/Middle/Right + top_nodes = [187, 223, 251] # Top Left/Middle/Right + + # Validation for Time = 0.25 + values_time_0_25 = reader.get_values_at_time(0.25, water_pressures) + self.assertAlmostEqual(-6250, reader.get_value_at_node(bottom_nodes[0], values_time_0_25)) + self.assertAlmostEqual(-3125, reader.get_value_at_node(bottom_nodes[1], values_time_0_25)) + self.assertAlmostEqual(0, reader.get_value_at_node(bottom_nodes[2], values_time_0_25)) + + for top_node in top_nodes: + self.assertAlmostEqual(0, reader.get_value_at_node(top_node, values_time_0_25)) - self.assertAlmostEqual(0, water_pressures[1.0][187]) - self.assertAlmostEqual(0, water_pressures[1.0][223]) - self.assertAlmostEqual(0, water_pressures[1.0][251]) + # Validation for Time = 0.75 + values_t0_75 = reader.get_values_at_time(0.75, water_pressures) + self.assertAlmostEqual(-8750, reader.get_value_at_node(bottom_nodes[0], values_t0_75)) + self.assertAlmostEqual(-4375, reader.get_value_at_node(bottom_nodes[1], values_t0_75)) + self.assertAlmostEqual(0, reader.get_value_at_node(bottom_nodes[2], values_t0_75)) + + for top_node in top_nodes: + self.assertAlmostEqual(0, reader.get_value_at_node(top_node, values_t0_75)) + + # Validation for Time = 1.0 + values_t1_0 = reader.get_values_at_time(1.0, water_pressures) + self.assertAlmostEqual(-10000, reader.get_value_at_node(bottom_nodes[0], values_t1_0)) + self.assertAlmostEqual(-5000, reader.get_value_at_node(bottom_nodes[1], values_t1_0)) + self.assertAlmostEqual(0, reader.get_value_at_node(bottom_nodes[2], values_t1_0)) + + for top_node in top_nodes: + self.assertAlmostEqual(0, reader.get_value_at_node(top_node, values_t1_0)) def test_phreatic_multi_line_2_points(self): """ @@ -146,66 +147,69 @@ def test_phreatic_multi_line_3_points(self): self.assertAlmostEqual(0, p_top_left) self.assertAlmostEqual(0, p_top_middle) self.assertAlmostEqual(0, p_top_right) - - + def test_inclined_phreatic_multi_line_time_centre(self): """ - test hydrostatic water pressure under an inclided phreatic multi line ranging over the width of the geometry + test hydrostatic water pressure under an inclined phreatic multi line ranging over the width of the geometry :return: """ - test_name = 'test_inclinded_phreatic_multi_line_time_dependent_centre' + test_name = 'test_inclined_phreatic_multi_line_time_dependent_centre' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) test_helper.run_kratos(file_path) - res_path = os.path.join(file_path, test_name + '.post.res') - - water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') + res_path = os.path.join(file_path, test_name + result_extension) + reader = test_helper.GiDOutputFileReader() + simulation_output = reader.read_output_from(res_path) + water_pressures = simulation_output["results"]["WATER_PRESSURE"] + times = [x * 0.25 for x in range(1,16)] d_head_centre = [0.5, -0.5, -0.5, 0.5] for ind, time in enumerate(times): # Central Head - d_head_ind = int(ind/4) # slope + d_head_ind = int(ind/4) # slope if d_head_ind == 0: last_head = -5000 else: last_head = (sum(d_head_centre[0:d_head_ind]) * -10000) - 5000 expected_bottom_centre_head = last_head - (d_head_centre[d_head_ind] * 10000) * (time - (4 * d_head_ind * 0.25)) - + + current_water_pressure = reader.get_values_at_time(time, water_pressures) # Bottom Row - self.assertAlmostEqual(-5000, water_pressures[time][1]) - self.assertAlmostEqual(expected_bottom_centre_head, water_pressures[time][48]) - self.assertAlmostEqual(-5000, water_pressures[time][186]) + self.assertAlmostEqual(-5000, reader.get_value_at_node(1, current_water_pressure)) + self.assertAlmostEqual(expected_bottom_centre_head, reader.get_value_at_node(48, current_water_pressure)) + self.assertAlmostEqual(-5000, reader.get_value_at_node(186, current_water_pressure)) # Top Row - self.assertAlmostEqual(0, water_pressures[time][187]) - self.assertAlmostEqual(0, water_pressures[time][223]) - self.assertAlmostEqual(0, water_pressures[time][251]) + self.assertAlmostEqual(0, reader.get_value_at_node(187, current_water_pressure)) + self.assertAlmostEqual(0, reader.get_value_at_node(223, current_water_pressure)) + self.assertAlmostEqual(0, reader.get_value_at_node(251, current_water_pressure)) - def test_inclined_phreatic_multi_line_time_edge(self): """ - test hydrostatic water pressure under an inclided phreatic multi line ranging over the width of the geometry + test hydrostatic water pressure under an inclined phreatic multi line ranging over the width of the geometry :return: """ - test_name = 'test_inclinded_phreatic_multi_line_time_dependent_edges' + test_name = 'test_inclined_phreatic_multi_line_time_dependent_edges' file_path = test_helper.get_file_path(os.path.join('.', test_name + '.gid')) test_helper.run_kratos(file_path) - res_path = os.path.join(file_path, test_name + '.post.res') - - water_pressures = test_helper.get_nodal_variable_from_ascii(res_path, 'WATER_PRESSURE') - - times = [x * 0.25 for x in range(1,16)] - d_head_left = [0.5, -0.5, -0.5, 0.5] + res_path = os.path.join(file_path, test_name + result_extension) + + reader = test_helper.GiDOutputFileReader() + simulation_output = reader.read_output_from(res_path) + water_pressures = simulation_output["results"]["WATER_PRESSURE"] + + times = [x * 0.25 for x in range(1, 16)] + d_head_left = [0.5, -0.5, -0.5, 0.5] d_head_right = [0.25, -0.25, -0.25, 0.25] for ind, time in enumerate(times): - d_head_ind = int(ind/4) # slope + d_head_ind = int(ind/4) # slope # Left Head if d_head_ind == 0: @@ -220,20 +224,22 @@ def test_inclined_phreatic_multi_line_time_edge(self): else: last_head = (sum(d_head_right[0:d_head_ind]) * -10000) - 5000 expected_bottom_right_head = last_head - (d_head_right[d_head_ind] * 10000) * (time - (4 * d_head_ind * 0.25)) - + + current_water_pressure = reader.get_values_at_time(time, water_pressures) + # Bottom Row - self.assertAlmostEqual(expected_bottom_left_head, water_pressures[time][1]) - self.assertAlmostEqual(-5000, water_pressures[time][48]) - self.assertAlmostEqual(expected_bottom_right_head, water_pressures[time][186]) + self.assertAlmostEqual(expected_bottom_left_head, reader.get_value_at_node(1, current_water_pressure)) + self.assertAlmostEqual(-5000, reader.get_value_at_node(48, current_water_pressure)) + self.assertAlmostEqual(expected_bottom_right_head, reader.get_value_at_node(186, current_water_pressure)) # Top Row - self.assertAlmostEqual(0, water_pressures[time][187]) - self.assertAlmostEqual(0, water_pressures[time][223]) - self.assertAlmostEqual(0, water_pressures[time][251]) + self.assertAlmostEqual(0, reader.get_value_at_node(187, current_water_pressure)) + self.assertAlmostEqual(0, reader.get_value_at_node(223, current_water_pressure)) + self.assertAlmostEqual(0, reader.get_value_at_node(251, current_water_pressure)) - def test_inclinded_phreatic_line_smaller_line(self): + def test_inclined_phreatic_line_smaller_line(self): """ - test hydrostatic water pressure under an inclided phreatic line ranging over a part of the geometry + test hydrostatic water pressure under an inclined phreatic line ranging over a part of the geometry :return: """ From 49b268dbbe8b3797b4752809e179366ef40f542f Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Wed, 18 Oct 2023 17:11:35 +0200 Subject: [PATCH 24/27] Removed white space from test file for codacy --- .../GeoMechanicsApplication/tests/test_absorbing_boundary.py | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py index 5813fd768515..2899dbeb1c16 100644 --- a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py +++ b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py @@ -107,6 +107,7 @@ def run_and_assert_1d_column(self, file_path, node_nbrs, direction): # find index of expected time of wave arrival in time list res_keys = list(res.keys()) + print("TEST", res.keys()) ini_time_idx = test_helper.find_closest_index_greater_than_value(res_keys, expected_ini_time) # calculate velocity after wave arrival From 7a445ac9ad1b5724c415a48b34d8704b046dd420 Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Wed, 18 Oct 2023 21:17:12 +0200 Subject: [PATCH 25/27] Updated test_helper + test issues --- .../tests/test_absorbing_boundary.py | 1 - .../tests/test_helper.py | 48 ++++++------------- 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py index 2899dbeb1c16..5813fd768515 100644 --- a/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py +++ b/applications/GeoMechanicsApplication/tests/test_absorbing_boundary.py @@ -107,7 +107,6 @@ def run_and_assert_1d_column(self, file_path, node_nbrs, direction): # find index of expected time of wave arrival in time list res_keys = list(res.keys()) - print("TEST", res.keys()) ini_time_idx = test_helper.find_closest_index_greater_than_value(res_keys, expected_ini_time) # calculate velocity after wave arrival diff --git a/applications/GeoMechanicsApplication/tests/test_helper.py b/applications/GeoMechanicsApplication/tests/test_helper.py index 4aa84f8be370..f8dae01286f8 100644 --- a/applications/GeoMechanicsApplication/tests/test_helper.py +++ b/applications/GeoMechanicsApplication/tests/test_helper.py @@ -172,52 +172,34 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): # read data with open(filename, "r") as f: - all_data = f.readlines() + all_lines = f.readlines() add_var = False - - data = [] - time_steps = [] - all_var_data = [] + res = {} # read all data at each time step of variable - for line in all_data: + for line in all_lines: if "End Values" in line and add_var: add_var = False - all_var_data.append(data) - data = [] + if add_var: - data.append(line) + if line.startswith("Values"): + continue; + lineSplit = line.split() + lineSplit[0] = int(lineSplit[0]) + for ind, strVal in enumerate(lineSplit[1:]): + lineSplit[ind+1] = float(strVal) + if (len(lineSplit[1:])==1): + res[time_step][lineSplit[0]] = lineSplit[1] + else: + res[time_step][lineSplit[0]] = lineSplit[1:] if r'"' + variable + r'"' in line: time_step = float(line.split()[3]) - - time_steps.append(time_step) + res[time_step] = {} add_var=True - # initialise results dictionary - res = {"time": time_steps} - - for var_data in all_var_data: - var_data.pop(0) - - # convert var data to floats - for i, _ in enumerate(var_data): - line = var_data[i].split() - line[1] = float(line[1]) - line[2] = float(line[2]) - line[3] = float(line[3]) - var_data[i] = line - - # add node numbers as dict keys - for line in var_data: - res[line[0]] = [] - - for var_data in all_var_data: - for line in var_data: - res[line[0]].append(line[1:]) - return res From b10242e279f69a0239c2dfe8300a2849809a3743 Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Wed, 18 Oct 2023 21:31:36 +0200 Subject: [PATCH 26/27] Removed trailing white spaces --- .../tests/test_water_pressure.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/test_water_pressure.py b/applications/GeoMechanicsApplication/tests/test_water_pressure.py index 5b4610067aa0..ceef666cd320 100644 --- a/applications/GeoMechanicsApplication/tests/test_water_pressure.py +++ b/applications/GeoMechanicsApplication/tests/test_water_pressure.py @@ -45,7 +45,7 @@ def test_inclined_phreatic_line(self): self.assertAlmostEqual(0, p_top_left) self.assertAlmostEqual(0, p_top_middle) self.assertAlmostEqual(0, p_top_right) - + def test_inclined_phreatic_line_time(self): """ test hydrostatic water pressure under an inclined phreatic line ranging over the width of the geometry @@ -159,7 +159,7 @@ def test_inclined_phreatic_multi_line_time_centre(self): test_helper.run_kratos(file_path) res_path = os.path.join(file_path, test_name + result_extension) - + reader = test_helper.GiDOutputFileReader() simulation_output = reader.read_output_from(res_path) water_pressures = simulation_output["results"]["WATER_PRESSURE"] @@ -167,7 +167,7 @@ def test_inclined_phreatic_multi_line_time_centre(self): times = [x * 0.25 for x in range(1,16)] d_head_centre = [0.5, -0.5, -0.5, 0.5] for ind, time in enumerate(times): - + # Central Head d_head_ind = int(ind/4) # slope if d_head_ind == 0: @@ -177,7 +177,7 @@ def test_inclined_phreatic_multi_line_time_centre(self): expected_bottom_centre_head = last_head - (d_head_centre[d_head_ind] * 10000) * (time - (4 * d_head_ind * 0.25)) current_water_pressure = reader.get_values_at_time(time, water_pressures) - + # Bottom Row self.assertAlmostEqual(-5000, reader.get_value_at_node(1, current_water_pressure)) self.assertAlmostEqual(expected_bottom_centre_head, reader.get_value_at_node(48, current_water_pressure)) @@ -187,7 +187,7 @@ def test_inclined_phreatic_multi_line_time_centre(self): self.assertAlmostEqual(0, reader.get_value_at_node(187, current_water_pressure)) self.assertAlmostEqual(0, reader.get_value_at_node(223, current_water_pressure)) self.assertAlmostEqual(0, reader.get_value_at_node(251, current_water_pressure)) - + def test_inclined_phreatic_multi_line_time_edge(self): """ test hydrostatic water pressure under an inclined phreatic multi line ranging over the width of the geometry @@ -208,16 +208,16 @@ def test_inclined_phreatic_multi_line_time_edge(self): d_head_left = [0.5, -0.5, -0.5, 0.5] d_head_right = [0.25, -0.25, -0.25, 0.25] for ind, time in enumerate(times): - + d_head_ind = int(ind/4) # slope - + # Left Head if d_head_ind == 0: last_head = -5000 else: last_head = (sum(d_head_left[0:d_head_ind]) * -10000) - 5000 expected_bottom_left_head = last_head - (d_head_left[d_head_ind] * 10000) * (time - (4 * d_head_ind * 0.25)) - + # Left Head if d_head_ind == 0: last_head = -5000 From 7f69844265def5028512bd5de98d6db635dca00a Mon Sep 17 00:00:00 2001 From: mcgicjn2 Date: Fri, 20 Oct 2023 12:49:12 +0200 Subject: [PATCH 27/27] Updated test_helper to remove code smells --- .../tests/test_helper.py | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/applications/GeoMechanicsApplication/tests/test_helper.py b/applications/GeoMechanicsApplication/tests/test_helper.py index f8dae01286f8..7aab9e154598 100644 --- a/applications/GeoMechanicsApplication/tests/test_helper.py +++ b/applications/GeoMechanicsApplication/tests/test_helper.py @@ -159,7 +159,6 @@ def get_nodal_variable(simulation, variable, node_ids=None): nodes = [node for node in nodes if node.Id in node_ids] return [node.GetSolutionStepValue(variable) for node in nodes] - def get_nodal_variable_from_ascii(filename: str, variable: str): """ Reads data of Kratos variable from ascii output GID file @@ -174,6 +173,7 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): with open(filename, "r") as f: all_lines = f.readlines() + time_step = None add_var = False res = {} @@ -185,15 +185,9 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): if add_var: if line.startswith("Values"): - continue; - lineSplit = line.split() - lineSplit[0] = int(lineSplit[0]) - for ind, strVal in enumerate(lineSplit[1:]): - lineSplit[ind+1] = float(strVal) - if (len(lineSplit[1:])==1): - res[time_step][lineSplit[0]] = lineSplit[1] - else: - res[time_step][lineSplit[0]] = lineSplit[1:] + continue + if time_step is not None: + add_line_data_to_dictionary(line, res, time_step) if r'"' + variable + r'"' in line: time_step = float(line.split()[3]) @@ -202,6 +196,27 @@ def get_nodal_variable_from_ascii(filename: str, variable: str): return res +def add_line_data_to_dictionary(line, dictionary, main_index): + """ + Adds the data from a GiD Ascii line to a dictionary structure + :param line: line with data from a GiD Ascii File + :param dictionary: dictionary to input data (main index already initialized) + :param main_index: this is the main index under which to store the data + (usually time series), i.e. dictionary[main_index] = {} + """ + if main_index not in dictionary.keys(): + KeyError(f"The key '{main_index}' is not in the dictionary.") + if not isinstance(dictionary[main_index], dict): + raise TypeError(f"The value for key '{main_index}' is not a dictionary.") + line_split = line.split() + line_split[0] = int(line_split[0]) + for ind, str_value in enumerate(line_split[1:]): + line_split[ind + 1] = float(str_value) + if (len(line_split[1:]) == 1): + dictionary[main_index][line_split[0]] = line_split[1] + else: + dictionary[main_index][line_split[0]] = line_split[1:] + def get_gauss_coordinates(simulation): """