Skip to content

Commit cb56be0

Browse files
authored
[GeoMechanicsApplication] Made several functions static as per clang tidy recommendation (#13961)
1 parent 532e0db commit cb56be0

23 files changed

+59
-60
lines changed

applications/GeoMechanicsApplication/custom_conditions/general_U_Pw_diff_order_condition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void GeneralUPwDiffOrderCondition::InitializeConditionVariables(ConditionVariabl
161161
r_geom.Jacobian(rVariables.JContainer, this->GetIntegrationMethod());
162162
}
163163

164-
void GeneralUPwDiffOrderCondition::CalculateKinematics(ConditionVariables& rVariables, unsigned int PointNumber) const
164+
void GeneralUPwDiffOrderCondition::CalculateKinematics(ConditionVariables& rVariables, unsigned int PointNumber)
165165
{
166166
KRATOS_TRY
167167

applications/GeoMechanicsApplication/custom_conditions/general_U_Pw_diff_order_condition.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) GeneralUPwDiffOrderCondition : publi
8888

8989
void InitializeConditionVariables(ConditionVariables& rVariables);
9090

91-
void CalculateKinematics(ConditionVariables& rVariables, unsigned int PointNumber) const;
91+
static void CalculateKinematics(ConditionVariables& rVariables, unsigned int PointNumber);
9292

9393
virtual void CalculateConditionVector(ConditionVariables& rVariables, unsigned int PointNumber);
9494

applications/GeoMechanicsApplication/custom_constitutive/small_strain_umat_2D_interface_law.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void SmallStrainUMAT2DInterfaceLaw::CopyConstitutiveMatrix(ConstitutiveLaw::Para
8080
}
8181
}
8282

83-
indexStress3D SmallStrainUMAT2DInterfaceLaw::getIndex3D(indexStress2DInterface index2D) const
83+
indexStress3D SmallStrainUMAT2DInterfaceLaw::getIndex3D(indexStress2DInterface index2D)
8484
{
8585
switch (index2D) {
8686
case INDEX_2D_INTERFACE_ZZ:

applications/GeoMechanicsApplication/custom_constitutive/small_strain_umat_2D_interface_law.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) SmallStrainUMAT2DInterfaceLaw : publ
170170
///@name Static Member Variables
171171
///@{
172172

173-
indexStress3D getIndex3D(indexStress2DInterface index2D) const;
173+
static indexStress3D getIndex3D(indexStress2DInterface index2D);
174174

175175
///@}
176176
///@name Member Variables

applications/GeoMechanicsApplication/custom_constitutive/small_strain_umat_3D_interface_law.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void SmallStrainUMAT3DInterfaceLaw::CopyConstitutiveMatrix(ConstitutiveLaw::Para
8686
}
8787
}
8888

