emout.core.boundaries package¶
Module contents¶
Boundary wrappers for MPIEMSES finbound mode.
Re-exports all public classes and constants for backward compatibility.
- class emout.core.boundaries.Boundary(inp, unit, index, btype)[source]¶
Bases:
objectBase class for a single finbound sub-boundary.
Concrete subclasses know which
&ptcondparameters to consult and how to construct theirMeshSurface3Drepresentation. They must implement_build_params()and_build_mesh(), and they should declaremesh_classsoBoundaryCollection.meshcan filter broadcast keyword arguments to the kwargs the underlying mesh class actually accepts.- Parameters:
inp – The
emout.utils.InpFileholdingdata.inp’s namelist.unit – The
emout.utils.Unitsinstance for SI conversion (may beNoneif the simulation has no unit conversion key).index (
int) – Zero-indexed position of this boundary insideboundary_types.btype (
str) – The MPIEMSES type string ("sphere","cylinderz", …). Kept so classes handling several axis variants can infer the axis letter.
- mesh(*, use_si=True, **overrides)[source]¶
Build the
MeshSurface3Dfor this boundary.Parameters auto-detected from
data.inpmay be overridden by passing keyword arguments. Overrides are interpreted in the same unit system as the returned mesh: SI metres by default (use_si=True), or simulation grid units whenuse_si=False.- Return type:
- mesh_class: Type[MeshSurface3D] | None = None¶
The
MeshSurface3Dsubclass that this boundary builds. Used byBoundaryCollection.mesh()to filter broadcast keyword arguments so that, for example,data.boundaries.mesh(theta_range=...)only forwardstheta_rangeto boundaries whose mesh class actually accepts it. Set toNoneto opt out of filtering.
- plot3d(*, use_si=True, mesh_kwargs=None, plotter=None, offsets=None, show=False, color='0.7', opacity=0.6, show_edges=False, add_axes=True, **kwargs)[source]¶
Draw this boundary mesh on a PyVista plotter and return it.
mesh_kwargsis forwarded tomesh(); remaining keyword arguments are forwarded to PyVistaplotter.add_mesh.
- render(*, use_si=True, **style_kwargs)[source]¶
Build the mesh and wrap it in a
RenderItemforplot_surfaces.Convenience that mirrors
MeshSurface3D.render().use_sidefaults toTrue(SI metres) and is forwarded tomesh(); remaining keyword arguments are passed through toRenderItem(style,solid_color,alpha, …). For finer mesh-construction control, chain explicitly:boundary.mesh(ntheta=96).render(style="solid").
- class emout.core.boundaries.BoundaryCollection(inp, unit, remote_open_kwargs=None)[source]¶
Bases:
objectCollection of boundaries discovered in
data.inp’s finbound config.Supports
len, iteration, and integer indexing.mesh()returns a compositeMeshSurface3Dconcatenating every boundary, with optional per-index or common keyword overrides.Boundaries of unsupported types (or legacy single-body modes outside
boundary_type = 'complex') are silently skipped. Askippedlist records the reason per skipped slot for debugging.- classmethod from_boundaries(boundaries, unit=None)[source]¶
Build a collection from an explicit iterable of boundaries.
Skips the namelist parsing path used by
__init__. Useful when composing boundaries with+(boundary1 + boundary2) or constructing ad-hoc subsets for plotting and tests.- Parameters:
- Return type:
- mesh(*, use_si=True, per=None, **common_overrides)[source]¶
Return the composite mesh of all recognised boundaries.
- Parameters:
use_si (bool, default True) – Convert geometry to SI metres via
data.unit.length.reverse. Passuse_si=Falseto keep simulation grid units instead.per (dict, optional) – Mapping from boundary index (0-based) to a dict of overrides passed to that boundary’s
mesh()call. Per-index entries are merged on top of (and override) the broadcastcommon_overridesand bypass the kwarg filter — they go straight through toboundary.mesh().**common_overrides –
Overrides broadcast to every boundary. Each boundary only sees the subset of these kwargs that its underlying
mesh_class__init__actually accepts (introspected viainspect.signature()). For example:data.boundaries.mesh(theta_range=[0, np.pi])
forwards
theta_rangeto the sphere/cylinder/disk/circle/ plane-with-circle entries that support it and silently drops it for cuboid/rectangle/flat-surface entries.
- Return type:
- plot(*, ax=None, use_si=True, offsets=None, per=None, backend='mpl', style='solid', solid_color='0.7', alpha=0.6, **kwargs)[source]¶
Plot boundary meshes in 3-D.
Use this to inspect boundary geometry without a field overlay. To overlay on field data, use
Data3d.plot_surfaces(data.boundaries).- Parameters:
ax (Axes3D, optional) – Target 3-D axes. Created if
None.use_si (bool, default True) – Convert to SI metres.
offsets (tuple of (float or str), optional) –
(x_offset, y_offset, z_offset)applied to mesh vertices. Accepts"left","center","right"or numeric values.per (dict, optional) – Per-boundary mesh overrides.
backend ({'mpl', 'pyvista'}, default 'mpl') – Rendering backend.
style (
str) – Rendering style forwarded toRenderItem.solid_color – Rendering style forwarded to
RenderItem.alpha (
float) – Rendering style forwarded toRenderItem.
- plot3d(*, plotter=None, use_si=True, offsets=None, per=None, mesh_kwargs=None, show=False, color=None, opacity=None, surface_color='0.7', surface_opacity=0.6, show_edges=False, add_axes=True, surface_kwargs=None, filename=None, savefilename=None, **kwargs)[source]¶
Plot boundary meshes in 3-D with PyVista.
- class emout.core.boundaries.CircleBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES
circlex/circley/circlez→CircleMeshSurface.- mesh_class¶
alias of
CircleMeshSurface
- class emout.core.boundaries.CuboidBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES
cuboidboundary →BoxMeshSurface.- mesh_class¶
alias of
BoxMeshSurface
- class emout.core.boundaries.CylinderBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES
cylinderx/y/zandopen-cylinder*.cylinder_originholds the lower end of the cylinder along the chosen axis; we place that point at the mesh origin withtmin=0,tmax=cylinder_heightso the cylinder extends in the+axisdirection (matching the Fortran convention).- mesh_class¶
alias of
CylinderMeshSurface
- class emout.core.boundaries.CylinderHoleBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES legacy
cylinder-hole→ cylindrical pit.The Fortran implementation uses the same
xlrechole/xurechole… bounds asRectangleHoleBoundarybut treats them as defining the cylindrical radius (half ofxu - xl). We return aCylinderMeshSurfacewith only thesideandbottomparts, matching the Fortran wall + bottom-circle construction.- mesh_class¶
alias of
CylinderMeshSurface
- class emout.core.boundaries.DiskBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES
diskx/y/zannular disk →DiskMeshSurface.- mesh_class¶
alias of
DiskMeshSurface
- class emout.core.boundaries.FlatSurfaceBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES legacy
flat-surface→RectangleMeshSurface.Reads the scalar
zssurf(and domain extentsnx/ny) to build a flat rectangular plane atz = zssurfthat spans the entire horizontal domain.- mesh_class¶
alias of
RectangleMeshSurface
- class emout.core.boundaries.PlaneWithCircleBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES
plane-with-circlex/y/z→PlaneWithCircleMeshSurface.These are single flat planes perpendicular to the chosen axis with a circular aperture at
plane_with_circle_origin. The plane itself is drawn large enough to cover the simulation domain (nx/ny/nzgrid extents).- mesh_class¶
alias of
PlaneWithCircleMeshSurface
- class emout.core.boundaries.RectangleBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES
rectangleboundary → single-faceBoxMeshSurface.The flat face is inferred from whichever of
x/y/zhasmin == max.- mesh_class¶
alias of
BoxMeshSurface
- class emout.core.boundaries.RectangleHoleBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES legacy
rectangle-hole→ pit-shaped box.The Fortran implementation in
surfaces.F90assembles the hole from nine rectangles (bottom of the pit, four walls, and four top-plane pieces surrounding the opening). For visualization purposes this class returns the rectangular pit itself as aBoxMeshSurfacewith the top face omitted — that is the opening — which is the most useful shape to overlay on a field plot.- mesh_class¶
alias of
BoxMeshSurface
- class emout.core.boundaries.SphereBoundary(inp, unit, index, btype)[source]¶
Bases:
BoundaryMPIEMSES
sphereboundary →SphereMeshSurface.- mesh_class¶
alias of
SphereMeshSurface