Actual source code: zfvf.c
1: #include <petsc/private/fortranimpl.h>
2: #include <petscfv.h>
3: #include <petscviewer.h>
5: #if defined(PETSC_HAVE_FORTRAN_CAPS)
6: #define petscfvsetcomponentname_ PETSCFVSETCOMPONENTNAME
7: #define petscfvview_ PETSCFVVIEW
8: #define petscfvsettype_ PETSCFVSETTYPE
9: #define petscfvviewfromoptions_ PETSCFVVIEWFROMOPTIONS
10: #define petsclimiterviewfromoptions_ PETSCLIMITERVIEWFROMOPTIONS
11: #define petsclimitersettype_ PETSCLIMITERSETTYPE
12: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
13: #define petscfvsetcomponentname_ petscfvsetcomponentname
14: #define petscfvview_ petscfvview
15: #define petscfvsettype_ petscfvsettype
16: #define petscfvviewfromoptions_ petscfvviewfromoptions
17: #define petsclimiterviewfromoptions_ petsclimiterviewfromoptions
18: #define petsclimitersettype_ petsclimitersettype
19: #endif
21: PETSC_EXTERN void petscfvsetcomponentname_(PetscFV *fvm, PetscInt *comp, char *name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
22: {
23: char *compname;
25: FIXCHAR(name, len, compname);
26: *ierr = PetscFVSetComponentName(*fvm, *comp, compname);
27: if (*ierr) return;
28: FREECHAR(name, compname);
29: }
31: PETSC_EXTERN void petscfvview_(PetscFV *fvm, PetscViewer *vin, PetscErrorCode *ierr)
32: {
33: PetscViewer v;
34: PetscPatchDefaultViewers_Fortran(vin, v);
35: *ierr = PetscFVView(*fvm, v);
36: }
38: PETSC_EXTERN void petscfvsettype_(PetscFV *fvm, char *type_name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
39: {
40: char *t;
42: FIXCHAR(type_name, len, t);
43: *ierr = PetscFVSetType(*fvm, t);
44: if (*ierr) return;
45: FREECHAR(type_name, t);
46: }
48: PETSC_EXTERN void petscfvviewfromoptions_(PetscFV *ao, PetscObject obj, char *type, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
49: {
50: char *t;
52: FIXCHAR(type, len, t);
53: CHKFORTRANNULLOBJECT(obj);
54: *ierr = PetscFVViewFromOptions(*ao, obj, t);
55: if (*ierr) return;
56: FREECHAR(type, t);
57: }
59: PETSC_EXTERN void petsclimiterviewfromoptions_(PetscLimiter *ao, PetscObject obj, char *type, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
60: {
61: char *t;
63: FIXCHAR(type, len, t);
64: CHKFORTRANNULLOBJECT(obj);
65: *ierr = PetscLimiterViewFromOptions(*ao, obj, t);
66: if (*ierr) return;
67: FREECHAR(type, t);
68: }
70: PETSC_EXTERN void petsclimitersettype_(PetscLimiter *lim, char *name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T namelen)
71: {
72: char *newname;
74: FIXCHAR(name, namelen, newname);
75: *ierr = PetscLimiterSetType(*lim, newname);
76: if (*ierr) return;
77: FREECHAR(name, newname);
78: }