Domain
Class Documentation
Constructors
Domain()
– Default constructorDomain(SmartPointer<Domain>)
– Deep copy from another domainDomain(lsDomainType)
– Initialize from a single Level-SetDomain(lsDomainsType)
– Initialize from multiple Level-SetsDomain(gridDelta, xExtent, yExtent = 0.0, boundary)
– Rectangular grid initializationDomain(bounds[], boundaryConditions[], gridDelta)
– Bounding box initializationDomain(const Setup &setup)
– From preconfigured domain setup
Key Member Functions
Domain Setup
void setup(const Setup &setup);
void setup(NumericType gridDelta, NumericType xExtent, NumericType yExtent = 0.0, BoundaryType boundary);
Initialize or reconfigure the simulation domain.
Level-Set Management
void insertNextLevelSet(lsDomainType levelSet, bool wrap = true);
void insertNextLevelSetAsMaterial(lsDomainType levelSet, Material material, bool wrap = true);
void duplicateTopLevelSet(Material material);
void removeTopLevelSet();
void removeLevelSet(unsigned int idx, bool removeWrapped = true);
void removeMaterial(Material material);
Insert, duplicate, or remove Level-Sets. Materials can be assigned during insertion.
Boolean Operations
void applyBooleanOperation(lsDomainType levelSet, viennals::BooleanOperationEnum op);
Apply a Boolean operation (e.g., union, intersection) across all Level-Sets in the domain.
Cell-Set Generation
void generateCellSet(NumericType position, Material coverMaterial, bool isAboveSurface = false);
Convert Level-Set stack into a Cell-Set for volume process modeling.
Material Mapping
void setMaterialMap(materialMapType map);
void setMaterial(unsigned int lsId, Material material);
Assign or update material information for Level-Sets.
Data Accessors
auto& getSurface() const;
auto& getLevelSets() const;
auto& getMaterialMap() const;
auto& getCellSet() const;
auto& getGrid() const;
auto getGridDelta() const;
auto& getSetup();
auto getBoundingBox() const;
auto getBoundaryConditions() const;
Access the surface Level-Set, grid, bounding box, material map, and setup.
Output & Export
void saveLevelSetMesh(std::string fileName, int width = 1);
void saveSurfaceMesh(std::string fileName, bool addMaterialIds = true);
void saveVolumeMesh(std::string fileName, double wrappingEps = 1e-2) const;
void saveHullMesh(std::string fileName, double wrappingEps = 1e-2) const;
void saveLevelSets(std::string prefix) const;
void print() const;
Save surface or volume meshes in VTK formats or print domain state to stdout
.
Utilities
void deepCopy(SmartPointer<Domain> other);
void clear();
Clone another domain or clear all internal data.
Notes
- Level-Sets inserted with
wrap = true
are merged with underlying layers. - Material IDs are stored under the
"MaterialIds"
label in exported meshes. - Cell-Sets are not automatically generated and must be explicitly created using
generateCellSet
.
Example Usage
using DomainType = viennaps::Domain<double, 3>;
auto domain = DomainType::New(1.0, 10.0, 10.0);
auto ls = viennals::Domain<double, 3>::New();
// setup ls...
domain->insertNextLevelSetAsMaterial(ls, Material::Si);
domain->saveSurfaceMesh("surface.vtp");