Actual source code: snesf.c
1: /* snes.c */
2: /* Fortran interface file */
4: /*
5: * This file was generated automatically by bfort from the C source
6: * file.
7: */
9: #ifdef PETSC_USE_POINTER_CONVERSION
10: #if defined(__cplusplus)
11: extern "C" {
12: #endif
13: extern void *PetscToPointer(void *);
14: extern int PetscFromPointer(void *);
15: extern void PetscRmPointer(void *);
16: #if defined(__cplusplus)
17: }
18: #endif
20: #else
22: #define PetscToPointer(a) (*(long *)(a))
23: #define PetscFromPointer(a) (long)(a)
24: #define PetscRmPointer(a)
25: #endif
27: #include petscsnes.h
28: #ifdef MPI_BUILD_PROFILING
29: #ifdef PETSC_HAVE_FORTRAN_CAPS
30: #define snessetfromoptions_ PSNESSETFROMOPTIONS
31: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
32: #define snessetfromoptions_ psnessetfromoptions
33: #else
34: #define snessetfromoptions_ psnessetfromoptions_
35: #endif
36: #else
37: #ifdef PETSC_HAVE_FORTRAN_CAPS
38: #define snessetfromoptions_ SNESSETFROMOPTIONS
39: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
40: #define snessetfromoptions_ snessetfromoptions
41: #endif
42: #endif
44: #ifdef MPI_BUILD_PROFILING
45: #ifdef PETSC_HAVE_FORTRAN_CAPS
46: #define snessetapplicationcontext_ PSNESSETAPPLICATIONCONTEXT
47: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
48: #define snessetapplicationcontext_ psnessetapplicationcontext
49: #else
50: #define snessetapplicationcontext_ psnessetapplicationcontext_
51: #endif
52: #else
53: #ifdef PETSC_HAVE_FORTRAN_CAPS
54: #define snessetapplicationcontext_ SNESSETAPPLICATIONCONTEXT
55: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
56: #define snessetapplicationcontext_ snessetapplicationcontext
57: #endif
58: #endif
60: #ifdef MPI_BUILD_PROFILING
61: #ifdef PETSC_HAVE_FORTRAN_CAPS
62: #define snesgetiterationnumber_ PSNESGETITERATIONNUMBER
63: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
64: #define snesgetiterationnumber_ psnesgetiterationnumber
65: #else
66: #define snesgetiterationnumber_ psnesgetiterationnumber_
67: #endif
68: #else
69: #ifdef PETSC_HAVE_FORTRAN_CAPS
70: #define snesgetiterationnumber_ SNESGETITERATIONNUMBER
71: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
72: #define snesgetiterationnumber_ snesgetiterationnumber
73: #endif
74: #endif
76: #ifdef MPI_BUILD_PROFILING
77: #ifdef PETSC_HAVE_FORTRAN_CAPS
78: #define snesgetfunctionnorm_ PSNESGETFUNCTIONNORM
79: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
80: #define snesgetfunctionnorm_ psnesgetfunctionnorm
81: #else
82: #define snesgetfunctionnorm_ psnesgetfunctionnorm_
83: #endif
84: #else
85: #ifdef PETSC_HAVE_FORTRAN_CAPS
86: #define snesgetfunctionnorm_ SNESGETFUNCTIONNORM
87: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
88: #define snesgetfunctionnorm_ snesgetfunctionnorm
89: #endif
90: #endif
92: #ifdef MPI_BUILD_PROFILING
93: #ifdef PETSC_HAVE_FORTRAN_CAPS
94: #define snesgetgradientnorm_ PSNESGETGRADIENTNORM
95: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
96: #define snesgetgradientnorm_ psnesgetgradientnorm
97: #else
98: #define snesgetgradientnorm_ psnesgetgradientnorm_
99: #endif
100: #else
101: #ifdef PETSC_HAVE_FORTRAN_CAPS
102: #define snesgetgradientnorm_ SNESGETGRADIENTNORM
103: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
104: #define snesgetgradientnorm_ snesgetgradientnorm
105: #endif
106: #endif
108: #ifdef MPI_BUILD_PROFILING
109: #ifdef PETSC_HAVE_FORTRAN_CAPS
110: #define snesgetnumberunsuccessfulsteps_ PSNESGETNUMBERUNSUCCESSFULSTEPS
111: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
112: #define snesgetnumberunsuccessfulsteps_ psnesgetnumberunsuccessfulsteps
113: #else
114: #define snesgetnumberunsuccessfulsteps_ psnesgetnumberunsuccessfulsteps_
115: #endif
116: #else
117: #ifdef PETSC_HAVE_FORTRAN_CAPS
118: #define snesgetnumberunsuccessfulsteps_ SNESGETNUMBERUNSUCCESSFULSTEPS
119: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
120: #define snesgetnumberunsuccessfulsteps_ snesgetnumberunsuccessfulsteps
121: #endif
122: #endif
124: #ifdef MPI_BUILD_PROFILING
125: #ifdef PETSC_HAVE_FORTRAN_CAPS
126: #define snesgetnumberlineariterations_ PSNESGETNUMBERLINEARITERATIONS
127: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
128: #define snesgetnumberlineariterations_ psnesgetnumberlineariterations
129: #else
130: #define snesgetnumberlineariterations_ psnesgetnumberlineariterations_
131: #endif
132: #else
133: #ifdef PETSC_HAVE_FORTRAN_CAPS
134: #define snesgetnumberlineariterations_ SNESGETNUMBERLINEARITERATIONS
135: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
136: #define snesgetnumberlineariterations_ snesgetnumberlineariterations
137: #endif
138: #endif
140: #ifdef MPI_BUILD_PROFILING
141: #ifdef PETSC_HAVE_FORTRAN_CAPS
142: #define snescomputefunction_ PSNESCOMPUTEFUNCTION
143: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
144: #define snescomputefunction_ psnescomputefunction
145: #else
146: #define snescomputefunction_ psnescomputefunction_
147: #endif
148: #else
149: #ifdef PETSC_HAVE_FORTRAN_CAPS
150: #define snescomputefunction_ SNESCOMPUTEFUNCTION
151: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
152: #define snescomputefunction_ snescomputefunction
153: #endif
154: #endif
156: #ifdef MPI_BUILD_PROFILING
157: #ifdef PETSC_HAVE_FORTRAN_CAPS
158: #define snescomputeminimizationfunction_ PSNESCOMPUTEMINIMIZATIONFUNCTION
159: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
160: #define snescomputeminimizationfunction_ psnescomputeminimizationfunction
161: #else
162: #define snescomputeminimizationfunction_ psnescomputeminimizationfunction_
163: #endif
164: #else
165: #ifdef PETSC_HAVE_FORTRAN_CAPS
166: #define snescomputeminimizationfunction_ SNESCOMPUTEMINIMIZATIONFUNCTION
167: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
168: #define snescomputeminimizationfunction_ snescomputeminimizationfunction
169: #endif
170: #endif
172: #ifdef MPI_BUILD_PROFILING
173: #ifdef PETSC_HAVE_FORTRAN_CAPS
174: #define snescomputegradient_ PSNESCOMPUTEGRADIENT
175: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
176: #define snescomputegradient_ psnescomputegradient
177: #else
178: #define snescomputegradient_ psnescomputegradient_
179: #endif
180: #else
181: #ifdef PETSC_HAVE_FORTRAN_CAPS
182: #define snescomputegradient_ SNESCOMPUTEGRADIENT
183: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
184: #define snescomputegradient_ snescomputegradient
185: #endif
186: #endif
188: #ifdef MPI_BUILD_PROFILING
189: #ifdef PETSC_HAVE_FORTRAN_CAPS
190: #define snescomputejacobian_ PSNESCOMPUTEJACOBIAN
191: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
192: #define snescomputejacobian_ psnescomputejacobian
193: #else
194: #define snescomputejacobian_ psnescomputejacobian_
195: #endif
196: #else
197: #ifdef PETSC_HAVE_FORTRAN_CAPS
198: #define snescomputejacobian_ SNESCOMPUTEJACOBIAN
199: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
200: #define snescomputejacobian_ snescomputejacobian
201: #endif
202: #endif
204: #ifdef MPI_BUILD_PROFILING
205: #ifdef PETSC_HAVE_FORTRAN_CAPS
206: #define snescomputehessian_ PSNESCOMPUTEHESSIAN
207: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
208: #define snescomputehessian_ psnescomputehessian
209: #else
210: #define snescomputehessian_ psnescomputehessian_
211: #endif
212: #else
213: #ifdef PETSC_HAVE_FORTRAN_CAPS
214: #define snescomputehessian_ SNESCOMPUTEHESSIAN
215: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
216: #define snescomputehessian_ snescomputehessian
217: #endif
218: #endif
220: #ifdef MPI_BUILD_PROFILING
221: #ifdef PETSC_HAVE_FORTRAN_CAPS
222: #define snesgethessian_ PSNESGETHESSIAN
223: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
224: #define snesgethessian_ psnesgethessian
225: #else
226: #define snesgethessian_ psnesgethessian_
227: #endif
228: #else
229: #ifdef PETSC_HAVE_FORTRAN_CAPS
230: #define snesgethessian_ SNESGETHESSIAN
231: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
232: #define snesgethessian_ snesgethessian
233: #endif
234: #endif
236: #ifdef MPI_BUILD_PROFILING
237: #ifdef PETSC_HAVE_FORTRAN_CAPS
238: #define snessetup_ PSNESSETUP
239: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
240: #define snessetup_ psnessetup
241: #else
242: #define snessetup_ psnessetup_
243: #endif
244: #else
245: #ifdef PETSC_HAVE_FORTRAN_CAPS
246: #define snessetup_ SNESSETUP
247: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
248: #define snessetup_ snessetup
249: #endif
250: #endif
252: #ifdef MPI_BUILD_PROFILING
253: #ifdef PETSC_HAVE_FORTRAN_CAPS
254: #define snessettolerances_ PSNESSETTOLERANCES
255: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
256: #define snessettolerances_ psnessettolerances
257: #else
258: #define snessettolerances_ psnessettolerances_
259: #endif
260: #else
261: #ifdef PETSC_HAVE_FORTRAN_CAPS
262: #define snessettolerances_ SNESSETTOLERANCES
263: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
264: #define snessettolerances_ snessettolerances
265: #endif
266: #endif
268: #ifdef MPI_BUILD_PROFILING
269: #ifdef PETSC_HAVE_FORTRAN_CAPS
270: #define snesgettolerances_ PSNESGETTOLERANCES
271: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
272: #define snesgettolerances_ psnesgettolerances
273: #else
274: #define snesgettolerances_ psnesgettolerances_
275: #endif
276: #else
277: #ifdef PETSC_HAVE_FORTRAN_CAPS
278: #define snesgettolerances_ SNESGETTOLERANCES
279: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
280: #define snesgettolerances_ snesgettolerances
281: #endif
282: #endif
284: #ifdef MPI_BUILD_PROFILING
285: #ifdef PETSC_HAVE_FORTRAN_CAPS
286: #define snessettrustregiontolerance_ PSNESSETTRUSTREGIONTOLERANCE
287: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
288: #define snessettrustregiontolerance_ psnessettrustregiontolerance
289: #else
290: #define snessettrustregiontolerance_ psnessettrustregiontolerance_
291: #endif
292: #else
293: #ifdef PETSC_HAVE_FORTRAN_CAPS
294: #define snessettrustregiontolerance_ SNESSETTRUSTREGIONTOLERANCE
295: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
296: #define snessettrustregiontolerance_ snessettrustregiontolerance
297: #endif
298: #endif
300: #ifdef MPI_BUILD_PROFILING
301: #ifdef PETSC_HAVE_FORTRAN_CAPS
302: #define snessetminimizationfunctiontolerance_ PSNESSETMINIMIZATIONFUNCTIONTOLERANCE
303: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
304: #define snessetminimizationfunctiontolerance_ psnessetminimizationfunctiontolerance
305: #else
306: #define snessetminimizationfunctiontolerance_ psnessetminimizationfunctiontolerance_
307: #endif
308: #else
309: #ifdef PETSC_HAVE_FORTRAN_CAPS
310: #define snessetminimizationfunctiontolerance_ SNESSETMINIMIZATIONFUNCTIONTOLERANCE
311: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
312: #define snessetminimizationfunctiontolerance_ snessetminimizationfunctiontolerance
313: #endif
314: #endif
316: #ifdef MPI_BUILD_PROFILING
317: #ifdef PETSC_HAVE_FORTRAN_CAPS
318: #define snessetconvergencehistory_ PSNESSETCONVERGENCEHISTORY
319: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
320: #define snessetconvergencehistory_ psnessetconvergencehistory
321: #else
322: #define snessetconvergencehistory_ psnessetconvergencehistory_
323: #endif
324: #else
325: #ifdef PETSC_HAVE_FORTRAN_CAPS
326: #define snessetconvergencehistory_ SNESSETCONVERGENCEHISTORY
327: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
328: #define snessetconvergencehistory_ snessetconvergencehistory
329: #endif
330: #endif
332: #ifdef MPI_BUILD_PROFILING
333: #ifdef PETSC_HAVE_FORTRAN_CAPS
334: #define snessolve_ PSNESSOLVE
335: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
336: #define snessolve_ psnessolve
337: #else
338: #define snessolve_ psnessolve_
339: #endif
340: #else
341: #ifdef PETSC_HAVE_FORTRAN_CAPS
342: #define snessolve_ SNESSOLVE
343: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
344: #define snessolve_ snessolve
345: #endif
346: #endif
350: /* Definitions of Fortran Wrapper routines */
351: #if defined(__cplusplus)
352: extern "C" {
353: #endif
354: void PETSC_STDCALL snessetfromoptions_(SNES snes, int *__ierr ){
355: *__SNESSetFromOptions(
356: (SNES)PetscToPointer( (snes) ));
357: }
358: void PETSC_STDCALL snessetapplicationcontext_(SNES snes,void*usrP, int *__ierr ){
359: *__SNESSetApplicationContext(
360: (SNES)PetscToPointer( (snes) ),usrP);
361: }
362: void PETSC_STDCALL snesgetiterationnumber_(SNES snes,int* iter, int *__ierr ){
363: *__SNESGetIterationNumber(
364: (SNES)PetscToPointer( (snes) ),iter);
365: }
366: void PETSC_STDCALL snesgetfunctionnorm_(SNES snes,Scalar *fnorm, int *__ierr ){
367: *__SNESGetFunctionNorm(
368: (SNES)PetscToPointer( (snes) ),fnorm);
369: }
370: void PETSC_STDCALL snesgetgradientnorm_(SNES snes,Scalar *gnorm, int *__ierr ){
371: *__SNESGetGradientNorm(
372: (SNES)PetscToPointer( (snes) ),gnorm);
373: }
374: void PETSC_STDCALL snesgetnumberunsuccessfulsteps_(SNES snes,int* nfails, int *__ierr ){
375: *__SNESGetNumberUnsuccessfulSteps(
376: (SNES)PetscToPointer( (snes) ),nfails);
377: }
378: void PETSC_STDCALL snesgetnumberlineariterations_(SNES snes,int* lits, int *__ierr ){
379: *__SNESGetNumberLinearIterations(
380: (SNES)PetscToPointer( (snes) ),lits);
381: }
382: void PETSC_STDCALL snescomputefunction_(SNES snes,Vec x,Vec y, int *__ierr ){
383: *__SNESComputeFunction(
384: (SNES)PetscToPointer( (snes) ),
385: (Vec)PetscToPointer( (x) ),
386: (Vec)PetscToPointer( (y) ));
387: }
388: void PETSC_STDCALL snescomputeminimizationfunction_(SNES snes,Vec x,PetscReal *y, int *__ierr ){
389: *__SNESComputeMinimizationFunction(
390: (SNES)PetscToPointer( (snes) ),
391: (Vec)PetscToPointer( (x) ),y);
392: }
393: void PETSC_STDCALL snescomputegradient_(SNES snes,Vec x,Vec y, int *__ierr ){
394: *__SNESComputeGradient(
395: (SNES)PetscToPointer( (snes) ),
396: (Vec)PetscToPointer( (x) ),
397: (Vec)PetscToPointer( (y) ));
398: }
399: void PETSC_STDCALL snescomputejacobian_(SNES snes,Vec X,Mat *A,Mat *B,MatStructure *flg, int *__ierr ){
400: *__SNESComputeJacobian(
401: (SNES)PetscToPointer( (snes) ),
402: (Vec)PetscToPointer( (X) ),A,B,
403: (MatStructure* )PetscToPointer( (flg) ));
404: }
405: void PETSC_STDCALL snescomputehessian_(SNES snes,Vec x,Mat *A,Mat *B,MatStructure *flag, int *__ierr ){
406: *__SNESComputeHessian(
407: (SNES)PetscToPointer( (snes) ),
408: (Vec)PetscToPointer( (x) ),A,B,
409: (MatStructure* )PetscToPointer( (flag) ));
410: }
411: void PETSC_STDCALL snesgethessian_(SNES snes,Mat *A,Mat *B,void**ctx, int *__ierr ){
412: *__SNESGetHessian(
413: (SNES)PetscToPointer( (snes) ),A,B,ctx);
414: }
415: void PETSC_STDCALL snessetup_(SNES snes,Vec x, int *__ierr ){
416: *__SNESSetUp(
417: (SNES)PetscToPointer( (snes) ),
418: (Vec)PetscToPointer( (x) ));
419: }
420: void PETSC_STDCALL snessettolerances_(SNES snes,PetscReal *atol,PetscReal *rtol,PetscReal *stol,int *maxit,int *maxf, int *__ierr ){
421: *__SNESSetTolerances(
422: (SNES)PetscToPointer( (snes) ),*atol,*rtol,*stol,*maxit,*maxf);
423: }
424: void PETSC_STDCALL snesgettolerances_(SNES snes,PetscReal *atol,PetscReal *rtol,PetscReal *stol,int *maxit,int *maxf, int *__ierr ){
425: *__SNESGetTolerances(
426: (SNES)PetscToPointer( (snes) ),atol,rtol,stol,maxit,maxf);
427: }
428: void PETSC_STDCALL snessettrustregiontolerance_(SNES snes,PetscReal *tol, int *__ierr ){
429: *__SNESSetTrustRegionTolerance(
430: (SNES)PetscToPointer( (snes) ),*tol);
431: }
432: void PETSC_STDCALL snessetminimizationfunctiontolerance_(SNES snes,PetscReal *ftol, int *__ierr ){
433: *__SNESSetMinimizationFunctionTolerance(
434: (SNES)PetscToPointer( (snes) ),*ftol);
435: }
436: void PETSC_STDCALL snessetconvergencehistory_(SNES snes,PetscReal *a,int *its,int *na,PetscTruth *reset, int *__ierr ){
437: *__SNESSetConvergenceHistory(
438: (SNES)PetscToPointer( (snes) ),a,its,*na,*reset);
439: }
440: void PETSC_STDCALL snessolve_(SNES snes,Vec x,int *its, int *__ierr ){
441: *__SNESSolve(
442: (SNES)PetscToPointer( (snes) ),
443: (Vec)PetscToPointer( (x) ),its);
444: }
445: #if defined(__cplusplus)
446: }
447: #endif