Xdmf3 Fortran API

From XdmfWeb
Revision as of 18:44, 7 November 2014 by Burns (talk | contribs) (Created page with "Image:XdmfLogo1.gif __TOC__ ==XDMF API== The Fortran interface for Xdmf has a vastly different workflow from the C++ API. The C++ API workflow starts from the root of a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

XdmfLogo1.gif

XDMF API

The Fortran interface for Xdmf has a vastly different workflow from the C++ API. The C++ API workflow starts from the root of a tree and builds up to the leaves. The workflow for XdmfFortran starts at the leaves and collapses down to the root.

After including Xdmf.f, the first thing that needs to occur is a call to XDMFINIT in order to set up the base root of the Xdmf tree, an object of the type XdmfDomain.

 CALL XDMFINIT(obj, filename)

The location of the interface object is stored in obj. This obj variable is then passed to most calls to the Xdmf Interface to interact with the root and the objects that are being generated to be added to the root.

XdmfGridCollections

After setting up the base root, any grid collections added using XDMFADDGRIDCOLLECTION are added to the current root. After being added to the root, the grid collection is placed on top of the stack and take the place of the root they were added to.

Xdmf API Grid Collection Stack:

Domain <-- top of stack

Add a Grid Collection to the tree:

! Adding a Grid Collection named "Grid Collection" 
  CALL XDMFADDGRIDCOLLECTION(obj, "Grid Collection"//CHAR(0), &
       XDMF_GRID_COLLECTION_TYPE_TEMPORAL)

Xdmf API Grid Collection Stack:

Grid Collection <-- top of stack
Domain

Another Grid Collection is added:

! Adding a Grid Collection named "Grid Collection2" 
  CALL XDMFADDGRIDCOLLECTION(obj, "Grid Collection2"//CHAR(0), &
       XDMF_GRID_COLLECTION_TYPE_TEMPORAL)

Xdmf API Grid Collection Stack:

Grid Collection2 <-- top of stack
Grid Collection
Domain

Calling XDMFCLOSEGRIDCOLLECTION removes a grid collection from the top of the stack. It is still connected to the grid collection below it (what is at the top of the stack after the call) and may be added back to the top of the stack using XDMFOPENDOMAINGRIDCOLLECTION.

Xdmf API Grid Collection Stack:

Grid Collection2 <-- top of stack
Grid Collection
Domain

Remove a Grid Collection from the top of the stack:

  CALL XDMFCLOSEGRIDCOLLECTION(obj, .TRUE.)

Xdmf API Grid Collection Stack:

Grid Collection <-- top of stack
Domain

Returning a Grid Collection to the stack adds it to the top:

! Returning the Grid Collection contained in the domain at position 0 to the stack

 CALL XDMFOPENDOMAINGRIDCOLLECTION(obj, 0, 1, 1, 1, 1)

Xdmf API Grid Collection Stack:

Grid Collection2 <-- top of stack
Grid Collection
Domain

In order to add multiple grid collections to the same root XDMFCLOSEGRIDCOLLECTION must be called to remove the child from the stack before the new grid collection can be added.

Xdmf Tree represents the underlying Xml tree and c++ object structure created by the calls.

CALL XDMFINIT(obj, filename)

Xdmf API Grid Collection Stack:

Domain <-- top of stack

Xdmf Tree:

Domain
! Adding a Grid Collection named "Grid Collection" 
  CALL XDMFADDGRIDCOLLECTION(obj, "Grid Collection"//CHAR(0), &
       XDMF_GRID_COLLECTION_TYPE_TEMPORAL)

Xdmf API Grid Collection Stack:

Grid Collection <-- top of stack
Domain

Xdmf Tree:

Domain
|->Grid Collection

! Adding a Grid Collection named "Grid Collection2"

 CALL XDMFADDGRIDCOLLECTION(obj, "Grid Collection2"//CHAR(0), &
      XDMF_GRID_COLLECTION_TYPE_TEMPORAL)

Xdmf API Grid Collection Stack:

Grid Collection2 <-- top of stack
Grid Collection
Domain

Xdmf Tree

Domain
|->Grid Collection
   |->Grid Collection2

! Removing the grid Collection from the top of the stack.

 CALL XDMFCLOSEGRIDCOLLECTION(obj, .TRUE.)

Xdmf API Grid Collection Stack:

Grid Collection <-- top of stack
Domain

Xdmf Tree:

Domain
|->Grid Collection
   |->Grid Collection2
! Adding a Grid Collection named "Grid Collection3" 
  CALL XDMFADDGRIDCOLLECTION(obj, "Grid Collection3"//CHAR(0), &
       XDMF_GRID_COLLECTION_TYPE_TEMPORAL)

Xdmf API Grid Collection Stack:

Grid Collection3 <-- top of stack
Grid Collection
Domain

Xdmf Tree:

Domain
|->Grid Collection
   |->Grid Collection2
   |->Grid Collection3