mesh generation
GeneratesMeshMixin
Role mixin for components that generate auxiliary mesh cells.
Use this mixin when a component needs to create its own mesh representation after the ordinary model geometry already exists. This is common for advanced interfaces that derive extra elements from the assembled mesh rather than from a simple pre-assembly meshpart.
In practice, components using this mixin usually:
- subscribe to a lifecycle event such as
POST_ASSEMBLE - inspect the assembled mesh or nearby geometry
- build an internal interface mesh
- merge or attach that mesh into the model-owned assembled mesh
The two hook methods separate those responsibilities:
build_mesh()creates the component's internal mesh descriptionintegrate_mesh()inserts that mesh into the assembled model
Example
Tip
Use this mixin when the component is responsible for cells or an
actual interface mesh. If the component only creates standalone points,
GeneratesNodesMixin
is the better fit.
Methods:
build_mesh
Construct the component-owned auxiliary mesh.
Subclasses implement this hook to derive the interface mesh they need from runtime context such as the assembled mesh, nearby cells, or component-specific geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Arbitrary keyword arguments passed from the build context. |
{}
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If the subclass does not implement this method. |
integrate_mesh
Integrate the generated mesh into the model-owned assembled mesh.
This hook runs after build_mesh() has created the component's
auxiliary mesh. Subclasses use it to merge, attach, or otherwise
register that geometry with the global assembled mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
assembled_mesh
|
The global assembled mesh object to which the interface mesh cells will be attached. |
required | |
**kwargs
|
Arbitrary keyword arguments passed from the integration context. |
{}
|