Skip to main content

DomainSplittor

C++: phynexis::peridigm::DomainSplittor
Python: phynexis.peridigm.DomainSplittor
Header: src/peridigm/domain_splittor.hpp

Description

Abstract base class for domain splitting algorithms used to discretize a geometry into peridynamic nodes and volumes.

This class cannot be instantiated directly. Use concrete subclasses:

Constructors

None (abstract class).

Methods

init_from_stl(stl_file, num_ele_each)

Initializes the splitter from an STL file path.

Parameters:

ParameterTypeDescription
stl_filestrPath to the STL file
num_ele_eachintNumber of elements in each dimension

get_peridigm_nodes()

Returns the discretized nodes and their volumes.

Returns: (list[Vec3d], list[float]) — tuple of (node positions, node volumes)

Example:

import phynexis
# Use a concrete subclass
splittor = phynexis.peridigm.LevelSetSplittor()
# ... initialize ...
nodes, vols = splittor.get_peridigm_nodes()
print(f"{len(nodes)} nodes")

get_stl_model()

Returns an STL model representing the discretized domain.

Returns: STLModel

get_stl_model(indices)

Returns an STL model for a subset of elements.

Parameters:

ParameterTypeDescription
indiceslist[int]Indices of elements to include

Returns: STLModel

make_porosity(porosity)

Randomly removes elements to achieve the specified porosity.

Parameters:

ParameterTypeDescription
porosityfloatDesired porosity (0–1)