pub struct MeshDM<V, St = VecStorage<V>, CtSt = VecStorage<CellType>>{ /* private fields */ }Expand description
DMPLEX-like facade owning topology, coordinates, labels, sections, discretization metadata, distribution state, and solver numbering maps.
Implementations§
Source§impl<St, CtSt> MeshDM<f64, St, CtSt>
impl<St, CtSt> MeshDM<f64, St, CtSt>
Sourcepub fn adapt_with_attached_metric<C>(
&mut self,
metric_section_name: &str,
metric: &Section<MetricTensor, VecStorage<MetricTensor>>,
coarsen_plan: C,
options: MeshDMMetricAdaptOptions,
) -> Result<MeshDMMetricAdaptResult, MeshSieveError>
pub fn adapt_with_attached_metric<C>( &mut self, metric_section_name: &str, metric: &Section<MetricTensor, VecStorage<MetricTensor>>, coarsen_plan: C, options: MeshDMMetricAdaptOptions, ) -> Result<MeshDMMetricAdaptResult, MeshSieveError>
Adapt this DM from an attached per-cell metric section with label-aware constraints.
pub fn adapt_until_fv_thresholds<C>( &mut self, metric_section_name: &str, metric: &Section<MetricTensor, VecStorage<MetricTensor>>, coarsen_plan: C, options: MeshDMMetricAdaptOptions, fv_thresholds: FvStabilityThresholds, iter: MeshDMAdaptIterationOptions, ) -> Result<Vec<MeshDMMetricAdaptResult>, MeshSieveError>
pub fn adapt_until_fv_thresholds_with_history<C>( &mut self, metric_section_name: &str, metric: &Section<MetricTensor, VecStorage<MetricTensor>>, coarsen_plan: C, options: MeshDMMetricAdaptOptions, fv_thresholds: FvStabilityThresholds, iter: MeshDMAdaptIterationOptions, ) -> Result<(Vec<MeshDMMetricAdaptResult>, Vec<MeshDMFvIterationReport>), MeshSieveError>
Sourcepub fn adapt_with_attached_metric_iterative<C, F>(
&mut self,
metric_section_name: &str,
metric: &Section<MetricTensor, VecStorage<MetricTensor>>,
coarsen_plan: C,
options: MeshDMMetricAdaptOptions,
max_iterations: usize,
stop: F,
) -> Result<Vec<MeshDMMetricAdaptResult>, MeshSieveError>where
C: Fn(&[MetricSplitHint]) -> Vec<CoarsenEntity> + Copy,
F: Fn(&MeshDMMetricAdaptResult) -> bool,
pub fn adapt_with_attached_metric_iterative<C, F>(
&mut self,
metric_section_name: &str,
metric: &Section<MetricTensor, VecStorage<MetricTensor>>,
coarsen_plan: C,
options: MeshDMMetricAdaptOptions,
max_iterations: usize,
stop: F,
) -> Result<Vec<MeshDMMetricAdaptResult>, MeshSieveError>where
C: Fn(&[MetricSplitHint]) -> Vec<CoarsenEntity> + Copy,
F: Fn(&MeshDMMetricAdaptResult) -> bool,
Iteratively adapt until no action is taken or iteration budget is exhausted.
Source§impl<V, St, CtSt> MeshDM<V, St, CtSt>
impl<V, St, CtSt> MeshDM<V, St, CtSt>
Sourcepub fn builder(topology: MeshSieve) -> MeshDMBuilder<V, St, CtSt>
pub fn builder(topology: MeshSieve) -> MeshDMBuilder<V, St, CtSt>
Create a builder from topology.
Sourcepub fn from_mesh_data(mesh_data: MeshData<MeshSieve, V, St, CtSt>) -> Self
pub fn from_mesh_data(mesh_data: MeshData<MeshSieve, V, St, CtSt>) -> Self
Wrap existing mesh data with default DM options.
Sourcepub fn from_mesh_data_with_options(
mesh_data: MeshData<MeshSieve, V, St, CtSt>,
options: MeshDMOptions,
) -> Self
pub fn from_mesh_data_with_options( mesh_data: MeshData<MeshSieve, V, St, CtSt>, options: MeshDMOptions, ) -> Self
Wrap existing mesh data with explicit DM options.
Sourcepub fn into_mesh_data(self) -> MeshData<MeshSieve, V, St, CtSt>
pub fn into_mesh_data(self) -> MeshData<MeshSieve, V, St, CtSt>
Consume the facade, returning the owned lower-level mesh data.
Sourcepub fn mesh_data(&self) -> &MeshData<MeshSieve, V, St, CtSt>
pub fn mesh_data(&self) -> &MeshData<MeshSieve, V, St, CtSt>
Borrow the full lower-level mesh data container.
Sourcepub fn topology_mut(&mut self) -> &mut MeshSieve
pub fn topology_mut(&mut self) -> &mut MeshSieve
Mutably borrow the topology.
Sourcepub fn coordinates(&self) -> Option<&Coordinates<V, St>>
pub fn coordinates(&self) -> Option<&Coordinates<V, St>>
Borrow coordinates, if present.
Sourcepub fn coordinates_mut(&mut self) -> Option<&mut Coordinates<V, St>>
pub fn coordinates_mut(&mut self) -> Option<&mut Coordinates<V, St>>
Mutably borrow coordinate metadata.
Sourcepub fn set_coordinates(
&mut self,
coordinates: Coordinates<V, St>,
) -> Option<Coordinates<V, St>>
pub fn set_coordinates( &mut self, coordinates: Coordinates<V, St>, ) -> Option<Coordinates<V, St>>
Attach or replace coordinate metadata.
Sourcepub fn section_mut(&mut self, name: &str) -> Option<&mut Section<V, St>>
pub fn section_mut(&mut self, name: &str) -> Option<&mut Section<V, St>>
Mutably borrow a named local section and invalidate its global numbering.
Sourcepub fn labels_mut_or_insert(&mut self) -> &mut LabelSet
pub fn labels_mut_or_insert(&mut self) -> &mut LabelSet
Mutably borrow or create labels.
Sourcepub fn insert_section(
&mut self,
name: impl Into<String>,
section: Section<V, St>,
) -> Option<Section<V, St>>
pub fn insert_section( &mut self, name: impl Into<String>, section: Section<V, St>, ) -> Option<Section<V, St>>
Insert or replace a named local section.
Sourcepub fn remove_section(&mut self, name: &str) -> Option<Section<V, St>>
pub fn remove_section(&mut self, name: &str) -> Option<Section<V, St>>
Remove a named local section and any derived global numbering.
Sourcepub fn cell_types(&self) -> Option<&Section<CellType, CtSt>>
pub fn cell_types(&self) -> Option<&Section<CellType, CtSt>>
Borrow cell type metadata, if present.
Sourcepub fn cell_types_mut(&mut self) -> Option<&mut Section<CellType, CtSt>>
pub fn cell_types_mut(&mut self) -> Option<&mut Section<CellType, CtSt>>
Mutably borrow cell-type metadata.
Sourcepub fn set_cell_types(
&mut self,
cell_types: Section<CellType, CtSt>,
) -> Option<Section<CellType, CtSt>>
pub fn set_cell_types( &mut self, cell_types: Section<CellType, CtSt>, ) -> Option<Section<CellType, CtSt>>
Attach or replace cell-type metadata.
Sourcepub fn discretization(&self) -> Option<&Discretization>
pub fn discretization(&self) -> Option<&Discretization>
Borrow discretization metadata, if present.
Sourcepub fn discretization_mut(&mut self) -> Option<&mut Discretization>
pub fn discretization_mut(&mut self) -> Option<&mut Discretization>
Mutably borrow discretization metadata.
Sourcepub fn set_discretization(
&mut self,
discretization: Discretization,
) -> Option<Discretization>
pub fn set_discretization( &mut self, discretization: Discretization, ) -> Option<Discretization>
Attach or replace discretization metadata.
Sourcepub fn ownership(&self) -> Option<&PointOwnership>
pub fn ownership(&self) -> Option<&PointOwnership>
Borrow ownership metadata, if this DM has been distributed or numbered.
Sourcepub fn overlap(&self) -> Option<&Overlap>
pub fn overlap(&self) -> Option<&Overlap>
Borrow overlap/SF-like state, if this DM has been distributed.
Sourcepub fn distribution(&self) -> Option<&MeshDMDistribution>
pub fn distribution(&self) -> Option<&MeshDMDistribution>
Borrow distribution metadata, if this DM has been distributed.
pub fn provenance_maps(&self) -> &MeshDMProvenance<NoComm>
Sourcepub fn options(&self) -> &MeshDMOptions
pub fn options(&self) -> &MeshDMOptions
Borrow DM setup options.
Sourcepub fn set_topological_anchors(&mut self, anchors: TopologicalAnchors)
pub fn set_topological_anchors(&mut self, anchors: TopologicalAnchors)
Replace topological anchor metadata used by nonconforming setup flows.
Sourcepub fn topological_anchors(&self) -> &TopologicalAnchors
pub fn topological_anchors(&self) -> &TopologicalAnchors
Borrow topological anchor metadata for nonconforming/adapted points.
Sourcepub fn set_hanging_constraints_for_section(
&mut self,
section_name: impl Into<String>,
constraints: HangingNodeConstraints<V>,
)
pub fn set_hanging_constraints_for_section( &mut self, section_name: impl Into<String>, constraints: HangingNodeConstraints<V>, )
Attach hanging-node constraints to a named section.
Sourcepub fn hanging_constraints_for_section(
&self,
section_name: &str,
) -> Option<&HangingNodeConstraints<V>>
pub fn hanging_constraints_for_section( &self, section_name: &str, ) -> Option<&HangingNodeConstraints<V>>
Borrow hanging-node constraints attached to a named section.
Sourcepub fn setup_serial(&mut self) -> Result<(), MeshSieveError>
pub fn setup_serial(&mut self) -> Result<(), MeshSieveError>
Run local setup actions that do not require a partitioner/communicator.
Sourcepub fn run_requested_checks(&mut self) -> Result<(), MeshSieveError>
pub fn run_requested_checks(&mut self) -> Result<(), MeshSieveError>
Run topology/geometry checks requested by MeshDMOptions.
Sourcepub fn point_chart(&self) -> Option<MeshPointChart>
pub fn point_chart(&self) -> Option<MeshPointChart>
Return the numeric point chart and whether it is dense.
Sourcepub fn cone_points(&self, point: PointId) -> Vec<PointId>
pub fn cone_points(&self, point: PointId) -> Vec<PointId>
Return the immediate downward cone of a point in deterministic order.
Sourcepub fn oriented_cone(&self, point: PointId) -> Vec<(PointId, i32)>
pub fn oriented_cone(&self, point: PointId) -> Vec<(PointId, i32)>
Return the immediate downward cone with incidence orientations.
Sourcepub fn support_points(&self, point: PointId) -> Vec<PointId>
pub fn support_points(&self, point: PointId) -> Vec<PointId>
Return the immediate upward support of a point in deterministic order.
Sourcepub fn oriented_support(&self, point: PointId) -> Vec<(PointId, i32)>
pub fn oriented_support(&self, point: PointId) -> Vec<(PointId, i32)>
Return the immediate upward support with forward-incidence orientations.
Sourcepub fn cone_size(&self, point: PointId) -> usize
pub fn cone_size(&self, point: PointId) -> usize
Return the number of immediate points in a point’s downward cone.
Sourcepub fn support_size(&self, point: PointId) -> usize
pub fn support_size(&self, point: PointId) -> usize
Return the number of immediate points in a point’s upward support.
Sourcepub fn height_stratum(
&self,
height: u32,
) -> Result<Vec<PointId>, MeshSieveError>
pub fn height_stratum( &self, height: u32, ) -> Result<Vec<PointId>, MeshSieveError>
Return points in a height stratum (height 0 are cells in DMPLEX terms).
Sourcepub fn depth_stratum(&self, depth: u32) -> Result<Vec<PointId>, MeshSieveError>
pub fn depth_stratum(&self, depth: u32) -> Result<Vec<PointId>, MeshSieveError>
Return points in a depth stratum (depth 0 are vertices in DMPLEX terms).
Sourcepub fn create_section_from_depth(
&mut self,
name: impl Into<String>,
dofs_by_depth: &[usize],
) -> Result<Option<Section<V, St>>, MeshSieveError>
pub fn create_section_from_depth( &mut self, name: impl Into<String>, dofs_by_depth: &[usize], ) -> Result<Option<Section<V, St>>, MeshSieveError>
Create and register a section from DOF counts indexed by point depth.
dofs_by_depth[d] is the number of scalar DOFs assigned to every point
in depth stratum d; zero entries omit that stratum from the section.
Sourcepub fn create_section_from_depth_on_label(
&mut self,
name: impl Into<String>,
dofs_by_depth: &[usize],
label_name: &str,
label_value: i32,
) -> Result<Option<Section<V, St>>, MeshSieveError>
pub fn create_section_from_depth_on_label( &mut self, name: impl Into<String>, dofs_by_depth: &[usize], label_name: &str, label_value: i32, ) -> Result<Option<Section<V, St>>, MeshSieveError>
Create and register a depth-layout section restricted to a label value.
Sourcepub fn closure_points(
&self,
point: PointId,
order: &ClosureOrder,
) -> Result<Vec<PointId>, MeshSieveError>
pub fn closure_points( &self, point: PointId, order: &ClosureOrder, ) -> Result<Vec<PointId>, MeshSieveError>
Return an FE-compatible point order for the downward transitive closure of point.
Sourcepub fn transitive_closure_points(
&self,
point: PointId,
order: &ClosureOrder,
) -> Result<Vec<PointId>, MeshSieveError>
pub fn transitive_closure_points( &self, point: PointId, order: &ClosureOrder, ) -> Result<Vec<PointId>, MeshSieveError>
Alias for Self::closure_points mirroring DMPLEX transitive-closure terminology.
Sourcepub fn closure_points_at_depth(
&self,
point: PointId,
depth: u32,
order: &ClosureOrder,
) -> Result<Vec<PointId>, MeshSieveError>
pub fn closure_points_at_depth( &self, point: PointId, depth: u32, order: &ClosureOrder, ) -> Result<Vec<PointId>, MeshSieveError>
Return closure points lying in one global topology depth stratum.
Sourcepub fn star_points(&self, point: PointId) -> Vec<PointId>
pub fn star_points(&self, point: PointId) -> Vec<PointId>
Return a deterministic upward star from point.
Sourcepub fn closure_both_points(&self, point: PointId) -> Vec<PointId>
pub fn closure_both_points(&self, point: PointId) -> Vec<PointId>
Return a deterministic downward/upward transitive set from point.
Sourcepub fn get_closure_values(
&self,
section_name: &str,
cell: PointId,
order: &ClosureOrder,
) -> Result<ElementClosureData<V>, MeshSieveError>
pub fn get_closure_values( &self, section_name: &str, cell: PointId, order: &ClosureOrder, ) -> Result<ElementClosureData<V>, MeshSieveError>
Extract section values over a cell closure using the same ordering as FE assembly helpers.
Sourcepub fn points_by_label_selection(
&self,
selection: &MeshDMLabelSelection,
) -> Result<Vec<PointId>, MeshSieveError>
pub fn points_by_label_selection( &self, selection: &MeshDMLabelSelection, ) -> Result<Vec<PointId>, MeshSieveError>
Return points selected by a label, topology policy, and optional section-atlas filter.
Sourcepub fn points_by_label_in_section(
&self,
label_name: &str,
label_value: i32,
section_name: &str,
topology: SubmeshSelection,
) -> Result<Vec<PointId>, MeshSieveError>
pub fn points_by_label_in_section( &self, label_name: &str, label_value: i32, section_name: &str, topology: SubmeshSelection, ) -> Result<Vec<PointId>, MeshSieveError>
Convenience label query for points that also have DOFs in a named section.
Sourcepub fn create_constrained_view_from_labels(
&self,
section_name: &str,
constraints: &[LabelConstraintSpec],
) -> Result<ConstrainedSection<V, St>, MeshSieveError>
pub fn create_constrained_view_from_labels( &self, section_name: &str, constraints: &[LabelConstraintSpec], ) -> Result<ConstrainedSection<V, St>, MeshSieveError>
Create a constrained view of an existing section, deriving point DOFs from its atlas.
Sourcepub fn sub_dm_by_label(
&self,
label_name: &str,
label_value: i32,
topology: SubmeshSelection,
) -> Result<MeshDMSubmesh<V, St, CtSt>, MeshSieveError>
pub fn sub_dm_by_label( &self, label_name: &str, label_value: i32, topology: SubmeshSelection, ) -> Result<MeshDMSubmesh<V, St, CtSt>, MeshSieveError>
Build a compact sub-DM from labeled points, preserving parent/sub point maps and numbering metadata.
Sourcepub fn sub_dm_by_label_with_sections(
&self,
label_name: &str,
label_value: i32,
topology: SubmeshSelection,
section_names: Option<&[&str]>,
) -> Result<MeshDMSubmesh<V, St, CtSt>, MeshSieveError>
pub fn sub_dm_by_label_with_sections( &self, label_name: &str, label_value: i32, topology: SubmeshSelection, section_names: Option<&[&str]>, ) -> Result<MeshDMSubmesh<V, St, CtSt>, MeshSieveError>
Build a compact sub-DM from labeled points and retain only selected named sections when requested.
Sourcepub fn dual_graph(&self, cells: impl IntoIterator<Item = PointId>) -> DualGraph
pub fn dual_graph(&self, cells: impl IntoIterator<Item = PointId>) -> DualGraph
Build a dual graph for the provided cells.
Sourcepub fn cell_adjacency_graph(
&self,
cells: impl IntoIterator<Item = PointId>,
opts: CellAdjacencyOpts,
weighting: AdjacencyWeighting,
) -> MeshGraph
pub fn cell_adjacency_graph( &self, cells: impl IntoIterator<Item = PointId>, opts: CellAdjacencyOpts, weighting: AdjacencyWeighting, ) -> MeshGraph
Build a cell adjacency/preallocation graph for the provided cells.
Sourcepub fn matrix_preallocation_graph(
&self,
cells: impl IntoIterator<Item = PointId>,
opts: CellAdjacencyOpts,
) -> PreallocationGraph
pub fn matrix_preallocation_graph( &self, cells: impl IntoIterator<Item = PointId>, opts: CellAdjacencyOpts, ) -> PreallocationGraph
Build a matrix preallocation graph from cell adjacency.
Sourcepub fn prepare_for_solve<C>(
&mut self,
comm: &C,
options: PrepareForSolveOptions,
) -> Result<PrepareForSolveDiagnostics, MeshSieveError>
pub fn prepare_for_solve<C>( &mut self, comm: &C, options: PrepareForSolveOptions, ) -> Result<PrepareForSolveDiagnostics, MeshSieveError>
Prepare this DM for solver assembly with a DMPLEX-like setup flow.
The flow is intentionally deterministic: prerequisite diagnostics, section/global numbering, matrix preallocation, ownership/overlap validation, and optional ghost-section synchronization are all reported in stable point/name order. Missing required prerequisites are returned as structured diagnostics instead of panicking or partially preparing the DM.
Sourcepub fn create_local_vector(
&self,
section_name: &str,
) -> Result<MeshVector<V>, MeshSieveError>
pub fn create_local_vector( &self, section_name: &str, ) -> Result<MeshVector<V>, MeshSieveError>
Create a zero-initialized local vector matching a named section.
Sourcepub fn get_local_vector_closure(
&self,
section_name: &str,
vector: &MeshVector<V>,
point: PointId,
order: &ClosureOrder,
) -> Result<Vec<V>, MeshSieveError>
pub fn get_local_vector_closure( &self, section_name: &str, vector: &MeshVector<V>, point: PointId, order: &ClosureOrder, ) -> Result<Vec<V>, MeshSieveError>
Gather values from a local vector over a point’s oriented closure.
Sourcepub fn get_local_vector_closure_at_depth(
&self,
section_name: &str,
vector: &MeshVector<V>,
point: PointId,
depth: u32,
order: &ClosureOrder,
) -> Result<Vec<V>, MeshSieveError>
pub fn get_local_vector_closure_at_depth( &self, section_name: &str, vector: &MeshVector<V>, point: PointId, depth: u32, order: &ClosureOrder, ) -> Result<Vec<V>, MeshSieveError>
Gather local-vector closure values contributed by one topology depth.
Sourcepub fn set_local_vector_closure(
&self,
section_name: &str,
vector: &mut MeshVector<V>,
point: PointId,
order: &ClosureOrder,
values: &[V],
mode: MeshVectorInsertMode,
) -> Result<(), MeshSieveError>where
V: AddAssign<V>,
pub fn set_local_vector_closure(
&self,
section_name: &str,
vector: &mut MeshVector<V>,
point: PointId,
order: &ClosureOrder,
values: &[V],
mode: MeshVectorInsertMode,
) -> Result<(), MeshSieveError>where
V: AddAssign<V>,
Insert or add values over a point’s oriented closure in a local vector.
Sourcepub fn build_global_sections<C>(
&mut self,
comm: &C,
) -> Result<(), MeshSieveError>where
C: Communicator + Sync,
pub fn build_global_sections<C>(
&mut self,
comm: &C,
) -> Result<(), MeshSieveError>where
C: Communicator + Sync,
Build and store global numbering maps for all named local sections.
Sourcepub fn global_section(&self, name: &str) -> Option<&LocalToGlobalMap>
pub fn global_section(&self, name: &str) -> Option<&LocalToGlobalMap>
Borrow a stored global section map.
Sourcepub fn create_global_vector(
&self,
section_name: &str,
) -> Result<MeshVector<V>, MeshSieveError>
pub fn create_global_vector( &self, section_name: &str, ) -> Result<MeshVector<V>, MeshSieveError>
Create a zero-initialized global vector matching a named global section.
Sourcepub fn create_constrained_section_from_labels(
&self,
field_name: &str,
point_dofs: &[(PointId, usize)],
constraints: &[LabelConstraintSpec],
) -> Result<ConstrainedSection<V, St>, MeshSieveError>
pub fn create_constrained_section_from_labels( &self, field_name: &str, point_dofs: &[(PointId, usize)], constraints: &[LabelConstraintSpec], ) -> Result<ConstrainedSection<V, St>, MeshSieveError>
Create a constrained section for a field using label constraints.
Sourcepub fn distribute_with<P, C>(
&self,
cells: &[PointId],
partitioner: &P,
comm: &C,
) -> Result<Self, MeshSieveError>
pub fn distribute_with<P, C>( &self, cells: &[PointId], partitioner: &P, comm: &C, ) -> Result<Self, MeshSieveError>
Distribute this DM through the lower-level distribution pipeline and return the local DM for the calling rank.
Sourcepub fn distribute_fields<C>(&mut self, comm: &C) -> Result<(), MeshSieveError>
pub fn distribute_fields<C>(&mut self, comm: &C) -> Result<(), MeshSieveError>
Complete/synchronize all registered fields through the owned overlap/SF state.