Skip to content

Conversation

@markelov208
Copy link
Contributor

@markelov208 markelov208 commented Dec 18, 2025

📝 Description
A brief description of the PR.

  • split hpp files into header and cpp files
  • renamed some headers into hpp if they include template functions

@markelov208 markelov208 self-assigned this Dec 18, 2025
@markelov208 markelov208 requested a review from a team as a code owner December 18, 2025 12:44
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 efforts of splitting classes into header + source, improving the 'include health' in a lot of these classes and also making the changes in a way that makes diffing as easy as possible (i.e. you kept the same order in the functions, that's much appreciated 😄 ).

I didn't do an in-depth review of all code, but mainly checked it stayed the same and all implementations were moved out of the headers. I only have a few minor comments about forward declares, includes and some left-over implementations in .h files.

namespace Kratos
{
class ModelPart;
class Parameters;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the Parameters are passed to the constructor by value, a forward declare does not work (I guess the parameters are included implicitly somehow). This same comment applies to other processes

{

class Model;
class Parameters;
Copy link
Contributor

Choose a reason for hiding this comment

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

Here the forward declare does work, because the Parameters are passed as reference 👍

{

class ModelPart;
class Parameters;
Copy link
Contributor

Choose a reason for hiding this comment

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

Here again it shouldn't work, since the parameters are passed by value. I won't mention it for the rest of the processes, but it's something to double-check 👍

Comment on lines +108 to +116
/// output stream function
inline std::ostream& operator<<(std::ostream& rOStream, const ApplyConstantInterpolateLinePressureProcess& rThis)
{
rThis.PrintInfo(rOStream);
rOStream << std::endl;
rThis.PrintData(rOStream);

return rOStream;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this also be moved to 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.

I think it is possible but then it could not be inline, right? As far as I remember a compiler makes a decision and it can ignore inline statements.


namespace Kratos
{
using namespace std::string_literals;
Copy link
Contributor

Choose a reason for hiding this comment

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

std::string_literals is defined in the header. For completeness I think it's a good idea to include it here (I guess now it gets in somewhere implicitly). This probably also holds for other processes


#include "processes/process.h"

#include <memory>
Copy link
Contributor

Choose a reason for hiding this comment

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

We use std::unique_ptr in this file, so we should keep this include

inline std::istream& operator>>(std::istream& rIStream, ApplyWriteScalarProcess& rThis);

/// output stream function
inline std::ostream& operator<<(std::ostream& rOStream, const ApplyWriteScalarProcess& rThis)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this implementation also be moved to the cpp?

Comment on lines 50 to 57
inline std::ostream& operator<<(std::ostream& rOStream, const ApplyPhreaticMultiLinePressureTableProcess& rThis)
{
rThis.PrintInfo(rOStream);
rOStream << std::endl;
rThis.PrintData(rOStream);

return rOStream;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this one also be moved to the cpp?

Comment on lines 127 to 134
inline std::ostream& operator<<(std::ostream& rOStream, const DeactivateConditionsOnInactiveElements& rThis)
{
rThis.PrintInfo(rOStream);
rOStream << std::endl;
rThis.PrintData(rOStream);

return rOStream;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this implementation also be moved to the cpp?

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