Skip to main content

MeshDM

Struct MeshDM 

Source
pub struct MeshDM<V, St = VecStorage<V>, CtSt = VecStorage<CellType>>
where St: Storage<V>, CtSt: Storage<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>
where St: Storage<f64> + Clone, CtSt: Storage<CellType> + Clone,

Source

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.

Source

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>

Source

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>

Source

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>

Iteratively adapt until no action is taken or iteration budget is exhausted.

Source§

impl<V, St, CtSt> MeshDM<V, St, CtSt>
where V: Clone + Default, St: Storage<V> + Clone, CtSt: Storage<CellType> + Clone,

Source

pub fn builder(topology: MeshSieve) -> MeshDMBuilder<V, St, CtSt>

Create a builder from topology.

Source

pub fn from_mesh_data(mesh_data: MeshData<MeshSieve, V, St, CtSt>) -> Self

Wrap existing mesh data with default DM options.

Source

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.

Source

pub fn into_mesh_data(self) -> MeshData<MeshSieve, V, St, CtSt>

Consume the facade, returning the owned lower-level mesh data.

Source

pub fn mesh_data(&self) -> &MeshData<MeshSieve, V, St, CtSt>

Borrow the full lower-level mesh data container.

Source

pub fn topology(&self) -> &MeshSieve

Borrow the topology.

Source

pub fn topology_mut(&mut self) -> &mut MeshSieve

Mutably borrow the topology.

Source

pub fn labels(&self) -> Option<&LabelSet>

Borrow labels, if present.

Source

pub fn coordinates(&self) -> Option<&Coordinates<V, St>>

Borrow coordinates, if present.

Source

pub fn coordinates_mut(&mut self) -> Option<&mut Coordinates<V, St>>

Mutably borrow coordinate metadata.

Source

pub fn set_coordinates( &mut self, coordinates: Coordinates<V, St>, ) -> Option<Coordinates<V, St>>

Attach or replace coordinate metadata.

Source

pub fn section(&self, name: &str) -> Option<&Section<V, St>>

Borrow a named local section.

Source

pub fn section_mut(&mut self, name: &str) -> Option<&mut Section<V, St>>

Mutably borrow a named local section and invalidate its global numbering.

Source

pub fn labels_mut_or_insert(&mut self) -> &mut LabelSet

Mutably borrow or create labels.

Source

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.

Source

pub fn remove_section(&mut self, name: &str) -> Option<Section<V, St>>

Remove a named local section and any derived global numbering.

Source

pub fn cell_types(&self) -> Option<&Section<CellType, CtSt>>

Borrow cell type metadata, if present.

Source

pub fn cell_types_mut(&mut self) -> Option<&mut Section<CellType, CtSt>>

Mutably borrow cell-type metadata.

Source

pub fn set_cell_types( &mut self, cell_types: Section<CellType, CtSt>, ) -> Option<Section<CellType, CtSt>>

Attach or replace cell-type metadata.

Source

pub fn discretization(&self) -> Option<&Discretization>

Borrow discretization metadata, if present.

Source

pub fn discretization_mut(&mut self) -> Option<&mut Discretization>

Mutably borrow discretization metadata.

Source

pub fn set_discretization( &mut self, discretization: Discretization, ) -> Option<Discretization>

Attach or replace discretization metadata.

Source

pub fn ownership(&self) -> Option<&PointOwnership>

Borrow ownership metadata, if this DM has been distributed or numbered.

Source

pub fn overlap(&self) -> Option<&Overlap>

Borrow overlap/SF-like state, if this DM has been distributed.

Source

pub fn distribution(&self) -> Option<&MeshDMDistribution>

Borrow distribution metadata, if this DM has been distributed.

Source

pub fn provenance_maps(&self) -> &MeshDMProvenance<NoComm>

Source

pub fn options(&self) -> &MeshDMOptions

Borrow DM setup options.

Source

pub fn set_topological_anchors(&mut self, anchors: TopologicalAnchors)

Replace topological anchor metadata used by nonconforming setup flows.

Source

pub fn topological_anchors(&self) -> &TopologicalAnchors

Borrow topological anchor metadata for nonconforming/adapted points.

Source

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.

Source

pub fn hanging_constraints_for_section( &self, section_name: &str, ) -> Option<&HangingNodeConstraints<V>>

Borrow hanging-node constraints attached to a named section.

Source

pub fn setup_serial(&mut self) -> Result<(), MeshSieveError>

Run local setup actions that do not require a partitioner/communicator.

Source

pub fn run_requested_checks(&mut self) -> Result<(), MeshSieveError>

Run topology/geometry checks requested by MeshDMOptions.

Source

pub fn point_chart(&self) -> Option<MeshPointChart>

Return the numeric point chart and whether it is dense.

Source

pub fn cone_points(&self, point: PointId) -> Vec<PointId>

Return the immediate downward cone of a point in deterministic order.

Source

pub fn oriented_cone(&self, point: PointId) -> Vec<(PointId, i32)>

Return the immediate downward cone with incidence orientations.

Source

pub fn support_points(&self, point: PointId) -> Vec<PointId>

Return the immediate upward support of a point in deterministic order.

Source

pub fn oriented_support(&self, point: PointId) -> Vec<(PointId, i32)>

Return the immediate upward support with forward-incidence orientations.

Source

pub fn cone_size(&self, point: PointId) -> usize

Return the number of immediate points in a point’s downward cone.

Source

pub fn support_size(&self, point: PointId) -> usize

Return the number of immediate points in a point’s upward support.

Source

pub fn height_stratum( &self, height: u32, ) -> Result<Vec<PointId>, MeshSieveError>

Return points in a height stratum (height 0 are cells in DMPLEX terms).

Source

pub fn depth_stratum(&self, depth: u32) -> Result<Vec<PointId>, MeshSieveError>

Return points in a depth stratum (depth 0 are vertices in DMPLEX terms).

Source

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.

Source

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.

Source

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.

Source

pub fn transitive_closure_points( &self, point: PointId, order: &ClosureOrder, ) -> Result<Vec<PointId>, MeshSieveError>

Alias for Self::closure_points mirroring DMPLEX transitive-closure terminology.

Source

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.

Source

pub fn star_points(&self, point: PointId) -> Vec<PointId>

Return a deterministic upward star from point.

Source

pub fn closure_both_points(&self, point: PointId) -> Vec<PointId>

Return a deterministic downward/upward transitive set from point.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn dual_graph(&self, cells: impl IntoIterator<Item = PointId>) -> DualGraph

Build a dual graph for the provided cells.

Source

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.

Source

pub fn matrix_preallocation_graph( &self, cells: impl IntoIterator<Item = PointId>, opts: CellAdjacencyOpts, ) -> PreallocationGraph

Build a matrix preallocation graph from cell adjacency.

Source

pub fn prepare_for_solve<C>( &mut self, comm: &C, options: PrepareForSolveOptions, ) -> Result<PrepareForSolveDiagnostics, MeshSieveError>
where C: Communicator + Sync, V: Send + PartialEq + Pod + 'static + AddAssign + Mul<Output = V>,

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.

Source

pub fn create_local_vector( &self, section_name: &str, ) -> Result<MeshVector<V>, MeshSieveError>

Create a zero-initialized local vector matching a named section.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn global_section(&self, name: &str) -> Option<&LocalToGlobalMap>

Borrow a stored global section map.

Source

pub fn create_global_vector( &self, section_name: &str, ) -> Result<MeshVector<V>, MeshSieveError>

Create a zero-initialized global vector matching a named global section.

Source

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.

Source

pub fn distribute_with<P, C>( &self, cells: &[PointId], partitioner: &P, comm: &C, ) -> Result<Self, MeshSieveError>
where P: CellPartitioner<MeshSieve>, C: Communicator + Sync, V: Send + PartialEq + Pod + 'static,

Distribute this DM through the lower-level distribution pipeline and return the local DM for the calling rank.

Source

pub fn distribute_fields<C>(&mut self, comm: &C) -> Result<(), MeshSieveError>
where C: Communicator + Sync, V: Send + PartialEq + Pod + 'static,

Complete/synchronize all registered fields through the owned overlap/SF state.

Trait Implementations§

Source§

impl<V: Debug, St, CtSt> Debug for MeshDM<V, St, CtSt>
where St: Storage<V> + Debug, CtSt: Storage<CellType> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<V, St = VecStorage<V>, CtSt = VecStorage<CellType>> !Freeze for MeshDM<V, St, CtSt>

§

impl<V, St, CtSt> RefUnwindSafe for MeshDM<V, St, CtSt>

§

impl<V, St, CtSt> Send for MeshDM<V, St, CtSt>
where CtSt: Send, St: Send, V: Send,

§

impl<V, St, CtSt> Sync for MeshDM<V, St, CtSt>
where CtSt: Sync, St: Sync, V: Sync,

§

impl<V, St, CtSt> Unpin for MeshDM<V, St, CtSt>
where CtSt: Unpin, St: Unpin, V: Unpin,

§

impl<V, St, CtSt> UnsafeUnpin for MeshDM<V, St, CtSt>
where CtSt: UnsafeUnpin, St: UnsafeUnpin,

§

impl<V, St, CtSt> UnwindSafe for MeshDM<V, St, CtSt>

Blanket Implementations§

Source§

impl<T> AccumulatePathExt for T

Source§

fn accumulate_path<O, I>(path: I) -> O
where O: Orientation, I: IntoIterator<Item = O>,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.