Definition at line 34 of file equation_systems_test.C.
◆ CPPUNIT_TEST() [1/9]
◆ CPPUNIT_TEST() [2/9]
◆ CPPUNIT_TEST() [3/9]
◆ CPPUNIT_TEST() [4/9]
EquationSystemsTest::CPPUNIT_TEST |
( |
testInit |
| ) |
|
◆ CPPUNIT_TEST() [5/9]
◆ CPPUNIT_TEST() [6/9]
◆ CPPUNIT_TEST() [7/9]
◆ CPPUNIT_TEST() [8/9]
◆ CPPUNIT_TEST() [9/9]
◆ CPPUNIT_TEST_SUITE()
◆ CPPUNIT_TEST_SUITE_END()
EquationSystemsTest::CPPUNIT_TEST_SUITE_END |
( |
| ) |
|
◆ setUp()
void EquationSystemsTest::setUp |
( |
| ) |
|
|
inline |
◆ tearDown()
void EquationSystemsTest::tearDown |
( |
| ) |
|
|
inline |
◆ testAddSystem()
void EquationSystemsTest::testAddSystem |
( |
| ) |
|
|
inline |
◆ testConstruction()
void EquationSystemsTest::testConstruction |
( |
| ) |
|
|
inline |
◆ testDisableDefaultGhosting()
void EquationSystemsTest::testDisableDefaultGhosting |
( |
| ) |
|
|
inline |
Definition at line 217 of file equation_systems_test.C.
222 auto n_ghosts = [&
mesh]() {
227 auto n_evaluables = [](
System &sys) {
228 return int(
std::distance(sys.get_dof_map().algebraic_ghosting_functors_begin(),
229 sys.get_dof_map().algebraic_ghosting_functors_end()));
232 auto n_couplings = [](
System &sys) {
234 sys.get_dof_map().coupling_functors_end()));
238 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 1);
241 auto gpn = std::make_shared<GhostPointNeighbors>(
mesh);
243 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 2);
246 es.enable_default_ghosting(
false);
247 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 1);
251 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 0);
256 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 0);
257 CPPUNIT_ASSERT_EQUAL(n_evaluables(sys1), 0);
258 CPPUNIT_ASSERT_EQUAL(n_couplings(sys1), 0);
266 es.enable_default_ghosting(
true);
267 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 3);
268 CPPUNIT_ASSERT_EQUAL(n_evaluables(sys1), 1);
269 CPPUNIT_ASSERT_EQUAL(n_couplings(sys1), 1);
274 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 5);
275 CPPUNIT_ASSERT_EQUAL(n_evaluables(sys2), 1);
276 CPPUNIT_ASSERT_EQUAL(n_couplings(sys2), 1);
282 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 6);
283 CPPUNIT_ASSERT_EQUAL(n_evaluables(sys1), 2);
284 CPPUNIT_ASSERT_EQUAL(n_couplings(sys1), 1);
287 auto gpn3 = std::make_shared<GhostPointNeighbors>(
mesh);
289 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 6);
290 CPPUNIT_ASSERT_EQUAL(n_evaluables(sys1), 2);
291 CPPUNIT_ASSERT_EQUAL(n_couplings(sys1), 2);
295 es.enable_default_ghosting(
false);
296 CPPUNIT_ASSERT_EQUAL(n_ghosts(), 1);
297 CPPUNIT_ASSERT_EQUAL(n_evaluables(sys1), 1);
298 CPPUNIT_ASSERT_EQUAL(n_couplings(sys1), 1);
299 CPPUNIT_ASSERT_EQUAL(n_evaluables(sys2), 0);
300 CPPUNIT_ASSERT_EQUAL(n_couplings(sys2), 0);
References libMesh::DofMap::add_algebraic_ghosting_functor(), libMesh::DofMap::add_coupling_functor(), libMesh::MeshBase::add_ghosting_functor(), libMesh::EquationSystems::add_system(), distance(), libMesh::EquationSystems::enable_default_ghosting(), libMesh::System::get_dof_map(), libMesh::MeshBase::ghosting_functors_begin(), libMesh::MeshBase::ghosting_functors_end(), int, mesh, libMesh::MeshBase::remove_ghosting_functor(), and TestCommWorld.
◆ testInit()
void EquationSystemsTest::testInit |
( |
| ) |
|
|
inline |
◆ testPostInitAddElem()
void EquationSystemsTest::testPostInitAddElem |
( |
| ) |
|
|
inline |
Definition at line 111 of file equation_systems_test.C.
References libMesh::MeshBase::add_elem(), libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::Elem::build(), libMesh::MeshTools::Generation::build_line(), libMesh::EDGE2, libMesh::FIRST, libMesh::EquationSystems::init(), libMesh::MeshBase::max_elem_id(), mesh, libMesh::MeshBase::node_ptr(), libMesh::MeshBase::prepare_for_use(), libMesh::DofObject::processor_id(), libMesh::EquationSystems::reinit(), libMesh::DofObject::set_id(), libMesh::Elem::set_node(), and TestCommWorld.
◆ testPostInitAddRealSystem()
void EquationSystemsTest::testPostInitAddRealSystem |
( |
| ) |
|
|
inline |
◆ testPostInitAddSystem()
void EquationSystemsTest::testPostInitAddSystem |
( |
| ) |
|
|
inline |
◆ testRefineThenReinitPreserveFlags()
void EquationSystemsTest::testRefineThenReinitPreserveFlags |
( |
| ) |
|
|
inline |
Definition at line 149 of file equation_systems_test.C.
152 #ifdef LIBMESH_ENABLE_AMR
166 mr.refine_elements();
167 es.disable_refine_in_reinit();
178 for (
unsigned int c=0; c<elem->
n_children(); c++)
180 CPPUNIT_ASSERT_EQUAL(Elem::JUST_REFINED,
References libMesh::Elem::active(), libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::MeshBase::allow_renumbering(), libMesh::MeshTools::Generation::build_square(), libMesh::Elem::child_ptr(), libMesh::EquationSystems::disable_refine_in_reinit(), libMesh::MeshBase::elem_ptr(), libMesh::FIRST, libMesh::Elem::INACTIVE, libMesh::EquationSystems::init(), libMesh::Elem::JUST_REFINED, mesh, libMesh::Elem::n_children(), libMesh::MeshBase::query_elem_ptr(), libMesh::Elem::REFINE, libMesh::MeshRefinement::refine_elements(), libMesh::Elem::refinement_flag(), libMesh::EquationSystems::reinit(), libMesh::remote_elem, libMesh::Elem::set_refinement_flag(), and TestCommWorld.
◆ testReinitWithNodeElem()
void EquationSystemsTest::testReinitWithNodeElem |
( |
| ) |
|
|
inline |
Definition at line 133 of file equation_systems_test.C.
References libMesh::MeshBase::add_elem(), libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::MeshTools::Generation::build_line(), libMesh::CONSTANT, libMesh::EDGE2, libMesh::EquationSystems::init(), mesh, libMesh::MONOMIAL, libMesh::MeshBase::node_ptr(), libMesh::MeshBase::prepare_for_use(), libMesh::EquationSystems::reinit(), libMesh::Elem::set_node(), and TestCommWorld.
◆ testRepartitionThenReinit()
void EquationSystemsTest::testRepartitionThenReinit |
( |
| ) |
|
|
inline |
Definition at line 188 of file equation_systems_test.C.
207 for (
Real x = 0.1; x < 1; x += 0.2)
208 for (
Real y = 0.1; y < 1; y += 0.2)
References libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::MeshBase::allow_renumbering(), libMesh::MeshTools::Generation::build_square(), libMesh::FIRST, libMesh::EquationSystems::init(), libMesh::libmesh_real(), mesh, libMesh::EquationSystems::parameters, libMesh::MeshBase::partition(), libMesh::System::point_value(), libMesh::System::project_solution(), libMesh::Real, libMesh::EquationSystems::reinit(), TestCommWorld, and libMesh::TOLERANCE.
The documentation for this class was generated from the following file:
void add_algebraic_ghosting_functor(GhostingFunctor &evaluable_functor, bool to_mesh=true)
Adds a functor which can specify algebraic ghosting requirements for use with distributed vectors.
Manages consistently variables, degrees of freedom, and coefficient vectors.
std::set< GhostingFunctor * >::const_iterator ghosting_functors_begin() const
Beginning of range of ghosting functors.
const Elem * child_ptr(unsigned int i) const
std::set< GhostingFunctor * >::const_iterator ghosting_functors_end() const
End of range of ghosting functors.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
virtual void reinit()
Reinitializes degrees of freedom and other required data on the current mesh.
void init()
Initializes degrees of freedom on the current mesh.
virtual dof_id_type max_elem_id() const =0
static const Real TOLERANCE
This class implements the default geometry ghosting in libMesh: point neighbors and interior_parent e...
virtual const Node * node_ptr(const dof_id_type i) const =0
processor_id_type processor_id() const
virtual const Elem * elem_ptr(const dof_id_type i) const =0
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
Implements (adaptive) mesh refinement algorithms for a MeshBase.
void remove_ghosting_functor(GhostingFunctor &ghosting_functor)
Removes a functor which was previously added to the set of ghosting functors.
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
libMesh::Parallel::Communicator * TestCommWorld
A Point defines a location in LIBMESH_DIM dimensional Real space.
The NodeElem is a point element, generally used as a side of a 1D element.
This is the EquationSystems class.
virtual Node *& set_node(const unsigned int i)
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
Adds a functor which can specify ghosting requirements for use on distributed meshes.
RefinementState refinement_flag() const
Real distance(const Point &p)
Number point_value(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) const
virtual unsigned int n_children() const =0
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
This is the base class from which all geometric element types are derived.
const DofMap & get_dof_map() const
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Prepare a newly ecreated (or read) mesh for use.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
Projects arbitrary functions onto the current solution.
const RemoteElem * remote_elem
void ErrorVector unsigned int
virtual void partition(const unsigned int n_parts)
Call the default partitioner (currently metis_partition()).
void add_coupling_functor(GhostingFunctor &coupling_functor, bool to_mesh=true)
Adds a functor which can specify coupling requirements for creation of sparse matrices.