- builderThe BoundaryMeshBuilder providing the surface mesh and boundary elements.
C++ Type:UserObjectName
Controllable:No
Description:The BoundaryMeshBuilder providing the surface mesh and boundary elements.
PointInPolyhedronCheckUO
PointInPolyhedronCheckUO determines whether a point is inside, outside, or on a single closed surface mesh. It obtains the surface mesh and the surface-element wrappers from a BoundaryMeshBuilder named through the builder parameter, and reports a per-point classification. Points on the surface are treated as inside. The object overrides spatialValue() (1 for inside/on, 0 for outside), so it works directly with SpatialUserObjectAux.
Point-containment methods
The point_containment_method parameter selects the classification backend:
pca_ray(default) casts a ray from the query point and counts surface-element crossings, using a direction chosen automatically from a principal-component analysis of the surface. Supports 2-DEDGE2and 3-DTRI3surfaces.user_selected_rayuses the same ray-casting engine but with the direction given by theray_directionparameter, used exactly as supplied (no automatic selection or replacement). Any finite, non-zero direction is allowed, including oblique ones; for a 2-D surface the direction must lie in the mesh plane (zerozcomponent). The user is responsible for avoiding directions that graze a vertex or edge or run tangent to the surface; such an ambiguous query is reported as an error rather than silently redirected. Supports 2-DEDGE2and 3-DTRI3surfaces.fixed_x_rayuses the TriangleManifold engine (a fixed +x ray with a solid-angle fallback). This engine supports only 3-DTRI3surfaces and does not produce OBB/ray debug files.
ray_direction is meaningful only for user_selected_ray; it must be non-zero there and must be left unset for the other methods. obb_file_name and ray_file_name request debug output from the ray-casting backends; with fixed_x_ray they are ignored and an informational message is emitted.
Usage
Set builder to the name of a BoundaryMeshBuilder user object. tolerance controls how close to the surface a point is treated as on it, and leaf_max_size tunes the KD-tree used by the ray-casting backends. Because the in-out test requires a closed, replicated surface mesh, run these cases with mesh_mode = REPLICATED.
The containment result is available through the standard spatial user object interface. A SpatialUserObjectAux evaluates it at mesh nodes or element centroids and stores the result in an auxiliary variable. A SpatialUserObjectVectorPostprocessor evaluates it at explicitly specified points and writes the values in the same order as the points parameter. Both interfaces report 1 for SurfaceSide::INSIDE or SurfaceSide::ON and 0 for SurfaceSide::OUTSIDE.
Composition into a union
PointInPolyhedronCheckUO implements the point-in-surface check interface, so it can be listed as a provider of a PointInUnionCheckUO to contribute a meshed closed surface to a composite geometry.
The following complete input creates a closed surface, configures a PointInPolyhedronCheckUO, stores mesh-wide classifications in the inside auxiliary variable, and evaluates one interior and one exterior point with a vector postprocessor:
# Framework point-in-polyhedron test using only MooseTestApp objects.
#
# A closed TRI3 surface (the shell of a TET4 sphere) is saved and handed to a
# BoundaryMeshBuilder. A PointInPolyhedronCheckUO with the fixed_x_ray backend
# (the TriangleManifold engine) classifies element centroids of the background
# mesh via a SpatialUserObjectAux (1 inside/on, 0 outside).
cx = 2.0
cy = 2.0
cz = 2.0
[Problem<<<{"href": "../../syntax/Problem/index.html"}>>>]
solve = false
[]
[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
[ball]
type = SphereMeshGenerator<<<{"description": "Generate a sphere (ball) mesh centered on the origin", "href": "../meshgenerators/SphereMeshGenerator.html"}>>>
radius<<<{"description": "Sphere (ball) radius"}>>> = 1.0
nr<<<{"description": "Number of refinements"}>>> = 1
elem_type<<<{"description": "The type of element to generate"}>>> = TET4
[]
[shell]
type = LowerDBlockFromSidesetGenerator<<<{"description": "Adds lower dimensional elements on the specified sidesets.", "href": "../meshgenerators/LowerDBlockFromSidesetGenerator.html"}>>>
input<<<{"description": "The mesh we want to modify"}>>> = ball
sidesets<<<{"description": "The sidesets from which to create the new block"}>>> = '0'
new_block_id<<<{"description": "The lower dimensional block id to create"}>>> = 100
[]
[extract]
type = BlockToMeshConverterGenerator<<<{"description": "Converts one or more blocks (subdomains) from a mesh into a stand-alone mesh with a single block in it.", "href": "../meshgenerators/BlockToMeshConverterGenerator.html"}>>>
input<<<{"description": "The mesh we want to modify"}>>> = shell
target_blocks<<<{"description": "The (list of) blocks (or 'subdomains') we wish to have moved to a new mesh (by name, not ID)"}>>> = '100'
[]
[surface_mesh]
type = TransformGenerator<<<{"description": "Applies a linear transform to the entire mesh.", "href": "../meshgenerators/TransformGenerator.html"}>>>
transform<<<{"description": "The type of transformation to perform (TRANSLATE, TRANSLATE_CENTER_ORIGIN, TRANSLATE_MIN_ORIGIN, ROTATE, SCALE, ROTATE_WITH_MATRIX, ROTATE_EXT)"}>>> = TRANSLATE
vector_value<<<{"description": "The value to use for the transformation. When using TRANSLATE or SCALE, the xyz coordinates are applied in each direction respectively. When using ROTATE, the values are interpreted as the Euler angles phi, theta and psi given in degrees. For ROTATE_EXT, an extrinsic rotation is carried out using prescribed Euler angles alpha, beta, and gamma in degrees."}>>> = '${cx} ${cy} ${cz}'
input<<<{"description": "The mesh we want to modify"}>>> = extract
save_with_name<<<{"description": "Keep the mesh from this mesh generator in memory with the name specified"}>>> = 'surface_mesh'
[]
[gen]
type = CartesianMeshGenerator<<<{"description": "This CartesianMeshGenerator creates a non-uniform Cartesian mesh.", "href": "../meshgenerators/CartesianMeshGenerator.html"}>>>
dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 3
dx<<<{"description": "Intervals in the X direction"}>>> = '4'
dy<<<{"description": "Intervals in the Y direction (required when dim>1 otherwise ignored)"}>>> = '4'
dz<<<{"description": "Intervals in the Z direction (required when dim>2 otherwise ignored)"}>>> = '4'
ix<<<{"description": "Number of grids in all intervals in the X direction (default to all one)"}>>> = '8'
iy<<<{"description": "Number of grids in all intervals in the Y direction (default to all one)"}>>> = '8'
iz<<<{"description": "Number of grids in all intervals in the Z direction (default to all one)"}>>> = '8'
subdomain_id<<<{"description": "Block IDs (default to all zero)"}>>> = '1'
[]
final_generator = 'gen'
[]
[AuxVariables<<<{"href": "../../syntax/AuxVariables/index.html"}>>>]
[inside]
family<<<{"description": "Specifies the family of FE shape functions to use for this variable"}>>> = MONOMIAL
order<<<{"description": "Specifies the order of the FE shape function to use for this variable (additional orders not listed are allowed)"}>>> = CONSTANT
[]
[]
[AuxKernels<<<{"href": "../../syntax/AuxKernels/index.html"}>>>]
[inside]
type = SpatialUserObjectAux<<<{"description": "Populates an auxiliary variable with a spatial value returned from a UserObject spatialValue method.", "href": "../auxkernels/SpatialUserObjectAux.html"}>>>
variable<<<{"description": "The name of the variable that this object applies to"}>>> = inside
user_object<<<{"description": "The UserObject UserObject to get values from. Note that the UserObject _must_ implement the spatialValue() virtual function!"}>>> = in_out_test
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = 'initial'
[]
[]
[UserObjects<<<{"href": "../../syntax/UserObjects/index.html"}>>>]
[surface_builder]
type = BoundaryMeshBuilder<<<{"description": "Owns a saved surface (boundary) mesh and the SurfaceElement wrappers built from it, for use by point-containment and distance user objects.", "href": "BoundaryMeshBuilder.html"}>>>
surface_mesh<<<{"description": "The name of the surface mesh saved via the MeshGenerator's `save_with_name` parameter."}>>> = surface_mesh
[]
[in_out_test]
type = PointInPolyhedronCheckUO<<<{"description": "Determines whether a point is inside a closed surface mesh provided by a BoundaryMeshBuilder.", "href": "PointInPolyhedronCheckUO.html"}>>>
builder<<<{"description": "The BoundaryMeshBuilder providing the surface mesh and boundary elements."}>>> = surface_builder
point_containment_method<<<{"description": "Algorithm used for point-containment queries. 'pca_ray' (default) uses the ray-casting engine with a PCA-selected ray; 'user_selected_ray' uses the ray-casting engine with the 'ray_direction' parameter; 'fixed_x_ray' uses the TriangleManifold engine (fixed +x ray, TRI3 surfaces only)."}>>> = fixed_x_ray
[]
[]
[VectorPostprocessors<<<{"href": "../../syntax/VectorPostprocessors/index.html"}>>>]
[point_containment]
type = SpatialUserObjectVectorPostprocessor<<<{"description": "Outputs the values of a spatial user object in the order of the specified spatial points", "href": "../vectorpostprocessors/SpatialUserObjectVectorPostprocessor.html"}>>>
userobject<<<{"description": "The userobject whose values are to be reported"}>>> = in_out_test
points<<<{"description": "Computations will be lumped into values at these points."}>>> = '${cx} ${cy} ${cz}
0 0 0'
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = initial
[]
[]
[Executioner<<<{"href": "../../syntax/Executioner/index.html"}>>>]
type = Steady
[]
[Outputs<<<{"href": "../../syntax/Outputs/index.html"}>>>]
exodus<<<{"description": "Output the results using the default settings for Exodus output."}>>> = true
csv<<<{"description": "Output the scalar variable and postprocessors to a *.csv file using the default CSV output."}>>> = true
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = initial
[](test/tests/userobjects/point_in_polyhedron/fixed_x_ray.i)Determines whether a point is inside a closed surface mesh provided by a BoundaryMeshBuilder.
Input Parameters
- leaf_max_size10Maximum number of elements in a leaf node of the KD-tree.
Default:10
C++ Type:int
Controllable:No
Description:Maximum number of elements in a leaf node of the KD-tree.
- obb_file_nameOriented Bounding Box (OBB) debug file name.
C++ Type:FileName
Controllable:No
Description:Oriented Bounding Box (OBB) debug file name.
- point_containment_methodpca_rayAlgorithm used for point-containment queries. 'pca_ray' (default) uses the ray-casting engine with a PCA-selected ray; 'user_selected_ray' uses the ray-casting engine with the 'ray_direction' parameter; 'fixed_x_ray' uses the TriangleManifold engine (fixed +x ray, TRI3 surfaces only).
Default:pca_ray
C++ Type:MooseEnum
Controllable:No
Description:Algorithm used for point-containment queries. 'pca_ray' (default) uses the ray-casting engine with a PCA-selected ray; 'user_selected_ray' uses the ray-casting engine with the 'ray_direction' parameter; 'fixed_x_ray' uses the TriangleManifold engine (fixed +x ray, TRI3 surfaces only).
- ray_direction0 0 0Ray direction for the 'user_selected_ray' method, used exactly as given (no auto-selection). Any finite non-zero direction is allowed, including oblique; for a 2D surface it must lie in the mesh plane (zero z component). The user is responsible for avoiding directions that graze vertices/edges or are tangent to the surface. Other methods ignore this parameter.
Default:0 0 0
C++ Type:libMesh::Point
Controllable:No
Description:Ray direction for the 'user_selected_ray' method, used exactly as given (no auto-selection). Any finite non-zero direction is allowed, including oblique; for a 2D surface it must lie in the mesh plane (zero z component). The user is responsible for avoiding directions that graze vertices/edges or are tangent to the surface. Other methods ignore this parameter.
- ray_file_nameRay debug file name.
C++ Type:FileName
Controllable:No
Description:Ray debug file name.
- tolerance1e-06Tolerance used for intersection or surface-proximity checks. Determines whether a point is considered on the surface.
Default:1e-06
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Tolerance used for intersection or surface-proximity checks. Determines whether a point is considered on the surface.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
Execution Scheduling Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_enclosed_surface.i)
- (test/tests/userobjects/point_in_union/union_two_meshes.i)
- (test/tests/userobjects/point_in_union/union_mesh_and_function.i)
- (test/tests/userobjects/point_in_polyhedron/pca_ray_2d_msh.i)
- (test/tests/userobjects/point_in_polyhedron/pca_ray_2d.i)
- (test/tests/userobjects/point_in_polyhedron/fixed_x_ray.i)
- (modules/shifted_boundary_method/test/tests/distance_calc/2D_signed_distance.i)
- (test/tests/userobjects/point_in_union/union_mesh_and_msh.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_lambda0.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_triangle_clip.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_lambda0p5.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda0.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_edge_clip.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_obb_write.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_mark_intercepted.i)
- (test/tests/userobjects/point_in_polyhedron/pca_ray_3d_stl.i)
- (test/tests/userobjects/point_in_polyhedron/fixed_x_ray_non_tri3.i)
- (test/tests/userobjects/point_in_union/union_mesh_and_stl.i)
- (test/tests/userobjects/point_in_polyhedron/user_ray_direction.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda1.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/2D_lambda1.i)
- (modules/shifted_boundary_method/test/tests/in_out_test/3D_lambda0p5.i)