Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7ca5d6f
Make is_prepared more fine-grained
roystgnr Jan 3, 2024
1de5774
Assert our cache is still good
roystgnr Jan 22, 2024
bc61dcd
Make PerfLog name accurate
roystgnr Dec 1, 2025
25e1a6e
More detailed preparation comments
roystgnr Dec 1, 2025
fca90e5
Test partially-prepared status validity too
roystgnr Dec 3, 2025
528a298
Update comments
roystgnr Dec 3, 2025
88b85b0
Don't try to use an unprepared mesh in testing
roystgnr Dec 3, 2025
54c20a4
cache_elem_data() after modifying mesh subdomains
roystgnr Dec 3, 2025
bff2ec6
Prepare mesh_copy before smoother solves on it
roystgnr Dec 3, 2025
2e7cbea
Assert that we only assemble on prepared meshes
roystgnr Dec 3, 2025
9c49cca
MeshModification shouldn't leave invalid caches
roystgnr Dec 3, 2025
2c17ef2
Assign _children_on_boundary in BoundaryInfo =
roystgnr Dec 4, 2025
b6a7832
Clarify prepare_for_use() doxygen
roystgnr Dec 4, 2025
a315156
Get interior parent pointers *right* when copying
roystgnr Dec 5, 2025
b79b709
More testing of preparation() validity in dbg mode
roystgnr Dec 5, 2025
a63efcb
Update bcid sets with new bcids in eigen ex3
roystgnr Dec 5, 2025
ee0d407
Update boundary id sets after boundary update
roystgnr Dec 8, 2025
a2ba524
Remove unnecessary side_id_map computation
roystgnr Dec 9, 2025
970142a
Fix side_id_map generation on refined meshes
roystgnr Dec 9, 2025
4aab53d
Added MeshBase::assert_equal_to
roystgnr Dec 10, 2025
b5ebe71
Add MeshTools::libmesh_assert_valid_is_prepared()
roystgnr Dec 10, 2025
eba8389
Enable !NDEBUG libmesh_assert_X as libmesh_assert
roystgnr Dec 10, 2025
1937cad
Better libmesh_assert_valid_is_prepared messages
roystgnr Dec 10, 2025
0c74e78
Update subdomain sets after subdomains
roystgnr Dec 10, 2025
50a8ec4
Fix broken error message
roystgnr Dec 10, 2025
727d738
Fix unused-parameter warnings
roystgnr Dec 10, 2025
044f122
Use libmesh_assert_valid_is_prepared()
roystgnr Dec 10, 2025
0867deb
Mark inline alternatives as inline
roystgnr Dec 10, 2025
8d2459b
Add clone() to our test GhostingFunctor subclasses
roystgnr Dec 11, 2025
44f1e9d
More updates of mesh caches
roystgnr Dec 11, 2025
88ac485
Implement clone() for misc_ex9 ghosting functor
roystgnr Dec 11, 2025
ab9305b
GhostingFunctor clone is pure virtual
roystgnr Dec 11, 2025
63df2c2
Only enforce preparation with --disable-deprecated
roystgnr Dec 11, 2025
20876b1
Mark overriding functions with override
roystgnr Dec 11, 2025
de9593c
Allow for remote_elem interior_parent() values
roystgnr Dec 12, 2025
039fcfc
Fix InfQuad::is_child_on_side()
roystgnr Dec 12, 2025
10979c6
More InfElem test coverage for is_child_on_*
roystgnr Dec 12, 2025
7715602
Handle skip_partitioning() in assertions
roystgnr Dec 15, 2025
96dba18
Preparation::libmesh_assert_consistent()
roystgnr Dec 18, 2025
858a657
Fix libmesh_dbg_var() comment
roystgnr Dec 18, 2025
d79bf91
Fix MeshBase::assert_equal_to error handling
roystgnr Dec 18, 2025
a32107e
Clean up MeshBase::assert_equal_to error message
roystgnr Dec 18, 2025
d8a4658
Test for parallel-consistent preparation
roystgnr Dec 18, 2025
7e131f1
Add Elem::total_family_tree_by_side()
roystgnr Jan 13, 2026
9cf5648
Add Elem::operator!=
roystgnr Jan 15, 2026
5ef677c
Elem::make_links_to_me_local fixes
roystgnr Jan 13, 2026
4bbac14
Set remote neighbors when refining elements
roystgnr Jan 13, 2026
9e6f0db
Handle subactive elements in Packing<Elem*> unpack
roystgnr Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/eigenproblems/eigenproblems_ex3/eigenproblems_ex3.C
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ int main (int argc, char ** argv)
if (elem->neighbor_ptr (side) == nullptr)
mesh.get_boundary_info().add_side(elem, side, BOUNDARY_ID);

