Skip to content

Commit 051503a

Browse files
authored
[GeoMechanicsApplication] Move all non-template code to .cpp files and make sure any .h file does not contain any implementations (strategies) (#14115)
* renamed residualbased_block_builder_and_solver_with_mass_and_damping.h * removed 5 code smells
1 parent 29772fd commit 051503a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

applications/GeoMechanicsApplication/custom_python/add_custom_strategies_to_python.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "solving_strategies/strategies/solving_strategy.h"
2525

2626
// builders and solvers
27-
#include "custom_strategies/builder_and_solvers/residualbased_block_builder_and_solver_with_mass_and_damping.h"
27+
#include "custom_strategies/builder_and_solvers/residualbased_block_builder_and_solver_with_mass_and_damping.hpp"
2828

2929
// schemes
3030
#include "custom_strategies/schemes/backward_euler_T_scheme.hpp"

applications/GeoMechanicsApplication/custom_strategies/builder_and_solvers/residualbased_block_builder_and_solver_with_mass_and_damping.h renamed to applications/GeoMechanicsApplication/custom_strategies/builder_and_solvers/residualbased_block_builder_and_solver_with_mass_and_damping.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class ResidualBasedBlockBuilderAndSolverWithMassAndDamping
378378
BuildRHSNoDirichlet(pScheme, rModelPart, rb);
379379

380380
// NOTE: dofs are assumed to be numbered consecutively in the BlockBuilderAndSolver
381-
block_for_each(BaseType::mDofSet, [&](Dof<double>& r_dof) {
381+
block_for_each(BaseType::mDofSet, [&rb](const Dof<double>& r_dof) {
382382
if (r_dof.IsFixed()) {
383383
const std::size_t i = r_dof.EquationId();
384384
rb[i] = 0.0;
@@ -396,7 +396,7 @@ class ResidualBasedBlockBuilderAndSolverWithMassAndDamping
396396
*/
397397
Parameters GetDefaultParameters() const override
398398
{
399-
Parameters default_parameters = Parameters(R"(
399+
auto default_parameters = Parameters(R"(
400400
{
401401
"name" : "block_builder_and_solver_with_mass_and_damping",
402402
"block_builder" : true,
@@ -520,11 +520,11 @@ class ResidualBasedBlockBuilderAndSolverWithMassAndDamping
520520

521521
// assemble all elements
522522

523-
const int nelements = static_cast<int>(r_elements.size());
524-
#pragma omp parallel firstprivate(nelements, rhs_contribution, equation_ids)
523+
const auto n_elements = static_cast<int>(r_elements.size());
524+
#pragma omp parallel firstprivate(n_elements, rhs_contribution, equation_ids)
525525
{
526526
#pragma omp for schedule(guided, 512) nowait
527-
for (int i = 0; i < nelements; i++) {
527+
for (int i = 0; i < n_elements; i++) {
528528
typename ElementsArrayType::iterator it = r_elements.begin() + i;
529529
// If the element is active
530530
if (it->IsActive()) {
@@ -540,9 +540,9 @@ class ResidualBasedBlockBuilderAndSolverWithMassAndDamping
540540
rhs_contribution.resize(0, false);
541541

542542
// assemble all conditions
543-
const int nconditions = static_cast<int>(r_conditions.size());
543+
const auto n_conditions = static_cast<int>(r_conditions.size());
544544
#pragma omp for schedule(guided, 512)
545-
for (int i = 0; i < nconditions; i++) {
545+
for (int i = 0; i < n_conditions; i++) {
546546
auto it = r_conditions.begin() + i;
547547
// If the condition is active
548548
if (it->IsActive()) {

0 commit comments

Comments
 (0)