Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GeoMechanicsApplication] Phreatic multi line #11184

Merged
merged 35 commits into from
Oct 20, 2023

Conversation

mcgicjn2
Copy link
Contributor

@mcgicjn2 mcgicjn2 commented May 25, 2023

📝 Description
Added phreatic multi line both statically (constant) and transiently (table) processes

🆕 Changelog

  • Added apply constant phreatic multiline process
  • Added apply phreatic multiline table process
  • Some changes to test helper

Closes #10290

mcgicjn2 and others added 18 commits January 31, 2023 15:38
Destructors are special member functions that are overridden when the
base class destructor is `virtual`. Don't supply empty function bodies,
but use `= default` instead. Note that this is in line with C.80: "Use
`=default` if you have to be explicit about using the default semantics"
from the C++ Core Guidelines.
Some macro usages were followed by a semicolon, whereas this was not
needed. As a result, we had some empty statements. Those have been
removed now.
To comply with Kratos' Style Guide several variables names were
converted from lowerCamelCase to snake_case.
The implementations of these overrides were identical to the
implementations of their base class counterparts. In fact, all function
bodies were empty. Therefore, there was no point in overriding the base
class behaviour, since they were identical. Removed the overrides.
The fixes include:
- Removed a few unused variables from a Python script.
- Added two early exits to reduce the number of nested `if` statements.
- Avoid narrowing due to implicit converions. Use `static_cast`s to make
  clear that the conversions are intentional.
- Removed a variable from the C++ code that did not have any added
  value. We now use the returned value directly rather than assigning it
  first.
- In line with C.81 "Use `=delete` when you want to disable default
  behavior (without wanting an alternative)" of the C++ Core Guidelines,
  two private copy assignment operators and two private copy
  constructors have been deleted.
- Replaced one `typedef` by `using`.
- Avoid hiding an inherited non-virtual function.
- Replaced a raw `for` loop by a standard transformation.
- Attempted to reduce the Cognitive Complexity of a Python function.
  * Reduced the maximum number of nested `if` statements.
  * Reordered some code to make it read more naturally.
  * Renamed a few variables.
- Converted several protected data members to private data members. For
  most of them getters have been added, too. In this way, we comply with
  C.133: "Avoid `protected` data" of the C++ Core Guidelines.
- Removed two unused (protected) data members.
@mcgicjn2
Copy link
Contributor Author

This is now being reopened as is required by several projects.

@mcgicjn2 mcgicjn2 reopened this Aug 23, 2023
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.

The code itself is quite clear, so most comments I have are minor changes to the structure and naming that can be done very quickly (~minutes).

However, there are three topics that will require more work:

  1. The inheritance direction of these two classes is the wrong way around. The 'Constant' version is a more specific version of the 'normal' one, so 'Constant' should inherit from 'normal', not the other way around as it is now. This is the biggest item of this list.
  2. The changes made to the apply_scalar_constraint_table_process should be moved to the C++ equivalent after these changes are merged to master.
  3. The .hpp files for the processes should be split into .h and .cpp. This is not a lot of work, but slightly more than trivial.

I know this code was for a large part copied from earlier development, but since it's new code, adding it to master in the current state would add to our technical debt. Therefore, I'd propose that we first spend some time to improve it.

@carloslubbers carloslubbers added the GeoMechanics Issues related to the GeoMechanicsApplication label Oct 10, 2023
@carloslubbers carloslubbers changed the title Geo/10290 phreatic multi line [GeoMechanicsApplication] Phreatic multi line Oct 10, 2023
@rfaasse rfaasse self-requested a review October 18, 2023 15:05
rfaasse
rfaasse previously approved these changes Oct 18, 2023
mnabideltares
mnabideltares previously approved these changes Oct 19, 2023
@rfaasse rfaasse merged commit 43dfecf into master Oct 20, 2023
11 checks passed
@rfaasse rfaasse deleted the geo/10290-phreatic-multi-line branch October 20, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GeoMechanics Issues related to the GeoMechanicsApplication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Phreatic error with discontinuous geometry
5 participants