Subversion Repositories slepc-dev

Rev

Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1376 slepc 1
/*
2
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1672 slepc 3
   SLEPc - Scalable Library for Eigenvalue Problem Computations
2116 eromero 4
   Copyright (c) 2002-2010, Universidad Politecnica de Valencia, Spain
1346 slepc 5
 
1672 slepc 6
   This file is part of SLEPc.
7
 
8
   SLEPc is free software: you can redistribute it and/or modify it under  the
9
   terms of version 3 of the GNU Lesser General Public License as published by
10
   the Free Software Foundation.
11
 
12
   SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
13
   WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
14
   FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
15
   more details.
16
 
17
   You  should have received a copy of the GNU Lesser General  Public  License
18
   along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
1376 slepc 19
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20
*/
21
 
2283 jroman 22
#include <private/fortranimpl.h>
23
#include <slepcip.h>
1346 slepc 24
 
2320 jroman 25
#if defined(PETSC_HAVE_FORTRAN_CAPS)
1346 slepc 26
#define ipcreate_                 IPCREATE
2312 jroman 27
#define ipdestroy_                IPDESTROY
1346 slepc 28
#define ipsetoptionsprefix_       IPSETOPTIONSPREFIX
29
#define ipappendoptionsprefix_    IPAPPENDOPTIONSPREFIX
1518 slepc 30
#define ipgetoptionsprefix_       IGSETOPTIONSPREFIX
1346 slepc 31
#define ipgetorthogonalization_   IPGETORTHOGONALIZATION
32
#define ipview_                   IPVIEW
33
#define ipgetbilinarform_         IPGETBILINARFORM
34
#elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
35
#define ipcreate_                 ipcreate
2312 jroman 36
#define ipdestroy_                ipdestroy
1346 slepc 37
#define ipsetoptionsprefix_       ipsetoptionsprefix
38
#define ipappendoptionsprefix_    ipappendoptionsprefix
1518 slepc 39
#define ipgetoptionsprefix_       ipgetoptionsprefix
1346 slepc 40
#define ipgetorthogonalization_   ipgetorthogonalization
41
#define ipview_                   ipview
42
#define ipgetbilinarform_         ipgetbilinarform
43
#endif
44
 
45
EXTERN_C_BEGIN
46
 
1362 slepc 47
void PETSC_STDCALL ipcreate_(MPI_Fint *comm,IP *newip,PetscErrorCode *ierr)
1346 slepc 48
{
49
  *ierr = IPCreate(MPI_Comm_f2c(*(comm)),newip);
50
}
51
 
2312 jroman 52
void PETSC_STDCALL ipdestroy_(IP *ip, PetscErrorCode *ierr)
53
{
54
  *ierr = IPDestroy(ip);
55
}
56
 
1346 slepc 57
void PETSC_STDCALL ipsetoptionsprefix_(IP *ip,CHAR prefix PETSC_MIXED_LEN(len),
58
                                       PetscErrorCode *ierr PETSC_END_LEN(len))
59
{
60
  char *t;
61
 
62
  FIXCHAR(prefix,len,t);
63
  *ierr = IPSetOptionsPrefix(*ip,t);
64
  FREECHAR(prefix,t);
65
}
66
 
67
void PETSC_STDCALL ipappendoptionsprefix_(IP *ip,CHAR prefix PETSC_MIXED_LEN(len),
68
                                          PetscErrorCode *ierr PETSC_END_LEN(len))
69
{
70
  char *t;
71
 
72
  FIXCHAR(prefix,len,t);
73
  *ierr = IPAppendOptionsPrefix(*ip,t);
74
  FREECHAR(prefix,t);
75
}
76
 
1518 slepc 77
void PETSC_STDCALL ipgetoptionsprefix_(IP *ip,CHAR prefix PETSC_MIXED_LEN(len),PetscErrorCode *ierr PETSC_END_LEN(len))
78
{
79
  const char *tname;
80
 
1847 antodo 81
  *ierr = IPGetOptionsPrefix(*ip,&tname); if (*ierr) return;
82
  *ierr = PetscStrncpy(prefix,tname,len);
1518 slepc 83
}
84
 
1514 slepc 85
void PETSC_STDCALL ipgetorthogonalization_(IP *ip,IPOrthogonalizationType *type,IPOrthogonalizationRefinementType *refinement,PetscReal *eta,PetscErrorCode *ierr)
1346 slepc 86
{
87
  *ierr = IPGetOrthogonalization(*ip,type,refinement,eta);
88
}
89
 
90
void PETSC_STDCALL ipview_(IP *ip,PetscViewer *viewer, PetscErrorCode *ierr)
91
{
92
  PetscViewer v;
93
  PetscPatchDefaultViewers_Fortran(viewer,v);
94
  *ierr = IPView(*ip,v);
95
}
96
 
97
void PETSC_STDCALL ipgetbilinarform_(IP *ip,Mat *mat,IPBilinearForm* form,PetscErrorCode *ierr)
98
{
99
  if (FORTRANNULLOBJECT(mat)) mat = PETSC_NULL;  
100
  *ierr = IPGetBilinearForm(*ip,mat,form);
101
}
102
 
103
EXTERN_C_END