コード例 #1
0
ファイル: mathematica.c プロジェクト: pombredanne/petsc
PETSC_EXTERN PetscErrorCode PetscViewerCreate_Mathematica(PetscViewer v)
{
    PetscViewer_Mathematica *vmath;
    PetscErrorCode          ierr;

    PetscFunctionBegin;
    ierr = PetscViewerMathematicaInitializePackage();
    CHKERRQ(ierr);

    ierr            = PetscNewLog(v,&vmath);
    CHKERRQ(ierr);
    v->data         = (void*) vmath;
    v->ops->destroy = PetscViewerDestroy_Mathematica;
    v->ops->flush   = 0;
    ierr            = PetscStrallocpy(PETSC_VIEWER_MATHEMATICA, &((PetscObject)v)->type_name);
    CHKERRQ(ierr);

    vmath->linkname     = NULL;
    vmath->linkhost     = NULL;
    vmath->linkmode     = MATHEMATICA_LINK_CONNECT;
    vmath->graphicsType = GRAPHICS_MOTIF;
    vmath->plotType     = MATHEMATICA_TRIANGULATION_PLOT;
    vmath->objName      = NULL;

    ierr = PetscViewerMathematicaSetFromOptions(v);
    CHKERRQ(ierr);
    ierr = PetscViewerMathematicaSetupConnection_Private(v);
    CHKERRQ(ierr);
    PetscFunctionReturn(0);
}
コード例 #2
0
ファイル: view.c プロジェクト: masa-ito/PETScToPoisson
/*@C
  PetscViewerInitializePackage - This function initializes everything in the main PetscViewer package.

  Level: developer

.keywords: Petsc, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode  PetscViewerInitializePackage(void)
{
  char           logList[256];
  char           *className;
  PetscBool      opt;
  PetscErrorCode ierr;

  PetscFunctionBegin;
  if (PetscViewerPackageInitialized) PetscFunctionReturn(0);
  PetscViewerPackageInitialized = PETSC_TRUE;
  /* Register Classes */
  ierr = PetscClassIdRegister("Viewer",&PETSC_VIEWER_CLASSID);CHKERRQ(ierr);

  /* Register Constructors */
  ierr = PetscViewerRegisterAll();CHKERRQ(ierr);

  /* Process info exclusions */
  ierr = PetscOptionsGetString(NULL,NULL, "-info_exclude", logList, 256, &opt);CHKERRQ(ierr);
  if (opt) {
    ierr = PetscStrstr(logList, "viewer", &className);CHKERRQ(ierr);
    if (className) {
      ierr = PetscInfoDeactivateClass(0);CHKERRQ(ierr);
    }
  }
  /* Process summary exclusions */
  ierr = PetscOptionsGetString(NULL,NULL, "-log_exclude", logList, 256, &opt);CHKERRQ(ierr);
  if (opt) {
    ierr = PetscStrstr(logList, "viewer", &className);CHKERRQ(ierr);
    if (className) {
      ierr = PetscLogEventDeactivateClass(0);CHKERRQ(ierr);
    }
  }
#if defined(PETSC_HAVE_MATHEMATICA)
  ierr = PetscViewerMathematicaInitializePackage();CHKERRQ(ierr);
#endif
  ierr = PetscRegisterFinalize(PetscViewerFinalizePackage);CHKERRQ(ierr);
  PetscFunctionReturn(0);
}