SubdomainInterceptedGenerator

Classifies mesh elements into inside, outside, and optionally intercepted subdomains based on an analytical signed distance function expression.

Overview

The SubdomainInterceptedGenerator classifies and assigns subdomain IDs to elements in an input mesh based on an implicit interface defined by an analytical signed distance function expression .

This generator evaluates the signed distance function across the mesh to assign elements to: - An inside** subdomain ("subdomain_id_inside"), - An outside** subdomain ("subdomain_id_outside"), and - Optionally, a dedicated intercepted** subdomain ("subdomain_id_intercepted") for elements cut by the interface.

Classification Method

The interface is defined by the level-set condition: where is set by "threshold" (default is ).

Domain Orientation

The orientation of the inside domain relative to the signed distance function is controlled by "is_domain_inside_surface": - is_domain_inside_surface = true: Follows the standard convention where negative signed distance values represent the interior of an enclosed region. Points satisfying are categorized as inside the domain, and points satisfying are categorized as outside. - is_domain_inside_surface = false: Inverts the convention. Points satisfying are categorized as inside the domain, and points satisfying are categorized as outside.

Element Occupancy and Intercepted Elements

Each element in the input mesh is evaluated at its vertices (nodes) and sampled across its volume using a Gauss quadrature rule of order "qrule_order" (default is 9). The generator measures: 1. Whether all element nodes lie inside the domain (all_nodes_in_domain). 2. Whether all element nodes lie outside the domain (all_nodes_outside_domain). 3. The fraction of the element volume occupied by the inside region (fraction_of_element_in_domain), evaluated via numerical quadrature.

Elements are then categorized as follows: - Fully inside**: When all nodes lie inside and fraction_of_element_in_domain == 1.0, the element is assigned "subdomain_id_inside". - Fully outside**: When all nodes lie outside and fraction_of_element_in_domain == 0.0, the element is assigned "subdomain_id_outside". - Intercepted (cut) elements**: Elements that contain both inside and outside points are cut by the implicit boundary: - If "mark_intercepted" is true, these elements are assigned a dedicated subdomain ID specified by "subdomain_id_intercepted". - If "mark_intercepted" is false (the default), the element is resolved to either inside or outside based on the volume fraction threshold "lambda" (default is ). If the fraction of the element volume outside the domain exceeds , the element is assigned to outside; otherwise, it is assigned to inside.

Multi-Geometry Workflows

When constructing domains with multiple geometric features, inclusions, or composite shapes, multiple SubdomainInterceptedGenerator instances can be chained in sequence. To prevent subsequent generators from unintentionally overwriting previously assigned subdomains, several parameters are available:

Example Input File Syntax

Inclined Interface Partitioning

The following example demonstrates using SubdomainInterceptedGenerator to partition a 2D mesh across an inclined plane into subdomains 1 and 2, with is_domain_inside_surface = true:

