Skip to content

Commit

Permalink
Add VecDohpGetFS()
Browse files Browse the repository at this point in the history
  • Loading branch information
jedbrown committed Jun 17, 2011
1 parent 12ec27f commit ac4d9ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/dohpfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ extern dErr dFSGetNodalCoordinatesExpanded(dFS,Vec*);
extern dErr dFSGetNodalCoordinatesGlobal(dFS,Vec*);

extern dErr dFSRedimension(dFS,dInt,dFSClosureMode,dFS*);
extern dErr VecDohpGetFS(Vec,dFS*);

/* The normal MatAXPY() does not work for arguments of mixed type, so we redeclare this "private" function here. */
extern PetscErrorCode MatAXPY_Basic(Mat Y,PetscScalar a,Mat X,MatStructure str);
Expand Down
15 changes: 15 additions & 0 deletions src/fs/interface/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,3 +885,18 @@ dErr dFSMatSetValuesBlockedExpanded(dFS fs,Mat A,dInt m,const dInt idxm[],dInt n
#endif
dFunctionReturn(0);
}

// Retrieve the FS composed with a VecDohp, return NULL if there is none
dErr VecDohpGetFS(Vec X,dFS *fs)
{
dErr err;
dBool isdohp;

dFunctionBegin;
dValidHeader(X,VEC_CLASSID,1);
dValidPointer(fs,2);
err = PetscTypeCompare((PetscObject)X,VECDOHP,&isdohp);dCHK(err);
if (!isdohp) dERROR(((PetscObject)X)->comm,PETSC_ERR_ARG_WRONG,"Vector is not of type DOHP");
err = PetscObjectQuery((PetscObject)X,"dFS",(PetscObject*)fs);dCHK(err);
dFunctionReturn(0);
}

0 comments on commit ac4d9ba

Please sign in to comment.