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

Added parameters for watertight sideset and nodeset diagnostic check #29136

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

DanielYankura
Copy link
Contributor

-Diagnostics can now take an additional vector parameter _watertight_boundaries
-Users can use it to input a list of sidesets/nodesets
-If supplied the diagnostic check functionality changes
-It will instead check if an external side/node is assigned to one of the provided boundary ids
-The error message for these instances is worded differently to reflect what the diagnostic check is looking for
-The t in checkWaterTightSidesets is now lowercase because it was bothering me and to match checkWatertightNodesets

closes #29077

Reason

To provide users with more mesh debugging tools

Design

Users can supply a list of boundary ids. If supplied this diagnostic check looks for sides/nodes that are external and that are not assigned to one of the prescribed boundaries.

Impact

This modifies the checkWatertightSideset and checkWatertightNodeset diagnostic tools. If no list of boundary ids is supplied however, then they behave the same as they did before.

-Diagnostics can now take an additional vector parameter _watertight_boundaries
-Users can use it to input a list of sidesets/nodesets
-If supplied the diagnostic check functionality changes
-It will instead check if an external side/node is assigned to one of the provided boundary ids
-The error message for these instances is worded differently to reflect what the diagnostic check is looking for
-The t in checkWaterTightSidesets is now lowercase because it was bothering me and to match checkWatertightNodesets

closes idaholab#29077
@moosebuild
Copy link
Contributor

Job Precheck, step Clang format on 3c505cd wanted to post the following:

Your code requires style changes.

A patch was auto generated and copied here
You can directly apply the patch by running, in the top level of your repository:

curl -s https://mooseframework.inl.gov/docs/PRs/29136/clang_format/style.patch | git apply -v

Alternatively, with your repository up to date and in the top level of your repository:

git clang-format 9446d5fc904cc635205b563219f91889cd5a678c

@moosebuild
Copy link
Contributor

Job Documentation, step Docs: sync website on 41d5897 wanted to post the following:

View the site here

This comment will be updated on new commits.

@GiudGiud GiudGiud self-assigned this Nov 26, 2024
Comment on lines +40 to +41
findBoundaryOverlap(std::vector<boundary_id_type>,
std::vector<boundary_id_type> boundary_ids) const;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
findBoundaryOverlap(std::vector<boundary_id_type>,
std::vector<boundary_id_type> boundary_ids) const;
findBoundaryOverlap(const std::vector<boundary_id_type> & boundary_copy,
const std::vector<boundary_id_type> & boundary_ids) const;

//// Routine to check is mesh is fully covered in nodesets
void checkWatertightNodesets(const std::unique_ptr<MeshBase> & mesh) const;
/// Helper function that finds the intersection of the _watertight_boundaries vector and the provided one
Copy link
Contributor

Choose a reason for hiding this comment

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

it does not use _waterright_boundaries, but rather a copy that is sorted.
so just write the description in a more general manner that does not mention _watertight_boundaries

@@ -49,6 +49,8 @@ MeshDiagnosticsGenerator::validParams()
"check_for_watertight_nodesets",
chk_option,
"whether to check for external nodes that are not assigned to any nodeset");
params.addParam<std::vector<BoundaryID>>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
params.addParam<std::vector<BoundaryID>>(
params.addParam<std::vector<BoundaryName>>(

let s do names. ids, especially for boundaries, are really error-prone

@@ -49,6 +49,8 @@ MeshDiagnosticsGenerator::validParams()
"check_for_watertight_nodesets",
chk_option,
"whether to check for external nodes that are not assigned to any nodeset");
params.addParam<std::vector<BoundaryID>>(
"boundaries_to_check", {}, "IDs of boundaries to be checked for watertight checks");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"boundaries_to_check", {}, "IDs of boundaries to be checked for watertight checks");
"boundaries_to_check", {}, "Names boundaries that should form a watertight envelope around the mesh. Defaults to all the boundaries combined.");

Comment on lines +306 to +308
// Make copy of _watertight_boundaries and sort it for later use
std::vector<BoundaryID> boundary_copy = _watertight_boundaries;
std::sort(boundary_copy.begin(), boundary_copy.end());
Copy link
Contributor

Choose a reason for hiding this comment

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

would not hurt to just store it sorted

// If external check if that side had a sideset
// If external get the boundary ids associated with this side
std::vector<boundary_id_type> boundary_ids;
// boundary_info.boundary_ids(elem, i, boundary_ids);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// boundary_info.boundary_ids(elem, i, boundary_ids);

@@ -330,6 +340,25 @@ MeshDiagnosticsGenerator::checkWaterTightSidesets(const std::unique_ptr<MeshBase
num_faces_without_sideset++;
}
}
else if (!_watertight_boundaries.empty() && intersections.empty())
Copy link
Contributor

Choose a reason for hiding this comment

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

can you consolidate all of this code by doing:
if (...... OR (!_watertight_boundaries.empty() && intersections.empty()))

"of the specified nodesets";
_console << message << std::endl;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

same comments here

Comment on lines +458 to +459
MeshDiagnosticsGenerator::findBoundaryOverlap(std::vector<boundary_id_type> boundary_copy,
std::vector<boundary_id_type> boundary_ids) const
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
MeshDiagnosticsGenerator::findBoundaryOverlap(std::vector<boundary_id_type> boundary_copy,
std::vector<boundary_id_type> boundary_ids) const
MeshDiagnosticsGenerator::findBoundaryOverlap(const std::vector<boundary_id_type> & boundary_copy,
std::vector<boundary_id_type> & boundary_ids) const

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.

Add additional parameter for watertight nodeset and sideset check
3 participants