obj | - the PETSc object; this must be cast with a (PetscObject), for example, PetscObjectCompose((PetscObject) mat,...); |
name | - name associated with child object |
fname | - name of the function |
ptr | - function pointer (or PETSC_NULL if using dynamic libraries) |
PetscFunctionBegin; ierr = (*obj->bops->composefunction)(obj,name,fname,ptr);CHKERRQ(ierr); PetscFunctionReturn(0); }
#undef __FUNC__#define __FUNC__ "PetscObjectQueryFunction" /*@ CPetscObjectQueryFunction - Gets a function associated with a given object. Collective on PetscObject
obj | - the PETSc object Thus must be cast with a (PetscObject), for example, PetscObjectCompose((PetscObject) mat,...); |
name | - name associated with childfunction |
PetscFunctionBegin; ierr = (*obj->bops->queryfunction)(obj,name,ptr);CHKERRQ(ierr); PetscFunctionReturn(0); }
/* -------------------------------------------------------------------------------------*/
#undef __FUNC__#define __FUNC__ "PetscDataTypeToMPIDataType" int PetscDataTypeToMPIDataType(PetscDataType ptype,MPI_Datatype* mtype) { PetscFunctionBegin; if (ptype == PETSC_INT) { *mtype = MPI_INT; } else if (ptype == PETSC_DOUBLE) { *mtype = MPI_DOUBLE; } else if (ptype == PETSC_SCALAR) { *mtype = MPIU_SCALAR; #if defined(USE_PETSC_COMPLEX) } else if (ptype == PETSC_COMPLEX) { *mtype = MPIU_COMPLEX; # endif} else if (ptype == PETSC_CHAR) { *mtype = MPI_CHAR; } else if (ptype == PETSC_LOGICAL) { *mtype = MPI_BYTE; } else { SETERRQ(PETSC_ERR_ARG_OUTOFRANGE,1,"Unknown PETSc datatype"); } PetscFunctionReturn(0); }
#undef __FUNC__#define __FUNC__ "PetscDataTypeGetSize" int PetscDataTypeGetSize(PetscDataType ptype,int *size) { PetscFunctionBegin; if (ptype == PETSC_INT) { *size = PETSC_INT_SIZE; } else if (ptype == PETSC_DOUBLE) { *size = PETSC_DOUBLE_SIZE; } else if (ptype == PETSC_SCALAR) { *size = PETSC_SCALAR_SIZE; #if defined(USE_PETSC_COMPLEX) } else if (ptype == PETSC_COMPLEX) { *size = PETSC_COMPLEX_SIZE; # endif} else if (ptype == PETSC_CHAR) { *size = PETSC_CHAR_SIZE; } else if (ptype == PETSC_LOGICAL) { *size = PETSC_LOGICAL_SIZE; } else { SETERRQ(PETSC_ERR_ARG_OUTOFRANGE,1,"Unknown PETSc datatype"); } PetscFunctionReturn(0); }
#undef __FUNC__#define __FUNC__ "PetscDataTypeGetName" int PetscDataTypeGetName(PetscDataType ptype,char **name) { PetscFunctionBegin; if (ptype == PETSC_INT) { *name = "int"; } else if (ptype == PETSC_DOUBLE) { *name = "double"; } else if (ptype == PETSC_SCALAR) { *name = "Scalar"; #if defined(USE_PETSC_COMPLEX) } else if (ptype == PETSC_COMPLEX) { *name = "complex"; # endif} else if (ptype == PETSC_CHAR) { *name = "char"; } else if (ptype == PETSC_LOGICAL) { *name = "logical"; } else { SETERRQ(PETSC_ERR_ARG_OUTOFRANGE,1,"Unknown PETSc datatype"); } PetscFunctionReturn(0); }
struct _p_PetscObjectContainer { PETSCHEADER(int) void *ptr; };
#undef __FUNC__#define __FUNC__ "PetscObjectContainerGetPointer" /*@ CPetscObjectContainerGetPointer - Gets the pointer value contained in the container.
Collective on PetscObjectContainer
#undef __FUNC__#define __FUNC__ "PetscObjectContainerSetPointer" /*@ CPetscObjectContainerSetPointer - Sets the pointer value contained in the container.
Collective on PetscObjectContainer
obj | - the object created with PetscObjectContainerCreate() |
ptr | - the pointer value |
#undef __FUNC__#define __FUNC__ "PetscObjectContainerDestroy" /*@ CPetscObjectContainerDestroy - Destroys a PETSc container object.
Collective on PetscObjectContainer
#undef __FUNC__#define __FUNC__ "PetscObjectContainerDestroy" /*@ CPetscObjectContainerCreate - Creates a PETSc object that has room to holda single pointer. This allows one to attach any type of data ( accessiblethrough a pointer) with the PetscObjectCompose() function to a PetscObject.
Collective on MPI_Comm
PetscFunctionBegin;
PetscHeaderCreate(contain, _p_PetscObjectContainer,int,PETSC_COOKIE,0,comm, PetscObjectContainerDestroy,0); *container = contain; PetscFunctionReturn(0); }
Location: src/sys/src/objectsinherit.c
System Index
Table of Contents