mesh.get_boundary_info().regenerate_id_sets();

// Print information about the mesh to the screen.
mesh.print_info();

Expand Down
4 changes: 4 additions & 0 deletions examples/fem_system/fem_system_ex3/fem_system_ex3.C
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ int main (int argc, char ** argv)
mesh.get_boundary_info().add_edge(elem, e, edge_boundary_id);
}

// We're all done adding to the boundary_info; let's make sure its
// caches know about it.
mesh.get_boundary_info().regenerate_id_sets();

// Create an equation systems object.
EquationSystems equation_systems (mesh);

Expand Down
3 changes: 3 additions & 0 deletions examples/fem_system/fem_system_ex4/fem_system_ex4.C
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ int main (int argc, char ** argv)
if (elem->dim() < dim)
elem->subdomain_id() = 1;

// Make sure the mesh knows we added new subdomains.
mesh.cache_elem_data();

mesh_refinement.uniformly_refine(coarserefinements);

// Print information about the mesh to the screen.
Expand Down
3 changes: 3 additions & 0 deletions examples/fem_system/fem_system_ex5/fem_system_ex5.C
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ int main (int argc, char ** argv)
}
}

// We're done modifying the BoundaryInfo; get its caches up to date.
mesh.get_boundary_info().regenerate_id_sets();

// Create an equation systems object.
EquationSystems equation_systems (mesh);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ class AugmentSparsityOnInterface : public GhostingFunctor
boundary_id_type crack_boundary_lower,
boundary_id_type crack_boundary_upper);


virtual std::unique_ptr<GhostingFunctor> clone () const override
{
return std::make_unique<AugmentSparsityOnInterface>
(_mesh, _crack_boundary_lower, _crack_boundary_upper);
}

/**
* @return a const reference to the lower-to-upper element ID map.
*/
Expand Down
3 changes: 3 additions & 0 deletions examples/subdomains/subdomains_ex1/subdomains_ex1.C
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ int main (int argc, char ** argv)
elem->subdomain_id() = 1;
}

// Make sure the mesh knows we added new subdomains.
mesh.cache_elem_data();

// Create an equation systems object.
EquationSystems equation_systems (mesh);

Expand Down
3 changes: 3 additions & 0 deletions examples/subdomains/subdomains_ex2/subdomains_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ int main (int argc, char ** argv)
elem->subdomain_id() = 1;
}

// Make sure the mesh knows we added new subdomains.
mesh.cache_elem_data();

// Print information about the mesh to the screen.
mesh.print_info();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ int main (int argc, char ** argv)
mesh.get_boundary_info().add_edge(elem, e, EDGE_BOUNDARY_ID);
}

// We're all done adding to the boundary_info; let's make sure its
// caches know about it.
mesh.get_boundary_info().regenerate_id_sets();

// Create an equation systems object.
EquationSystems equation_systems (mesh);

Expand Down
2 changes: 1 addition & 1 deletion include/base/libmesh_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ extern bool warned_about_auto_ptr;
} while (0)

