v0.8.23
DeprecatedPetsc.hpp
Go to the documentation of this file.
1 /** \file DeprecatedPetsc.hpp
2  * \brief Deprecated PETSc functions
3  *
4  * MoFEM is free software: you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or (at your
7  * option) any later version.
8  *
9  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12  * License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
16  */
17 
18 #ifndef __DEPRECATED_PETSC_HPP__
19 #define __DEPRECATED_PETSC_HPP__
20 
21 namespace MoFEM {
22 
23 #if PETSC_VERSION_GE(3, 7, 0)
24 
25 /**
26 \deprecated Function is deprecated use function
27 http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetInt.html>
28 */
29 inline PetscErrorCode PetscOptionsGetInt(const char pre[], const char name[],
30  PetscInt *ivalue, PetscBool *set) {
31  PetscErrorCode ierr;
33  ierr = ::PetscOptionsGetInt(PETSC_NULL, pre, name, ivalue, set);
34  CHKERRQ(ierr);
36 }
37 
38 /**
39 \deprecated Function is deprecated use function
40 http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetReal.html>
41 */
42 inline PetscErrorCode PetscOptionsGetReal(const char pre[], const char name[],
43  PetscReal *dval, PetscBool *set) {
44  PetscErrorCode ierr;
46  ierr = ::PetscOptionsGetReal(PETSC_NULL, pre, name, dval, set);
47  CHKERRQ(ierr);
49 }
50 
51 /**
52 \deprecated Function is deprecated use function
53 http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetScalar.html>
54 */
55 inline PetscErrorCode PetscOptionsGetScalar(const char pre[], const char name[],
56  PetscScalar *dval, PetscBool *set) {
57  PetscErrorCode ierr;
59  ierr = ::PetscOptionsGetScalar(PETSC_NULL, pre, name, dval, set);
60  CHKERRQ(ierr);
62 }
63 
64 /**
65 \deprecated Function is deprecated use function
66 http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetString.html>
67 */
68 inline PetscErrorCode PetscOptionsGetString(const char pre[], const char name[],
69  char str[], size_t size,
70  PetscBool *set) {
72  ierr = ::PetscOptionsGetString(PETSC_NULL, pre, name, str, size, set);
73  CHKERRQ(ierr);
75 }
76 
77 /**
78 \deprecated Function is deprecated
79 usectiontp://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetBool.html>
80 */
81 inline PetscErrorCode PetscOptionsGetBool(const char pre[], const char name[],
82  PetscBool *bval, PetscBool *set) {
83  PetscErrorCode ierr;
85  ierr = ::PetscOptionsGetBool(PETSC_NULL, pre, name, bval, set);
86  CHKERRQ(ierr);
88 }
89 
90 /**
91 \deprecated Function is deprecated
92 usectiontp://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetRealArray.html>
93 */
94 inline PetscErrorCode PetscOptionsGetRealArray(const char pre[],
95  const char name[],
96  PetscReal dval[], PetscInt *nmax,
97  PetscBool *set) {
98  PetscErrorCode ierr;
100  ierr = ::PetscOptionsGetRealArray(PETSC_NULL, pre, name, dval, nmax, set);
101  CHKERRQ(ierr);
103 }
104 
105 /**
106 \deprecated Function is deprecated
107 usectiontp://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetEList.html>
108 */
109 inline PetscErrorCode PetscOptionsGetEList(const char pre[], const char name[],
110  const char *const *list,
111  PetscInt next, PetscInt *value,
112  PetscBool *set) {
113  PetscErrorCode ierr;
115  ierr = ::PetscOptionsGetEList(PETSC_NULL, pre, name, list, next, value, set);
116  CHKERRQ(ierr);
118 }
119 
120 /**
121 \deprecated Function is deprecated
122 usectiontp://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetIntArray.html>
123 */
124 inline PetscErrorCode PetscOptionsGetIntArray(const char pre[],
125  const char name[],
126  PetscInt dvalue[], PetscInt *nmax,
127  PetscBool *set) {
128  PetscErrorCode ierr;
130  ierr = ::PetscOptionsGetIntArray(PETSC_NULL, pre, name, dvalue, nmax, set);
131  CHKERRQ(ierr);
133 }
134 
135 /**
136  *\deprecated Function is deprecated
137  *usectiontp://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetScalarArray.html>
138  */
139 inline PetscErrorCode PetscOptionsGetScalarArray(const char pre[],
140  const char name[],
141  PetscScalar dvalue[],
142  PetscInt *nmax,
143  PetscBool *set) {
144  PetscErrorCode ierr;
146  ierr = ::PetscOptionsGetScalarArray(PETSC_NULL, pre, name, dvalue, nmax, set);
147  CHKERRQ(ierr);
149 }
150 
151 #else
152 
153 inline PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[],
154  const char name[], PetscInt *ivalue,
155  PetscBool *set) {
156  PetscErrorCode ierr;
158  ierr = ::PetscOptionsGetInt(pre, name, ivalue, set);
159  CHKERRQ(ierr);
161 }
162 
163 inline PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[],
164  const char name[], PetscReal *dval,
165  PetscBool *set) {
166  PetscErrorCode ierr;
168  ierr = ::PetscOptionsGetReal(pre, name, dval, set);
169  CHKERRQ(ierr);
171 }
172 
173 inline PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[],
174  const char name[],
175  PetscScalar *dval, PetscBool *set) {
176  PetscErrorCode ierr;
178  ierr = ::PetscOptionsGetScalar(pre, name, dval, set);
179  CHKERRQ(ierr);
181 }
182 
183 inline PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[],
184  const char name[], char str[],
185  size_t size, PetscBool *set) {
186  PetscErrorCode ierr;
188  ierr = ::PetscOptionsGetString(pre, name, str, size, set);
189  CHKERRQ(ierr);
191 }
192 
193 inline PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[],
194  const char name[], PetscBool *bval,
195  PetscBool *set) {
196  PetscErrorCode ierr;
198  ierr = ::PetscOptionsGetBool(pre, name, bval, set);
199  CHKERRQ(ierr);
201 }
202 
203 inline PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[],
204  const char name[],
205  PetscReal dval[], PetscInt *nmax,
206  PetscBool *set) {
207  PetscErrorCode ierr;
209  ierr = ::PetscOptionsGetRealArray(pre, name, dval, nmax, set);
210  CHKERRQ(ierr);
212 }
213 
214 inline PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[],
215  const char name[],
216  const char *const *list,
217  PetscInt next, PetscInt *value,
218  PetscBool *set) {
219  PetscErrorCode ierr;
221  ierr = ::PetscOptionsGetEList(pre, name, list, next, value, set);
222  CHKERRQ(ierr);
224 }
225 
226 inline PetscErrorCode PetscOptionsGetIntArray(PetscOptions options,
227  const char pre[],
228  const char name[],
229  PetscInt dvalue[], PetscInt *nmax,
230  PetscBool *set) {
231  PetscErrorCode ierr;
233  ierr = ::PetscOptionsGetIntArray(pre, name, dvalue, nmax, set);
234  CHKERRQ(ierr);
236 }
237 
238 inline PetscErrorCode
239 PetscOptionsGetScalarArray(PetscOptions options, const char pre[],
240  const char name[], PetscScalar dvalue[],
241  PetscInt *nmax, PetscBool *set) {
242  PetscErrorCode ierr;
244  ierr = ::PetscOptionsGetScalarArray(pre, name, dvalue, nmax, set);
245  CHKERRQ(ierr);
247 }
248 
249 #endif
250 
251 } // namespace MoFEM
252 
253 #endif //__DEPRECATED_PETSC_HPP__
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507
PetscErrorCode PetscOptionsGetIntArray(PetscOptions options, const char pre[], const char name[], PetscInt dvalue[], PetscInt *nmax, PetscBool *set)
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
CHKERRQ(ierr)
PetscErrorCode PetscOptionsGetScalarArray(PetscOptions options, const char pre[], const char name[], PetscScalar dvalue[], PetscInt *nmax, PetscBool *set)
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)