https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MeshDiagnosticsGenerator.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MeshGenerator.h"
13#include "MooseEnum.h"
14
15/*
16 * Mesh 'generator' to diagnose potentially unsupported features or miscellaneous issues
17 */
19{
20public:
22
24
25 std::unique_ptr<MeshBase> generate() override;
26
27protected:
29 std::unique_ptr<MeshBase> & _input;
30
31private:
33 void checkSidesetsOrientation(const std::unique_ptr<MeshBase> & mesh) const;
35 void checkWatertightSidesets(const std::unique_ptr<MeshBase> & mesh) const;
37 void checkWatertightNodesets(const std::unique_ptr<MeshBase> & mesh) const;
39 std::vector<boundary_id_type>
40 findBoundaryOverlap(const std::vector<boundary_id_type> & watertight_boundaries,
41 std::vector<boundary_id_type> & boundary_ids) const;
43 void checkElementVolumes(const std::unique_ptr<MeshBase> & mesh) const;
45 void checkElementTypes(const std::unique_ptr<MeshBase> & mesh) const;
47 void checkElementOverlap(const std::unique_ptr<MeshBase> & mesh) const;
49 void checkNonPlanarSides(const std::unique_ptr<MeshBase> & mesh) const;
51 void checkNonConformalMesh(const std::unique_ptr<MeshBase> & mesh) const;
53 void checkNonConformalMeshFromAdaptivity(const std::unique_ptr<MeshBase> & mesh) const;
55 void checkLocalJacobians(const std::unique_ptr<MeshBase> & mesh) const;
57 void checkNonMatchingEdges(const std::unique_ptr<MeshBase> & mesh) const;
59 void checkPolygons(const std::unique_ptr<MeshBase> & mesh) const;
60
69 void diagnosticsLog(std::string msg, const MooseEnum & log_level, bool problem_detected) const;
70
78 std::vector<BoundaryName> _watertight_boundary_names;
80 std::vector<BoundaryID> _watertight_boundaries;
84 const Real _min_volume;
86 const Real _max_volume;
108 const unsigned int _num_outputs;
109};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void checkSidesetsOrientation(const std::unique_ptr< MeshBase > &mesh) const
Routine to check sideset orientation near subdomains.
const MooseEnum _check_element_volumes
whether to check element volumes
const MooseEnum _check_sidesets_orientation
whether to check that sidesets are consistently oriented using neighbor subdomains
void checkPolygons(const std::unique_ptr< MeshBase > &mesh) const
Routine to check for non-convex polygons.
const MooseEnum _check_adaptivity_non_conformality
whether to check for the adaptivity of non-conformal meshes
const Real _non_conformality_tol
tolerance for detecting when meshes are not conformal
const MooseEnum _check_element_overlap
whether to check for intersecting elements
const MooseEnum _check_polygons
whether to check for non-convex polygons in the mesh
std::vector< BoundaryName > _watertight_boundary_names
Names of boundaries to be checked in watertight checks.
const MooseEnum _check_watertight_sidesets
whether to check that each external side is assigned to a sideset
void checkWatertightNodesets(const std::unique_ptr< MeshBase > &mesh) const
const MooseEnum _check_non_planar_sides
whether to check for elements in different planes (non_planar)
std::vector< BoundaryID > _watertight_boundaries
IDs of boundaries to be checked in watertight checks.
std::unique_ptr< MeshBase > & _input
the input mesh to be diagnosed
const MooseEnum _check_non_conformal_mesh
whether to check for non-conformal meshes
const unsigned int _num_outputs
number of logs to output at most for each check
void checkNonConformalMeshFromAdaptivity(const std::unique_ptr< MeshBase > &mesh) const
Routine to check whether a mesh presents non-conformality born from adaptivity.
void checkElementVolumes(const std::unique_ptr< MeshBase > &mesh) const
Routine to check the element volumes.
void checkLocalJacobians(const std::unique_ptr< MeshBase > &mesh) const
Routine to check whether the Jacobians (elem and side) are not negative.
const Real _max_volume
maximum size for element volume to be counted as a big element
void checkWatertightSidesets(const std::unique_ptr< MeshBase > &mesh) const
static InputParameters validParams()
void checkNonMatchingEdges(const std::unique_ptr< MeshBase > &mesh) const
Routine to check for non matching edges.
const MooseEnum _check_watertight_nodesets
whether to check that each external node is assigned to a nodeset
const MooseEnum _check_element_types
whether to check different element types in the same sub-domain
void checkNonConformalMesh(const std::unique_ptr< MeshBase > &mesh) const
Routine to check whether a mesh presents non-conformality.
void checkElementOverlap(const std::unique_ptr< MeshBase > &mesh) const
Routine to check whether elements overlap in the mesh.
const Real _min_volume
minimum size for element volume to be counted as a tiny element
std::vector< boundary_id_type > findBoundaryOverlap(const std::vector< boundary_id_type > &watertight_boundaries, std::vector< boundary_id_type > &boundary_ids) const
Helper function that finds the intersection between the given vectors.
void checkNonPlanarSides(const std::unique_ptr< MeshBase > &mesh) const
Routine to check whether there are non-planar sides in the mesh.
void checkElementTypes(const std::unique_ptr< MeshBase > &mesh) const
Routine to check the element types in each subdomain.
void diagnosticsLog(std::string msg, const MooseEnum &log_level, bool problem_detected) const
Utility routine to output the final diagnostics level in the desired mode.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
const MooseEnum _check_local_jacobian
whether to check for negative jacobians in the domain
MeshGenerators are objects that can modify or add to an existing mesh.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55