intrusive_ptr for managing petsc objects
More...
#include "include/PetscSmartObj.hpp"
|
| using | Derived = boost::intrusive_ptr< typename std::remove_pointer< OBJ >::type > |
| |
template<typename OBJ>
struct MoFEM::SmartPetscObj< OBJ >
intrusive_ptr for managing petsc objects
It manages destruction, referencing and dereferencing petsc objects. It is similar how smart_ptr pointers works, but applied for petsc objects like Vec, DM, Mat, etc.
DEPRECATED auto createSmartGhostVector(MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
intrusive_ptr for managing petsc objects
- Template Parameters
-
- Examples
- ep.cpp, mofem/atom_tests/build_composite_problem.cpp, mofem/atom_tests/build_large_problem.cpp, mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/dm_build_partitioned_mesh.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/operators_tests.cpp, mofem/atom_tests/petsc_smart_ptr_objects.cpp, mofem/atom_tests/prism_polynomial_approximation.cpp, mofem/atom_tests/quad_polynomial_approximation.cpp, mofem/atom_tests/remove_entities_from_problem.cpp, mofem/atom_tests/remove_entities_from_problem_not_partitioned.cpp, mofem/atom_tests/schur_test_diag_mat.cpp, mofem/atom_tests/tensor_divergence_operator.cpp, mofem/atom_tests/test_broken_space.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tutorials/adv-0/plastic.cpp, mofem/tutorials/adv-2/thermo_elastic.cpp, mofem/tutorials/adv-3/level_set.cpp, mofem/tutorials/adv-4/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-5/seepage.cpp, mofem/tutorials/cor-10/navier_stokes.cpp, mofem/tutorials/cor-9/reaction_diffusion.cpp, mofem/tutorials/fun-1/integration.cpp, mofem/tutorials/mix-0/mixed_poisson.cpp, mofem/tutorials/scl-0/approximaton.cpp, mofem/tutorials/scl-1/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-10/photon_diffusion.cpp, mofem/tutorials/scl-6/heat_equation.cpp, mofem/tutorials/scl-7/wave_equation.cpp, mofem/tutorials/vec-1/eigen_elastic.cpp, mofem/tutorials/vec-10/schur_elastic.cpp, mofem/tutorials/vec-3/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4/approx_sphere.cpp, mofem/tutorials/vec-4/shallow_wave.cpp, mofem/tutorials/vec-5/free_surface.cpp, mofem/tutorials/vec-7/adjoint.cpp, mofem/tutorials/vec-9/arc_length.cpp, mofem/users_modules/adolc-plasticity/adolc_plasticity.cpp, mofem/users_modules/basic_finite_elements/elasticity/elasticity.cpp, mofem/users_modules/basic_finite_elements/src/impl/HookeElement.cpp, mofem/users_modules/eshelbian_plasticity/ep.cpp, and mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianPlasticity.cpp.
Definition at line 84 of file PetscSmartObj.hpp.
◆ Derived
template<typename OBJ >
| using MoFEM::SmartPetscObj< OBJ >::Derived = boost::intrusive_ptr<typename std::remove_pointer<OBJ>::type> |
◆ SmartPetscObj() [1/2]
◆ SmartPetscObj() [2/2]
Construct a new Smart Petsc Obj object.
- Note
- If add_red is set to true, you have to destroy OBJ.
- Parameters
-
Definition at line 101 of file PetscSmartObj.hpp.
102 : boost::intrusive_ptr<typename std::remove_pointer<OBJ>::type>(o,
103 add_ref) {
104 }
◆ operator OBJ()
◆ operator PetscObject()
Definition at line 107 of file PetscSmartObj.hpp.
107 {
108 return reinterpret_cast<PetscObject>(this->get());
109 }
◆ use_count()
The documentation for this struct was generated from the following file: