stroid v0.6.0
Multi-block curvilinear mesh generation
Loading...
Searching...
No Matches
stroid::topology Namespace Reference

Topology construction and curvilinear mapping utilities. More...

Classes

class  TMOPProgressBar
 

Functions

void PromoteToHighOrder (mfem::Mesh &mesh, const fourdst::config::Config< config::MeshConfig > &config)
 Promote a mesh to high-order by attaching an H1 nodal finite element space.
 
void ProjectMesh (mfem::Mesh &mesh, const fourdst::config::Config< config::MeshConfig > &config)
 Project high-order mesh nodes using the configured curvilinear mapping.
 
std::unique_ptr< ScalarMeshFieldBuildExteriorCoordinate (mfem::Mesh &mesh, mfem::Mesh &reference_mesh, const fourdst::config::Config< config::MeshConfig > &config)
 Build a scalar grid function representing the compactification coordinate for a mesh. This ranges from 0-1 with 0 at the stellar surface and 1 at the compactified infinity.
 
void ApplyEquiangular (mfem::Vector &pos)
 Apply an equiangular (gnomonic) projection to a point on a cube.
 
void ApplySpheroidal (mfem::Vector &pos, const fourdst::config::Config< config::MeshConfig > &config)
 Apply spheroidal flattening along the Z axis.
 
void ApplyKelvin (mfem::Vector &pos, const fourdst::config::Config< config::MeshConfig > &config)
 Apply Kelvin transform outside the stellar radius.
 
void TransformPoint (mfem::Vector &pos, const fourdst::config::Config< config::MeshConfig > &config, int attribute_id)
 Map a point from the initial block topology to the curvilinear domain.
 
double ComputeExteriorCoordinate (const mfem::Vector &logical_position, int attribute, const fourdst::config::Config< config::MeshConfig > &config)
 Compute the compactification coordinate for a point in the curvilinear domain. This ranges from 0-1 with 0 at the stellar surface and 1 at the compactified infinity.
 
void ApplyTMOP (mfem::Mesh &mesh, const fourdst::config::Config< config::MeshConfig > &config)
 
void OptimizeMesh (mfem::Mesh &mesh, const fourdst::config::Config< config::MeshConfig > &cfg)
 
std::unique_ptr< mfem::Mesh > BuildSkeleton (const fourdst::config::Config< config::MeshConfig > &config)
 Build the initial multi-block mesh topology for the star model.
 
void Finalize (mfem::Mesh &mesh, const fourdst::config::Config< config::MeshConfig > &config)
 Finalize topology, validate orientation, and apply the configured refinement policy.
 

Detailed Description

Topology construction and curvilinear mapping utilities.

Function Documentation

◆ ApplyEquiangular()

void stroid::topology::ApplyEquiangular ( mfem::Vector & pos)

Apply an equiangular (gnomonic) projection to a point on a cube.

Parameters
posPosition vector updated in-place.

◆ ApplyKelvin()

void stroid::topology::ApplyKelvin ( mfem::Vector & pos,
const fourdst::config::Config< config::MeshConfig > & config )

Apply Kelvin transform outside the stellar radius.

Parameters
posPosition vector updated in-place.
configMesh configuration (uses r_star and r_infinity).

◆ ApplySpheroidal()

void stroid::topology::ApplySpheroidal ( mfem::Vector & pos,
const fourdst::config::Config< config::MeshConfig > & config )

Apply spheroidal flattening along the Z axis.

Parameters
posPosition vector updated in-place.
configMesh configuration (uses flattening).

◆ ApplyTMOP()

void stroid::topology::ApplyTMOP ( mfem::Mesh & mesh,
const fourdst::config::Config< config::MeshConfig > & config )

@breif Apply target matrix optimization to improve conditioning of the mesh

◆ BuildExteriorCoordinate()

std::unique_ptr< ScalarMeshField > stroid::topology::BuildExteriorCoordinate ( mfem::Mesh & mesh,
mfem::Mesh & reference_mesh,
const fourdst::config::Config< config::MeshConfig > & config )

Build a scalar grid function representing the compactification coordinate for a mesh. This ranges from 0-1 with 0 at the stellar surface and 1 at the compactified infinity.

Parameters
meshReference to the underlying serial MFEM mesh which has been promoted to high-order and projected into the curvilinear domain.
reference_meshreference to the underlying serial which has not been promoted to high-order or projected into the curvilinear domain. This is used to compute the compactification coordinate.
configConfig file
Returns
Unique pointer to a scalar mesh field representing the compactification coordinate.

◆ BuildSkeleton()

std::unique_ptr< mfem::Mesh > stroid::topology::BuildSkeleton ( const fourdst::config::Config< config::MeshConfig > & config)

Build the initial multi-block mesh topology for the star model.

Parameters
configMesh configuration (uses radii, domain flags, and core_mapping). The legacy spherified core uses one block; multi_block uses an inner Cartesian block and six core transition blocks.
Returns
Newly allocated mesh skeleton (not yet refined or curved).

◆ ComputeExteriorCoordinate()

double stroid::topology::ComputeExteriorCoordinate ( const mfem::Vector & logical_position,
int attribute,
const fourdst::config::Config< config::MeshConfig > & config )

Compute the compactification coordinate for a point in the curvilinear domain. This ranges from 0-1 with 0 at the stellar surface and 1 at the compactified infinity.

Parameters
logical_positionLogical position of the point in the curvilinear domain.
attributeElement attribute ID (used to determine the exterior coordinate).
configMesh configuration (uses radii and flattening).
Returns
Compactification coordinate ranging from 0 (stellar surface) to 1 (compactified infinity).

◆ Finalize()

void stroid::topology::Finalize ( mfem::Mesh & mesh,
const fourdst::config::Config< config::MeshConfig > & config )

Finalize topology, validate orientation, and apply the configured refinement policy.

Parameters
meshMesh to finalize in-place.
configMesh configuration. Vacuum refinement overrides enable a balanced hierarchy with fine layers at both vacuum boundaries and a conforming stellar interface. Without overrides, refinement is uniform.

◆ OptimizeMesh()

void stroid::topology::OptimizeMesh ( mfem::Mesh & mesh,
const fourdst::config::Config< config::MeshConfig > & cfg )

@breif Helper to call TMOP if the correct flags are set

◆ ProjectMesh()

void stroid::topology::ProjectMesh ( mfem::Mesh & mesh,
const fourdst::config::Config< config::MeshConfig > & config )

Project high-order mesh nodes using the configured curvilinear mapping.

Requires nodes to be present (call PromoteToHighOrder first).

Parameters
meshMesh to update in-place.
configMesh configuration (uses radii, flattening, and mapping parameters).

◆ PromoteToHighOrder()

void stroid::topology::PromoteToHighOrder ( mfem::Mesh & mesh,
const fourdst::config::Config< config::MeshConfig > & config )

Promote a mesh to high-order by attaching an H1 nodal finite element space.

Parameters
meshMesh to update in-place.
configMesh configuration (uses order).

◆ TransformPoint()

void stroid::topology::TransformPoint ( mfem::Vector & pos,
const fourdst::config::Config< config::MeshConfig > & config,
int attribute_id )

Map a point from the initial block topology to the curvilinear domain.

Parameters
posPosition vector updated in-place.
configMesh configuration (uses radii, flattening, and core_mapping). The multi_block strategy requires the matching skeleton from BuildSkeleton; changing only the mapping on a legacy core element is not supported.
attribute_idElement attribute ID (currently unused).