[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
  [gen]
    type = CartesianMeshGenerator<<<{"description": "This CartesianMeshGenerator creates a non-uniform Cartesian mesh.", "href": "CartesianMeshGenerator.html"}>>>
    dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 2
    dx<<<{"description": "Intervals in the X direction"}>>> = '${x0} ${x0}'
    dy<<<{"description": "Intervals in the Y direction (required when dim>1 otherwise ignored)"}>>> = 1
    ix<<<{"description": "Number of grids in all intervals in the X direction (default to all one)"}>>> = '${nx_half} ${nx_half}'
    iy<<<{"description": "Number of grids in all intervals in the Y direction (default to all one)"}>>> = '${nx}'
    subdomain_id<<<{"description": "Block IDs (default to all zero)"}>>> = '1 2'
  []
  [intercepted]
    type = SubdomainInterceptedGenerator<<<{"description": "Classifies mesh elements into inside, outside, and optionally intercepted subdomains based on an analytical signed distance function expression.", "href": "SubdomainInterceptedGenerator.html"}>>>
    input<<<{"description": "The mesh to modify"}>>> = gen
    subdomain_id_inside<<<{"description": "Subdomain ID to assign to elements categorized inside the domain."}>>> = 2
    subdomain_id_outside<<<{"description": "Subdomain ID to assign to elements categorized outside the domain."}>>> = 1
    lambda<<<{"description": "Threshold applied to the fraction outside the retained domain for a partial element. This parameter cannot be set when 'mark_intercepted' is true."}>>> = 0.5
    is_domain_inside_surface<<<{"description": "Whether the inside domain corresponds to the negative signed distance region (< threshold). If true, points with signed distance < threshold are categorized as inside and > threshold as outside. If false, points with signed distance > threshold are categorized as inside."}>>> = true
    signed_dist_function<<<{"description": "Parsed function expression (in terms of x, y, and z) defining the signed distance function to the interface."}>>> = '(x-${x0})*sin(${theta_rad}) - cos(${theta_rad})*(y-${x0})'
  []
  [break]
    type = BreakMeshByBlockGenerator<<<{"description": "Break the mesh at interfaces between blocks. New nodes will be generated so elements on each side of the break are no longer connected.", "href": "BreakMeshByBlockGenerator.html"}>>>
    input<<<{"description": "The mesh we want to modify"}>>> = intercepted
    split_interface<<<{"description": "Interfaces are always created on both sides and split by block pairs."}>>> = true
    add_interface_on_two_sides<<<{"description": "Interfaces are always created on both sides and split by block pairs."}>>> = true
  []
[]
(modules/shifted_boundary_method/test/tests/shifted_cohesive_zone/angled_sczm_common.i)

Inverted Domain Orientation

When is_domain_inside_surface = false, points on the positive side of the signed distance function are categorized into the inside subdomain:

  [subdomain_intercepted]
    type = SubdomainInterceptedGenerator
    input = gen
    subdomain_id_inside = 1
    subdomain_id_outside = 2
    lambda = 0.5
    is_domain_inside_surface = false
    signed_dist_function = '-x+${x0}'
  []
(modules/shifted_boundary_method/test/tests/shifted_cohesive_zone/sczm_triangle_mms.i)

Input Parameters

  • inputThe mesh to modify

    C++ Type:MeshGeneratorName

    Controllable:No

    Description:The mesh to modify

  • is_domain_inside_surfaceFalseWhether the inside domain corresponds to the negative signed distance region (< threshold). If true, points with signed distance < threshold are categorized as inside and > threshold as outside. If false, points with signed distance > threshold are categorized as inside.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether the inside domain corresponds to the negative signed distance region (< threshold). If true, points with signed distance < threshold are categorized as inside and > threshold as outside. If false, points with signed distance > threshold are categorized as inside.

  • signed_dist_functionParsed function expression (in terms of x, y, and z) defining the signed distance function to the interface.

    C++ Type:std::string

    Controllable:No

    Description:Parsed function expression (in terms of x, y, and z) defining the signed distance function to the interface.

  • subdomain_id_insideSubdomain ID to assign to elements categorized inside the domain.

    C++ Type:unsigned short

    Controllable:No

    Description:Subdomain ID to assign to elements categorized inside the domain.

  • subdomain_id_outsideSubdomain ID to assign to elements categorized outside the domain.

    C++ Type:unsigned short

    Controllable:No

    Description:Subdomain ID to assign to elements categorized outside the domain.

Required Parameters

  • epsilon0Fuzzy comparison tolerance

    Default:0

    C++ Type:Real

    Unit:(no unit assumed)

    Controllable:No

    Description:Fuzzy comparison tolerance

  • keep_inside_as_insideFalseWhen 'multi_geo' is true, elements whose existing subdomain ID matches 'subdomain_id_inside' are skipped, preserving their existing subdomain assignment.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:When 'multi_geo' is true, elements whose existing subdomain ID matches 'subdomain_id_inside' are skipped, preserving their existing subdomain assignment.

  • keep_outside_as_outsideFalseWhen 'multi_geo' is true, elements whose existing subdomain ID matches 'subdomain_id_outside' are skipped, preserving their existing subdomain assignment.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:When 'multi_geo' is true, elements whose existing subdomain ID matches 'subdomain_id_outside' are skipped, preserving their existing subdomain assignment.

  • lambda0.5Threshold applied to the fraction outside the retained domain for a partial element. This parameter cannot be set when 'mark_intercepted' is true.

    Default:0.5

    C++ Type:Real

    Unit:(no unit assumed)

    Range:lambda >= 0 & lambda <= 1

    Controllable:No

    Description:Threshold applied to the fraction outside the retained domain for a partial element. This parameter cannot be set when 'mark_intercepted' is true.

  • mark_interceptedFalseWhether to assign a dedicated subdomain ID when intercepted.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to assign a dedicated subdomain ID when intercepted.

  • modify_inside_onlyFalseIf true, only elements categorized as inside are updated to 'subdomain_id_inside'; elements categorized as outside retain their existing subdomain IDs.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If true, only elements categorized as inside are updated to 'subdomain_id_inside'; elements categorized as outside retain their existing subdomain IDs.

  • modify_outside_onlyFalseIf true, only elements categorized as outside are updated to 'subdomain_id_outside'; elements categorized as inside retain their existing subdomain IDs.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If true, only elements categorized as outside are updated to 'subdomain_id_outside'; elements categorized as inside retain their existing subdomain IDs.

  • multi_geoFalseWhether to enable multi-geometry handling when chaining generators, allowing elements with specific existing subdomain IDs to be preserved without reclassification (see 'keep_inside_as_inside' and 'keep_outside_as_outside').

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to enable multi-geometry handling when chaining generators, allowing elements with specific existing subdomain IDs to be preserved without reclassification (see 'keep_inside_as_inside' and 'keep_outside_as_outside').

  • qrule_order9Quadrature order used to estimate the retained-domain fraction.

    Default:9

    C++ Type:int

    Range:qrule_order >= 0 & qrule_order <= 10

    Controllable:No

    Description:Quadrature order used to estimate the retained-domain fraction.

  • subdomain_id_intercepted65535Subdomain ID assigned to intercepted elements.

    Default:65535

    C++ Type:unsigned short

    Controllable:No

    Description:Subdomain ID assigned to intercepted elements.

  • threshold0Level-set threshold value defining the interface boundary (default 0.0).

    Default:0

    C++ Type:Real

    Unit:(no unit assumed)

    Controllable:No

    Description:Level-set threshold value defining the interface boundary (default 0.0).

Optional Parameters

  • disable_fpoptimizerFalseDisable the function parser algebraic optimizer

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Disable the function parser algebraic optimizer

  • enable_ad_cacheTrueEnable caching of function derivatives for faster startup time

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Enable caching of function derivatives for faster startup time

  • enable_auto_optimizeTrueEnable automatic immediate optimization of derivatives

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Enable automatic immediate optimization of derivatives

  • enable_jitTrueEnable just-in-time compilation of function expressions for faster evaluation

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Enable just-in-time compilation of function expressions for faster evaluation

  • evalerror_behaviornanWhat to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception

    Default:nan

    C++ Type:MooseEnum

    Options:nan, nan_warning, error, exception

    Controllable:No

    Description:What to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception

Parsed Expression Advanced Parameters

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set the enabled status of the MooseObject.

  • save_with_nameKeep the mesh from this mesh generator in memory with the name specified

    C++ Type:std::string

    Controllable:No

    Description:Keep the mesh from this mesh generator in memory with the name specified

Advanced Parameters

  • nemesisFalseWhether or not to output the mesh file in the nemesisformat (only if output = true)

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to output the mesh file in the nemesisformat (only if output = true)

  • outputFalseWhether or not to output the mesh file after generating the mesh

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to output the mesh file after generating the mesh

  • show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)

Debugging Parameters

Input Files