-
Notifications
You must be signed in to change notification settings - Fork 279
[GeoMechanicsApplication] Move all non-template code to .cpp files and make sure any .h file does not contain any implementations (processes) #14075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
markelov208
merged 42 commits into
master
from
geo/14046-move-non-template-code-from-h-to-cpp-processes
Jan 16, 2026
Merged
Changes from 23 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
49e2a67
split apply_boundary_hydrostatic_pressure_table_process
markelov208 0d9683c
split apply_boundary_phreatic_line_pressure_table_process
markelov208 5e452b0
split apply_boundary_phreatic_surface_pressure_table_process
markelov208 194b190
split apply_constant_boundary_hydrostatic_pressure_process
markelov208 87599ca
split apply_constant_boundary_phreatic_line_pressure_process
markelov208 e92a251
split apply_constant_boundary_phreatic_surface_pressure_process
markelov208 9ac4ed7
split apply_constant_hydrostatic_pressure_process.hpp
markelov208 f5cb0c7
split apply_constant_interpolate_line_pressure_process.hpp
markelov208 9dd191a
split apply_constant_phreatic_line_pressure_process.hpp
markelov208 eec7b63
used forward declaration for apply_constant_phreatic_line_pressure_pr…
markelov208 f848b23
moved inline functions to header for apply_constant_interpolate_line_…
markelov208 73ff850
split apply_constant_phreatic_surface_pressure_process.hpp
markelov208 54080a9
splt apply_hydrostatic_pressure_table_process
markelov208 545d67f
split apply_phreatic_line_pressure_table_process.hpp
markelov208 c60ecef
split apply_phreatic_surface_pressure_table_process.hpp
markelov208 e9fccd3
split apply_write_result_scalar_process.hpp
markelov208 3d99fcb
cleaned deactivate_conditions_on_inactive_elements_process.hpp
markelov208 a0458db
renamed geo_extrapolate_integration_point_values_to_nodes_process.h a…
markelov208 c057a1c
split set_absorbing_boundary_parameters_process.hpp
markelov208 6c4fcc7
cleaned includes
markelov208 2a18206
added forward declaration for ModelPart
markelov208 260d5e4
added forward declaration for Parameters
markelov208 f86a966
added using namespace std::string_literals;
markelov208 b381bbc
Merge branch 'master' into geo/14046-move-non-template-code-from-h-to…
markelov208 322fdd1
moved default destructors to headers
markelov208 5d61d92
reduced code smells
markelov208 bc19a43
response to the review comments and code smells
markelov208 7a6dd17
moved include <string> to headers
markelov208 bcbd92f
reverted changes for apply_constant_interpolate_line_pressure_process
markelov208 ecdf793
removed some of code smells
markelov208 9d74fa8
used auto
markelov208 4265353
reduced complexity by using continue
markelov208 90856ad
small reduction of the complexity
markelov208 338024f
introduced lamda ContainsElementInRange to reduce complexity
markelov208 7baf55a
minor changes
markelov208 18d4dfb
clang format
markelov208 4c1ab9b
Merge branch 'master' into geo/14046-move-non-template-code-from-h-to…
markelov208 028099a
moved lambda out of for loop
markelov208 4eed7d8
used static_cast<int> to remove a code smell
markelov208 b602cb2
Merge branch 'master' into geo/14046-move-non-template-code-from-h-to…
markelov208 09808cb
removed operators
markelov208 405f8e7
removed inline operators
markelov208 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
...chanicsApplication/custom_processes/apply_boundary_hydrostatic_pressure_table_process.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| // KRATOS___ | ||
| // // ) ) | ||
| // // ___ ___ | ||
| // // ____ //___) ) // ) ) | ||
| // // / / // // / / | ||
| // ((____/ / ((____ ((___/ / MECHANICS | ||
| // | ||
| // License: geo_mechanics_application/license.txt | ||
| // | ||
| // Main authors: Ignasi de Pouplana, | ||
| // Vahid Galavi | ||
| // | ||
|
|
||
| #include "custom_processes/apply_boundary_hydrostatic_pressure_table_process.h" | ||
| #include "geo_mechanics_application_variables.h" | ||
| #include "includes/kratos_parameters.h" | ||
| #include "includes/model_part.h" | ||
|
|
||
| namespace Kratos | ||
| { | ||
| using namespace std::string_literals; | ||
|
|
||
| ApplyBoundaryHydrostaticPressureTableProcess::ApplyBoundaryHydrostaticPressureTableProcess(ModelPart& model_part, | ||
| Parameters rParameters) | ||
| : ApplyConstantBoundaryHydrostaticPressureProcess(model_part, rParameters) | ||
| { | ||
| KRATOS_TRY | ||
|
|
||
| unsigned int TableId = rParameters["table"].GetInt(); | ||
| mpTable = model_part.pGetTable(TableId); | ||
| mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER]; | ||
|
|
||
| KRATOS_CATCH("") | ||
| } | ||
|
|
||
| void ApplyBoundaryHydrostaticPressureTableProcess::ExecuteInitializeSolutionStep() | ||
| { | ||
| KRATOS_TRY | ||
|
|
||
| const auto& r_variable = KratosComponents<Variable<double>>::Get(GetVariableName()); | ||
| const auto time = GetModelPart().GetProcessInfo()[TIME] / mTimeUnitConverter; | ||
| const auto delta_h = mpTable->GetValue(time); | ||
|
|
||
| block_for_each(GetModelPart().Nodes(), [&delta_h, &r_variable, this](Node& rNode) { | ||
| const auto distance = GetReferenceCoordinate() - rNode.Coordinates()[GetGravityDirection()]; | ||
| const auto pressure = GetSpecificWeight() * (distance + delta_h); | ||
| rNode.FastGetSolutionStepValue(r_variable) = std::max(pressure, 0.0); | ||
| }); | ||
| KRATOS_CATCH("") | ||
| } | ||
|
|
||
| std::string ApplyBoundaryHydrostaticPressureTableProcess::Info() const | ||
| { | ||
| return "ApplyBoundaryHydrostaticPressureTableProcess"s; | ||
| } | ||
|
|
||
| } // namespace Kratos |
51 changes: 51 additions & 0 deletions
51
...MechanicsApplication/custom_processes/apply_boundary_hydrostatic_pressure_table_process.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // KRATOS___ | ||
| // // ) ) | ||
| // // ___ ___ | ||
| // // ____ //___) ) // ) ) | ||
| // // / / // // / / | ||
| // ((____/ / ((____ ((___/ / MECHANICS | ||
| // | ||
| // License: geo_mechanics_application/license.txt | ||
| // | ||
| // Main authors: Ignasi de Pouplana, | ||
| // Vahid Galavi | ||
| // | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "includes/table.h" | ||
|
|
||
| #include "custom_processes/apply_constant_boundary_hydrostatic_pressure_process.h" | ||
|
|
||
| namespace Kratos | ||
| { | ||
| class ModelPart; | ||
| class Parameters; | ||
|
|
||
| class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyBoundaryHydrostaticPressureTableProcess | ||
| : public ApplyConstantBoundaryHydrostaticPressureProcess | ||
| { | ||
| public: | ||
| KRATOS_CLASS_POINTER_DEFINITION(ApplyBoundaryHydrostaticPressureTableProcess); | ||
|
|
||
| /// Defining a table with double argument and result type as table type. | ||
| using TableType = Table<double, double>; | ||
|
|
||
| ApplyBoundaryHydrostaticPressureTableProcess(ModelPart& model_part, Parameters rParameters); | ||
| ApplyBoundaryHydrostaticPressureTableProcess(const ApplyBoundaryHydrostaticPressureTableProcess&) = delete; | ||
| ApplyBoundaryHydrostaticPressureTableProcess& operator=(const ApplyBoundaryHydrostaticPressureTableProcess&) = delete; | ||
| ~ApplyBoundaryHydrostaticPressureTableProcess() override = default; | ||
|
|
||
| /// this function will be executed at every time step BEFORE performing the solve phase | ||
| void ExecuteInitializeSolutionStep() override; | ||
|
|
||
| /// Turn back information as a string. | ||
| std::string Info() const override; | ||
|
|
||
| private: | ||
| /// Member Variables | ||
| TableType::Pointer mpTable; | ||
| double mTimeUnitConverter; | ||
| }; | ||
|
|
||
| } // namespace Kratos |
74 changes: 0 additions & 74 deletions
74
...chanicsApplication/custom_processes/apply_boundary_hydrostatic_pressure_table_process.hpp
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
...anicsApplication/custom_processes/apply_boundary_phreatic_line_pressure_table_process.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // KRATOS___ | ||
| // // ) ) | ||
| // // ___ ___ | ||
| // // ____ //___) ) // ) ) | ||
| // // / / // // / / | ||
| // ((____/ / ((____ ((___/ / MECHANICS | ||
| // | ||
| // License: geo_mechanics_application/license.txt | ||
| // | ||
| // Main authors: Vahid Galavi | ||
| // | ||
|
|
||
| #include "custom_processes/apply_boundary_phreatic_line_pressure_table_process.h" | ||
| #include "geo_mechanics_application_variables.h" | ||
| #include "includes/kratos_parameters.h" | ||
| #include "includes/model_part.h" | ||
|
|
||
| namespace Kratos | ||
| { | ||
| using namespace std::string_literals; | ||
|
|
||
| ApplyBoundaryPhreaticLinePressureTableProcess::ApplyBoundaryPhreaticLinePressureTableProcess(ModelPart& model_part, | ||
| Parameters rParameters) | ||
| : ApplyConstantBoundaryPhreaticLinePressureProcess(model_part, rParameters) | ||
| { | ||
| KRATOS_TRY | ||
|
|
||
| unsigned int TableId = rParameters["table"].GetInt(); | ||
| mpTable = model_part.pGetTable(TableId); | ||
| mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER]; | ||
|
|
||
| KRATOS_CATCH("") | ||
| } | ||
|
|
||
| void ApplyBoundaryPhreaticLinePressureTableProcess::ExecuteInitializeSolutionStep() | ||
| { | ||
| KRATOS_TRY | ||
|
|
||
| const auto& r_variable = KratosComponents<Variable<double>>::Get(GetVariableName()); | ||
| const auto time = GetModelPart().GetProcessInfo()[TIME] / mTimeUnitConverter; | ||
| const auto delta_h = mpTable->GetValue(time); | ||
|
|
||
| block_for_each(GetModelPart().Nodes(), [&delta_h, &r_variable, this](Node& rNode) { | ||
| auto xcoord = rNode.Coordinates()[GetHorizontalDirection()]; | ||
| xcoord = std::max(xcoord, GetMinHorizontalCoordinate()); | ||
| xcoord = std::min(xcoord, GetMaxHorizontalCoordinate()); | ||
| const auto height = GetSlope() * (xcoord - GetFirstReferenceCoordinate()[GetHorizontalDirection()]) + | ||
| GetFirstReferenceCoordinate()[GetGravityDirection()]; | ||
| const auto distance = height - rNode.Coordinates()[GetGravityDirection()]; | ||
| const auto pressure = GetSpecificWeight() * (distance + delta_h); | ||
| rNode.FastGetSolutionStepValue(r_variable) = std::max(pressure, 0.0); | ||
| }); | ||
|
|
||
| KRATOS_CATCH("") | ||
| } | ||
|
|
||
| std::string ApplyBoundaryPhreaticLinePressureTableProcess::Info() const | ||
| { | ||
| return "ApplyBoundaryPhreaticLinePressureTableProcess"s; | ||
| } | ||
| } // namespace Kratos |
50 changes: 50 additions & 0 deletions
50
...chanicsApplication/custom_processes/apply_boundary_phreatic_line_pressure_table_process.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // KRATOS___ | ||
| // // ) ) | ||
| // // ___ ___ | ||
| // // ____ //___) ) // ) ) | ||
| // // / / // // / / | ||
| // ((____/ / ((____ ((___/ / MECHANICS | ||
| // | ||
| // License: geo_mechanics_application/license.txt | ||
| // | ||
| // Main authors: Vahid Galavi | ||
| // | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "includes/table.h" | ||
|
|
||
| #include "custom_processes/apply_constant_boundary_phreatic_line_pressure_process.h" | ||
|
|
||
| namespace Kratos | ||
| { | ||
| class ModelPart; | ||
| class Parameters; | ||
|
|
||
| class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyBoundaryPhreaticLinePressureTableProcess | ||
| : public ApplyConstantBoundaryPhreaticLinePressureProcess | ||
| { | ||
| public: | ||
| KRATOS_CLASS_POINTER_DEFINITION(ApplyBoundaryPhreaticLinePressureTableProcess); | ||
|
|
||
| /// Defining a table with double argument and result type as table type. | ||
| using TableType = Table<double, double>; | ||
|
|
||
| ApplyBoundaryPhreaticLinePressureTableProcess(ModelPart& model_part, Parameters rParameters); | ||
| ApplyBoundaryPhreaticLinePressureTableProcess(const ApplyBoundaryPhreaticLinePressureTableProcess&) = delete; | ||
| ApplyBoundaryPhreaticLinePressureTableProcess& operator=(const ApplyBoundaryPhreaticLinePressureTableProcess&) = delete; | ||
| ~ApplyBoundaryPhreaticLinePressureTableProcess() override = default; | ||
|
|
||
| /// this function will be executed at every time step BEFORE performing the solve phase | ||
| void ExecuteInitializeSolutionStep() override; | ||
|
|
||
| /// Turn back information as a string. | ||
| std::string Info() const override; | ||
|
|
||
| private: | ||
| /// Member Variables | ||
| TableType::Pointer mpTable; | ||
| double mTimeUnitConverter; | ||
| }; | ||
|
|
||
| } // namespace Kratos | ||
80 changes: 0 additions & 80 deletions
80
...anicsApplication/custom_processes/apply_boundary_phreatic_line_pressure_table_process.hpp
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.