89-
indexStress3D SmallStrainUMAT3DInterfaceLaw::getIndex3D(const indexStress3DInterface index3D) const
89+
indexStress3D SmallStrainUMAT3DInterfaceLaw::getIndex3D(const indexStress3DInterface index3D)
9090
{
9191
switch (index3D) {
9292
case INDEX_3D_INTERFACE_ZZ:

applications/GeoMechanicsApplication/custom_constitutive/small_strain_umat_3D_interface_law.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) SmallStrainUMAT3DInterfaceLaw : publ
172172
///@name Static Member Variables
173173
///@{
174174

175-
indexStress3D getIndex3D(indexStress3DInterface index3D) const;
175+
static indexStress3D getIndex3D(indexStress3DInterface index3D);
176176

177177
///@}
178178
///@name Member Variables

applications/GeoMechanicsApplication/custom_elements/small_strain_U_Pw_diff_order_element.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ void SmallStrainUPwDiffOrderElement::CalculateAndAddLHS(MatrixType&
12951295
}
12961296

12971297
void SmallStrainUPwDiffOrderElement::CalculateAndAddStiffnessMatrix(MatrixType& rLeftHandSideMatrix,
1298-
const ElementVariables& rVariables) const
1298+
const ElementVariables& rVariables)
12991299
{
13001300
KRATOS_TRY
13011301

@@ -1335,7 +1335,7 @@ void SmallStrainUPwDiffOrderElement::CalculateAndAddCouplingMatrix(MatrixType& r
13351335
}
13361336

13371337
void SmallStrainUPwDiffOrderElement::CalculateAndAddCompressibilityMatrix(MatrixType& rLeftHandSideMatrix,
1338-
const ElementVariables& rVariables) const
1338+
const ElementVariables& rVariables)
13391339
{
13401340
KRATOS_TRY
13411341

@@ -1418,7 +1418,7 @@ void SmallStrainUPwDiffOrderElement::CalculateAndAddCouplingTerms(VectorType& rR
14181418
}
14191419

14201420
void SmallStrainUPwDiffOrderElement::CalculateAndAddCompressibilityFlow(VectorType& rRightHandSideVector,
1421-
const ElementVariables& rVariables) const
1421+
const ElementVariables& rVariables)
14221422
{
14231423
KRATOS_TRY
14241424

@@ -1448,7 +1448,7 @@ std::vector<double> SmallStrainUPwDiffOrderElement::CalculateBishopCoefficients(
14481448
}
14491449

14501450
void SmallStrainUPwDiffOrderElement::CalculateAndAddPermeabilityFlow(VectorType& rRightHandSideVector,
1451-
const ElementVariables& rVariables) const
1451+
const ElementVariables& rVariables)
14521452
{
14531453
KRATOS_TRY
14541454

applications/GeoMechanicsApplication/custom_elements/small_strain_U_Pw_diff_order_element.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) SmallStrainUPwDiffOrderElement : pub
193193

194194
void CalculateAndAddLHS(MatrixType& rLeftHandSideMatrix, const ElementVariables& rVariables) const;
195195

196-
void CalculateAndAddStiffnessMatrix(MatrixType& rLeftHandSideMatrix, const ElementVariables& rVariables) const;
196+
static void CalculateAndAddStiffnessMatrix(MatrixType& rLeftHandSideMatrix, const ElementVariables& rVariables);
197197

198198
void CalculateAndAddCouplingMatrix(MatrixType& rLeftHandSideMatrix, const ElementVariables& rVariables) const;
199199

200-
void CalculateAndAddCompressibilityMatrix(MatrixType& rLeftHandSideMatrix,
201-
const ElementVariables& rVariables) const;
200+
static void CalculateAndAddCompressibilityMatrix(MatrixType& rLeftHandSideMatrix,
201+
const ElementVariables& rVariables);
202202

203203
void CalculateAndAddStiffnessForce(VectorType& rRightHandSideVector,
204204
const ElementVariables& rVariables,
@@ -208,11 +208,12 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) SmallStrainUPwDiffOrderElement : pub
208208

209209
void CalculateAndAddCouplingTerms(VectorType& rRightHandSideVector, const ElementVariables& rVariables) const;
210210

211-
void CalculateAndAddCompressibilityFlow(VectorType& rRightHandSideVector,
212-
const ElementVariables& rVariables) const;
211+
static void CalculateAndAddCompressibilityFlow(VectorType& rRightHandSideVector,
212+
const ElementVariables& rVariables);
213213

214214
[[nodiscard]] std::vector<double> CalculateBishopCoefficients(const std::vector<double>& rFluidPressures) const;
215-
void CalculateAndAddPermeabilityFlow(VectorType& rRightHandSideVector, const ElementVariables& rVariables) const;
215+
static void CalculateAndAddPermeabilityFlow(VectorType& rRightHandSideVector,
216+
const ElementVariables& rVariables);
216217

217218
void CalculateAndAddFluidBodyFlow(VectorType& rRightHandSideVector, const ElementVariables& rVariables) const;
218219

applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int ApplyCPhiReductionProcess::Check()
9393
return 0;
9494
}
9595

96-
double ApplyCPhiReductionProcess::GetAndCheckPhi(const Properties& rModelPartProperties, IndexType ElementPropertyId) const
96+
double ApplyCPhiReductionProcess::GetAndCheckPhi(const Properties& rModelPartProperties, IndexType ElementPropertyId)
9797
{
9898
// Get the initial properties from the model part. Recall that we create a separate
9999
// properties object with reduced c and phi for each and every element. Those reduced
@@ -120,7 +120,7 @@ double ApplyCPhiReductionProcess::ComputeReducedPhi(double Phi) const
120120
return std::atan(reduced_tan_phi) * 180.0 / Globals::Pi;
121121
}
122122

123-
double ApplyCPhiReductionProcess::GetAndCheckC(const Properties& rModelPartProperties) const
123+
double ApplyCPhiReductionProcess::GetAndCheckC(const Properties& rModelPartProperties)
124124
{
125125
// Get the initial properties from the model part. Recall that we create a separate
126126
// properties object with reduced c and phi for each and every element. Those reduced
@@ -141,7 +141,7 @@ double ApplyCPhiReductionProcess::GetAndCheckC(const Properties& rModelPartPrope
141141
return c;
142142
}
143143

144-
void ApplyCPhiReductionProcess::SetCPhiAtElement(Element& rElement, double ReducedPhi, double ReducedC) const
144+
void ApplyCPhiReductionProcess::SetCPhiAtElement(Element& rElement, double ReducedPhi, double ReducedC)
145145
{
146146
// Get C/Phi material properties of this element
147147
const auto& r_prop = rElement.GetProperties();
@@ -154,9 +154,7 @@ void ApplyCPhiReductionProcess::SetCPhiAtElement(Element& rElement, double Reduc
154154
SetValueAtElement(rElement, UMAT_PARAMETERS, Umat_parameters);
155155
}
156156

157-
void ApplyCPhiReductionProcess::SetValueAtElement(Element& rElement,
158-
const Variable<Vector>& rVariable,
159-
const Vector& rValue) const
157+
void ApplyCPhiReductionProcess::SetValueAtElement(Element& rElement, const Variable<Vector>& rVariable, const Vector& rValue)
160158
{
161159
// Copies properties
162160
Properties::Pointer p_new_prop = Kratos::make_shared<Properties>(rElement.GetProperties());

applications/GeoMechanicsApplication/custom_processes/apply_c_phi_reduction_process.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) ApplyCPhiReductionProcess : public P
4343
double mPreviousReductionFactor = 1.0;
4444
double mReductionIncrement = 0.1;
4545

46-
[[nodiscard]] double GetAndCheckPhi(const Properties& rModelPartProperties, IndexType ElementPropertyId) const;
46+
[[nodiscard]] static double GetAndCheckPhi(const Properties& rModelPartProperties, IndexType ElementPropertyId);
4747

4848
[[nodiscard]] double ComputeReducedPhi(double Phi) const;
4949

50-
[[nodiscard]] double GetAndCheckC(const Properties& rModelPartProperties) const;
50+
[[nodiscard]] static double GetAndCheckC(const Properties& rModelPartProperties);
5151

52-
void SetCPhiAtElement(Element& rElement, double ReducedPhi, double ReducedC) const;
52+
static void SetCPhiAtElement(Element& rElement, double ReducedPhi, double ReducedC);
5353

54-
void SetValueAtElement(Element& rElement, const Variable<Vector>& rVariable, const Vector& rValue) const;
54+
static void SetValueAtElement(Element& rElement, const Variable<Vector>& rVariable, const Vector& rValue);
5555

5656
[[nodiscard]] bool IsStepRestarted() const;
5757
};

0 commit comments

Comments
 (0)