Skip to content

Conversation

@markelov208
Copy link
Contributor

@markelov208 markelov208 commented Dec 9, 2025

📝 Description
A brief description of the PR.

Actions have been done for files in custom_elements folder

  • moved constructors and functions from header files to cpp files,
  • renamed U_Pw_element.h and integration_coefficients.h into hpp because they hold template functions and lamdas.
  • renamed hpp to h: U_Pw_base_element, U_Pw_small_strain_FIC_element, U_Pw_small_strain_element, U_Pw_small_strain_interface_element, U_Pw_updated_lagragian_FIC_element, U_Pw_updated_lagragian_element, geo_cr_beam_element_linear_2D2N, small_strain_U_Pw_diff_order_element,
    steady_state_Pw_element, transient_Pw_element, and updated_lagragianU_Pw_diff_order_element

@markelov208 markelov208 self-assigned this Dec 9, 2025
@markelov208 markelov208 requested a review from a team as a code owner December 9, 2025 23:27
…-cpp-elements

# Conflicts:
#	applications/GeoMechanicsApplication/test_setup_utilities/element_setup_utilities.cpp
Copy link
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the effort on the element! I mainly have comments about includes that can now be (re)moved from some headers and I think for the stress_state_policy.h header, we could still move some functions to the cpp.

Comment on lines 21 to 24
#include "custom_utilities/transport_equation_utilities.hpp"
#include "custom_utilities/variables_utilities.hpp"
#include "geo_mechanics_application_variables.h"
#include "includes/cfd_variables.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These includes can probably be moved to the source file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

Comment on lines 154 to 157
Matrix CalculateNContainer()
{
return GetGeometry().ShapeFunctionsValues(GetIntegrationMethod());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be moved to the cpp file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

Comment on lines 164 to 169
Vector CalculateIntegrationCoefficients()
{
GetGeometry().DeterminantOfJacobian(mDetJCcontainer, this->GetIntegrationMethod());
return mIntegrationCoefficientsCalculator.Run<Vector>(
GetGeometry().IntegrationPoints(GetIntegrationMethod()), mDetJCcontainer, this);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be moved to the cpp file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

Comment on lines 176 to 180
std::vector<double> CalculateFluidPressure()
{
return GeoTransportEquationUtilities::CalculateFluidPressures(
mNContainer, VariablesUtilities::GetNodalValuesOf<TNumNodes>(WATER_PRESSURE, this->GetGeometry()));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be moved to the cpp file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

Comment on lines 223 to 226
[[nodiscard]] DofsVectorType GetDofs() const
{
return Geo::DofUtilities::ExtractDofsFromNodes(GetGeometry(), WATER_PRESSURE);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be moved to the cpp file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

#include "custom_elements/U_Pw_base_element.hpp"
#include "custom_elements/U_Pw_base_element.h"
#include "custom_utilities/interface_element_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to cpp

Comment on lines 23 to 24
#include "custom_utilities/stress_strain_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two includes are no longer used (maybe in the cpp)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stress_strain_utilities is removed and geo.. moved to cpp

Comment on lines 24 to 25
#include "custom_utilities/stress_strain_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same ;)


/// Default Constructor
UpdatedLagrangianUPwDiffOrderElement() : SmallStrainUPwDiffOrderElement() {}
UpdatedLagrangianUPwDiffOrderElement();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be just an =default in the header:

Suggested change
UpdatedLagrangianUPwDiffOrderElement();
UpdatedLagrangianUPwDiffOrderElement() = default;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 18 to 19
#include "custom_utilities/stress_strain_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two seem to be unused (maybe also element_utilities?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stress_strain_utilities is removed and geo.. moved to cpp.

Copy link
Contributor Author

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Richard, many thanks for the review. I moved more includes to cpp, as a result some test files have been updated.


typename FluidBodyFlowCalculator<TNumNodes>::InputProvider CreateFluidBodyFlowInputProvider();

auto MakePropertiesGetter()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to move them to cpp. They shall be converted to real functions that is a lot of work and may slow down Kratos.

Comment on lines 21 to 24
#include "custom_utilities/transport_equation_utilities.hpp"
#include "custom_utilities/variables_utilities.hpp"
#include "geo_mechanics_application_variables.h"
#include "includes/cfd_variables.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

Comment on lines 154 to 157
Matrix CalculateNContainer()
{
return GetGeometry().ShapeFunctionsValues(GetIntegrationMethod());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

Comment on lines 164 to 169
Vector CalculateIntegrationCoefficients()
{
GetGeometry().DeterminantOfJacobian(mDetJCcontainer, this->GetIntegrationMethod());
return mIntegrationCoefficientsCalculator.Run<Vector>(
GetGeometry().IntegrationPoints(GetIntegrationMethod()), mDetJCcontainer, this);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

Comment on lines 176 to 180
std::vector<double> CalculateFluidPressure()
{
return GeoTransportEquationUtilities::CalculateFluidPressures(
mNContainer, VariablesUtilities::GetNodalValuesOf<TNumNodes>(WATER_PRESSURE, this->GetGeometry()));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

#include "custom_elements/U_Pw_base_element.hpp"
#include "custom_elements/U_Pw_base_element.h"
#include "custom_utilities/interface_element_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to cpp

Comment on lines 23 to 24
#include "custom_utilities/stress_strain_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stress_strain_utilities is removed and geo.. moved to cpp

Comment on lines 24 to 25
#include "custom_utilities/stress_strain_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same ;)


/// Default Constructor
UpdatedLagrangianUPwDiffOrderElement() : SmallStrainUPwDiffOrderElement() {}
UpdatedLagrangianUPwDiffOrderElement();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 18 to 19
#include "custom_utilities/stress_strain_utilities.h"
#include "geo_mechanics_application_variables.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stress_strain_utilities is removed and geo.. moved to cpp.

Copy link
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for processing the review comments, to me this looks ready to go!

@markelov208
Copy link
Contributor Author

Hi @avdg81 , Richard made a very thorough review. If you would like to take a look, please could you let me know? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Move all non-template code to .cpp files and make sure any .h file does not contain any implementations

3 participants