Skip to content

Commit

Permalink
Fix sonarqube issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaasse committed Nov 14, 2024
1 parent 014d94e commit c0a277c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace Kratos::Python
{

void AddCustomUtilitiesToPython(pybind11::module& rModule)
void AddCustomUtilitiesToPython(const pybind11::module& rModule)
{
pybind11::class_<NodeUtilities>(rModule, "NodeUtilities")
.def("AssignUpdatedVectorVariableToNonFixedComponentsOfNodes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace Kratos::Python
{

void AddCustomUtilitiesToPython(pybind11::module& rModule);
void AddCustomUtilitiesToPython(const pybind11::module& rModule);

} // namespace Kratos::Python.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,8 @@ std::shared_ptr<StrategyWrapper> KratosGeoSettlement::MakeStrategyWrapper(const
GetMainModelPart().CloneTimeStep();

if (rProjectParameters["solver_settings"]["reset_displacements"].GetBool()) {
constexpr auto source_index = std::size_t{0};
constexpr auto destination_index = std::size_t{1};
RestoreValuesOfNodalVariable(DISPLACEMENT, source_index, destination_index);
RestoreValuesOfNodalVariable(ROTATION, source_index, destination_index);
ResetValuesOfNodalVariable(DISPLACEMENT);
ResetValuesOfNodalVariable(ROTATION);

VariableUtils{}.UpdateCurrentToInitialConfiguration(GetComputationalModelPart().Nodes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoSettlement
const std::stringstream& rKratosLogBuffer) const;

template <typename TVariableType>
void RestoreValuesOfNodalVariable(const TVariableType& rVariable, Node::IndexType SourceIndex, Node::IndexType DestinationIndex)
void ResetValuesOfNodalVariable(const TVariableType& rVariable)
{
if (!GetComputationalModelPart().HasNodalSolutionStepVariable(rVariable)) return;

Expand Down

0 comments on commit c0a277c

Please sign in to comment.