Files
MeanField/generate_mesh.py
Emily Boudreaux 75cc638739 perf(allocations): reduced overall allocations by 95%, increaseed jacobian applicatin by 2x
This commit uses global pre allocated work space to dramatically reduce memory usage and allocation time
2026-09-10 06:50:56 -04:00

30 lines
708 B
Python

from stroid.config import MeshConfig
from stroid.IO import SaveStroidMesh
from stroid import GenerateMesh
import stroid
cfg = MeshConfig(
core_mapping="multi_block",
order=4,
refinement_levels=2,
include_external_domain=True,
r_core=0.25,
r_star=1.0,
r_infinity=5.0,
flattening=0.0,
core_id=1,
envelope_id=2,
vacuum_id=3,
surface_bdr_id=1,
inf_bdr_id=2,
optimization_methods=stroid.config.OptimizationMethods(
tmop=False,
smoothstep=True,
),
)
mesh = GenerateMesh(cfg)
SaveStroidMesh(mesh, "sandbox.smesh")
print(mesh)