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
4
   Copyright (c) 2002-2009, 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
 
1469 slepc 22
#include "private/fortranimpl.h"
1346 slepc 23
#include "slepcip.h"
24
 
25
#ifdef PETSC_HAVE_FORTRAN_CAPS
26
#define ipcreate_                 IPCREATE
27
#define ipsetoptionsprefix_       IPSETOPTIONSPREFIX
28
#define ipappendoptionsprefix_    IPAPPENDOPTIONSPREFIX
1518 slepc 29
#define ipgetoptionsprefix_       IGSETOPTIONSPREFIX
1346 slepc 30
#define ipgetorthogonalization_   IPGETORTHOGONALIZATION
31
#define ipview_                   IPVIEW
32
#define ipgetbilinarform_         IPGETBILINARFORM
33
#elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
34
#define ipcreate_                 ipcreate
35
#define ipsetoptionsprefix_       ipsetoptionsprefix
36
#define ipappendoptionsprefix_    ipappendoptionsprefix
1518 slepc 37
#define ipgetoptionsprefix_       ipgetoptionsprefix
1346 slepc 38
#define ipgetorthogonalization_   ipgetorthogonalization
39
#define ipview_                   ipview
40
#define ipgetbilinarform_         ipgetbilinarform
41
#endif
42
 
43
EXTERN_C_BEGIN
44
 
1362 slepc 45
void PETSC_STDCALL ipcreate_(MPI_Fint *comm,IP *newip,PetscErrorCode *ierr)
1346 slepc 46
{
47
  *ierr = IPCreate(MPI_Comm_f2c(*(comm)),newip);
48
}
49
 
50
void PETSC_STDCALL ipsetoptionsprefix_(IP *ip,CHAR prefix PETSC_MIXED_LEN(len),
51
                                       PetscErrorCode *ierr PETSC_END_LEN(len))
52
{
53
  char *t;
54
 
55
  FIXCHAR(prefix,len,t);
56
  *ierr = IPSetOptionsPrefix(*ip,t);
57
  FREECHAR(prefix,t);
58
}
59
 
60
void PETSC_STDCALL ipappendoptionsprefix_(IP *ip,CHAR prefix PETSC_MIXED_LEN(len),
61
                                          PetscErrorCode *ierr PETSC_END_LEN(len))
62
{
63
  char *t;
64
 
65
  FIXCHAR(prefix,len,t);
66
  *ierr = IPAppendOptionsPrefix(*ip,t);
67
  FREECHAR(prefix,t);
68
}
69
 
1518 slepc 70
void PETSC_STDCALL ipgetoptionsprefix_(IP *ip,CHAR prefix PETSC_MIXED_LEN(len),PetscErrorCode *ierr PETSC_END_LEN(len))
71
{
72
  const char *tname;
73
 
74
  *ierr = IPGetOptionsPrefix(*ip,&tname);
75
  *ierr = PetscStrncpy(prefix,tname,len); if (*ierr) return;
76
}
77
 
1514 slepc 78
void PETSC_STDCALL ipgetorthogonalization_(IP *ip,IPOrthogonalizationType *type,IPOrthogonalizationRefinementType *refinement,PetscReal *eta,PetscErrorCode *ierr)
1346 slepc 79
{
80
  *ierr = IPGetOrthogonalization(*ip,type,refinement,eta);
81
}
82
 
83
void PETSC_STDCALL ipview_(IP *ip,PetscViewer *viewer, PetscErrorCode *ierr)
84
{
85
  PetscViewer v;
86
  PetscPatchDefaultViewers_Fortran(viewer,v);
87
  *ierr = IPView(*ip,v);
88
}
89
 
90
void PETSC_STDCALL ipgetbilinarform_(IP *ip,Mat *mat,IPBilinearForm* form,PetscErrorCode *ierr)
91
{
92
  if (FORTRANNULLOBJECT(mat)) mat = PETSC_NULL;  
93
  *ierr = IPGetBilinearForm(*ip,mat,form);
94
}
95
 
96
EXTERN_C_END