// The libmesh_dbg_var() macro indicates that an argument to a function
// is used only in debug mode (i.e., when NDEBUG is not defined).
// is used only in debug and devel modes (i.e., when NDEBUG is not defined).
#ifndef NDEBUG
#define libmesh_dbg_var(var) var
#else
Expand Down
37 changes: 33 additions & 4 deletions include/geom/elem.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,19 @@ class Elem : public ReferenceCountedObject<Elem>,
virtual dof_id_type key () const;

/**
* \returns \p true if two elements are equivalent, false otherwise.
* This is true if the elements are connected to identical global
* nodes, regardless of how those nodes might be numbered local
* to the elements.
* \returns \p true if two elements are equivalent, \p false
* otherwise. This is true if the elements are connected to
* identical global nodes, regardless of how those nodes might be
* numbered local to the elements.
*/
bool operator == (const Elem & rhs) const;

/**
* \returns \p false if two elements are equivalent, \p true
* otherwise.
*/
bool operator != (const Elem & rhs) const;

/**
* \returns \p true if two elements have equal topologies, false
* otherwise.
Expand Down Expand Up @@ -1585,6 +1591,21 @@ class Elem : public ReferenceCountedObject<Elem>,
unsigned int side,
bool reset = true);

/**
* Same as the \p total_family_tree() member, but only adds elements
* which are next to \p side.
*/
void total_family_tree_by_side (std::vector<const Elem *> & family,
unsigned int side,
bool reset = true) const;

/**
* Non-const version of function above; fills a vector of non-const pointers.
*/
void total_family_tree_by_side (std::vector<Elem *> & family,
unsigned int side,
bool reset = true);

/**
* Same as the \p active_family_tree() member, but only adds elements
* which are next to \p side.
Expand Down Expand Up @@ -2579,6 +2600,14 @@ subdomain_id_type & Elem::subdomain_id ()



inline
bool Elem::operator != (const Elem & rhs) const
{
return !(*this == rhs);
}



inline
const Elem * Elem::neighbor_ptr (unsigned int i) const
{
Expand Down
29 changes: 29 additions & 0 deletions include/geom/elem_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,35 @@ family_tree_by_side (T elem,



template <class T>
void
total_family_tree_by_side (T elem,
std::vector<T> & family,
unsigned int s,
bool reset)
{
// Clear the vector if the flag reset tells us to.
if (reset)
family.clear();

libmesh_assert_less (s, elem->n_sides());

// Add this element to the family tree.
family.push_back(elem);

// Recurse into the elements children, if it has them.
// Do not clear the vector any more.
if (elem->has_children())
{
const unsigned int nc = elem->n_children();
for (unsigned int c = 0; c != nc; c++)
if (!elem->child_ptr(c)->is_remote() && elem->is_child_on_side(c, s))
ElemInternal::total_family_tree_by_side (elem->child_ptr(c), family, s, false);
}
}



template <class T>
void
active_family_tree_by_side (T elem,
Expand Down
10 changes: 6 additions & 4 deletions include/ghosting/ghosting_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ class GhostingFunctor : public ReferenceCountedObject<GhostingFunctor>
* different meshes. The operations in GhostingFunctor are mesh dependent.
*/
virtual std::unique_ptr<GhostingFunctor> clone () const
// Let us return nullptr for backward compatibility.
// We will come back to mark this function as pure virtual
// once the API upgrade is done.
{ return nullptr; }
#ifndef LIBMESH_ENABLE_DEPRECATED
= 0;
#else
// Return nullptr for backward compatibility.
{ libmesh_deprecated(); return nullptr; }
#endif

/**
* It should be called after cloning a ghosting functor.
Expand Down
2 changes: 1 addition & 1 deletion include/mesh/distributed_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class DistributedMesh : public UnstructuredMesh
* Shim to allow operator == (&) to behave like a virtual function
* without having to be one.
*/
virtual bool subclass_locally_equals (const MeshBase & other_mesh) const override;
virtual std::string_view subclass_first_difference_from (const MeshBase & other_mesh_base) const override;

/**
* Virtual copy-constructor, creates a copy of this mesh
Expand Down
Loading