v0.14.0
Functions
PetscSmartObj.cpp File Reference

Go to the source code of this file.

Functions

template<>
void intrusive_ptr_release< Vec > (Vec obj)
 
template<>
void intrusive_ptr_release< Mat > (Mat obj)
 
template<>
void intrusive_ptr_release< DM > (DM obj)
 
template<>
void intrusive_ptr_release< IS > (IS obj)
 
template<>
void intrusive_ptr_release< AO > (AO obj)
 
template<>
void intrusive_ptr_release< KSP > (KSP obj)
 
template<>
void intrusive_ptr_release< SNES > (SNES obj)
 
template<>
void intrusive_ptr_release< TS > (TS obj)
 

Function Documentation

◆ intrusive_ptr_release< AO >()

template<>
void intrusive_ptr_release< AO > ( AO  obj)

Definition at line 55 of file PetscSmartObj.cpp.

55  {
56  int cnt = 0;
57  PetscErrorCode ierr =
58  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
59  if (!ierr) {
60  if (cnt) {
61  ierr = AODestroy(&obj);
62  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
63  CHKERRABORT(comm, ierr);
64  }
65  }
66 }

◆ intrusive_ptr_release< DM >()

template<>
void intrusive_ptr_release< DM > ( DM  obj)

Definition at line 29 of file PetscSmartObj.cpp.

29  {
30  int cnt = 0;
31  PetscErrorCode ierr =
32  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
33  if (!ierr) {
34  if (cnt) {
35  ierr = DMDestroy(&obj);
36  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
37  CHKERRABORT(comm, ierr);
38  }
39  }
40 }

◆ intrusive_ptr_release< IS >()

template<>
void intrusive_ptr_release< IS > ( IS  obj)

Definition at line 42 of file PetscSmartObj.cpp.

42  {
43  int cnt = 0;
44  PetscErrorCode ierr =
45  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
46  if (!ierr) {
47  if (cnt) {
48  ierr = ISDestroy(&obj);
49  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
50  CHKERRABORT(comm, ierr);
51  }
52  }
53 }

◆ intrusive_ptr_release< KSP >()

template<>
void intrusive_ptr_release< KSP > ( KSP  obj)

Definition at line 68 of file PetscSmartObj.cpp.

68  {
69  int cnt = 0;
70  PetscErrorCode ierr =
71  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
72  if (!ierr) {
73  if (cnt) {
74  ierr = KSPDestroy(&obj);
75  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
76  CHKERRABORT(comm, ierr);
77  }
78  }
79 }

◆ intrusive_ptr_release< Mat >()

template<>
void intrusive_ptr_release< Mat > ( Mat  obj)

Definition at line 16 of file PetscSmartObj.cpp.

16  {
17  int cnt = 0;
18  PetscErrorCode ierr =
19  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
20  if (!ierr) {
21  if (cnt) {
22  ierr = MatDestroy(&obj);
23  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
24  CHKERRABORT(comm, ierr);
25  }
26  }
27 }

◆ intrusive_ptr_release< SNES >()

template<>
void intrusive_ptr_release< SNES > ( SNES  obj)

Definition at line 81 of file PetscSmartObj.cpp.

81  {
82  int cnt = 0;
83  PetscErrorCode ierr =
84  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
85  if (!ierr) {
86  if (cnt) {
87  ierr = SNESDestroy(&obj);
88  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
89  CHKERRABORT(comm, ierr);
90  }
91  }
92 }

◆ intrusive_ptr_release< TS >()

template<>
void intrusive_ptr_release< TS > ( TS  obj)

Definition at line 94 of file PetscSmartObj.cpp.

94  {
95  int cnt = 0;
96  PetscErrorCode ierr =
97  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
98  if (!ierr) {
99  if (cnt) {
100  ierr = TSDestroy(&obj);
101  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
102  CHKERRABORT(comm, ierr);
103  }
104  }
105 }

◆ intrusive_ptr_release< Vec >()

template<>
void intrusive_ptr_release< Vec > ( Vec  obj)

Definition at line 3 of file PetscSmartObj.cpp.

3  {
4  int cnt = 0;
5  PetscErrorCode ierr =
6  PetscObjectGetReference(MoFEM::getPetscObject(obj), &cnt);
7  if (!ierr) {
8  if (cnt) {
9  ierr = VecDestroy(&obj);
10  auto comm = PetscObjectComm(MoFEM::getPetscObject(obj));
11  CHKERRABORT(comm, ierr);
12  }
13  }
14 }
MoFEM::getPetscObject
PetscObject getPetscObject(T obj)
Definition: PetscSmartObj.hpp:9
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76