~fluidity-core/fluidity/refactor-netcdf

« back to all changes in this revision

Viewing changes to femtools/ISCopyIndices.cpp

  • Committer: Jon Hill
  • Date: 2013-02-16 09:01:40 UTC
  • mfrom: (3981.7.159 fluidity)
  • Revision ID: jon.hill@imperial.ac.uk-20130216090140-bplzxqzdk1eik4za
Megre from trunk, fixing several conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
extern "C" {
11
11
  void iscopyindices_(IS *is, PetscInt *iarray,PetscErrorCode *ierr);
12
12
  void petscobjectreference_(PetscObject obj, int *__ierr );
 
13
  void pcfieldsplitgetsubksp_(PC *pc, KSP subksps[], int *__ierr);
13
14
}
14
15
 
15
16
// our own version of IsGetIndices, that just does a copy
56
57
*__ierr = PetscObjectReference(
57
58
   (PetscObject)PetscToPointer((obj) ));
58
59
}
 
60
 
 
61
// PCFieldSplitGetSubKSP()
 
62
// Again, missing from petsc fortrarn interface (sigh)
 
63
// Also, work around clumsy allocated subksps array that is returned
 
64
// by assuming we know how many ksp there are
 
65
void pcfieldsplitgetsubksp_(PC *pc, KSP subksps[], int *__ierr){
 
66
  KSP *temp_subksps;
 
67
  PetscInt nsubksps;
 
68
  *__ierr = PCFieldSplitGetSubKSP(*pc, &nsubksps, &temp_subksps);
 
69
  for (int i=0; i<nsubksps; i++) {
 
70
    subksps[i]=temp_subksps[i];
 
71
  }
 
72
  PetscFree(temp_subksps);
 
73
}