Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SAMRAI::appu::VisMaterialsDataStrategy< DIM > Class Template Reference

Class VisMaterialsDataStrategy<DIM> is an abstract base class that defines an interface allowing an VisItDataWriter<DIM> object to generate plot files that contain material and species fractions, as well as state variables for individual materials. A concrete object of this type must be registered with the data writer in order to use materials or species with the data writer. The registration of the concrete object is done using the method setMaterialsDataWriter() from the VisItDataWriter class. VisIt requires that material fractions, species fractions, and material state variables be cell-centered. If they are not cell-centered in the simulation, it is the job of the relevant packing method to convert them to a cell-centered basis before packing them into the buffer. More...

#include <source/apputils/plotting/VisMaterialsDataStrategy.h>

Inheritance diagram for SAMRAI::appu::VisMaterialsDataStrategy< DIM >:

Inheritance graph
[legend]
List of all members.

Public Types

enum  PACK_RETURN_TYPE { VISIT_ALLZERO = 0, VISIT_ALLONE = 1, VISIT_MIXED = 2 }
 Enumerated type for the allowable return values for packMaterialFractionsIntoDoubleBuffer() and packSpeciesFractionsIntoDoubleBuffer().
  • ALL_ZERO (Fractions are 0.0 for every cell in patch.)
  • ALL_ONE (Fractions are 1.0 for every cell in patch.)
  • MIXTURE (There is some of this species/material in one or more cells of this patch, but the above two cases do not apply.).
More...

Public Member Functions

 VisMaterialsDataStrategy ()
 Default constructor for VisMaterialsDataStrategy<DIM>.
virtual ~VisMaterialsDataStrategy ()
 Destructor for VisMaterialsDataStrategy<DIM>.
virtual int packMaterialFractionsIntoDoubleBuffer (double *buffer, const hier::Patch< DIM > &patch, const hier::Box< DIM > &region, const string &material_name)
 This function, which must be implemented whenever materials are used, packs cell-centered material fractions for the given material, patch, and region into the given 1D double precision buffer which will already have been allocated. If a non-zero ghost cell vector was specified when registerMaterialNames() was invoked, then ghost data corresponding to this ghost cell vector must be packed into this double buffer. The data must be packed into the buffer in column major order, i.e. (f(x_0,y_0,z_0), f(x_1,y_0,z_0), f(x_2,y_0,z_0), ...).
virtual int packSpeciesFractionsIntoDoubleBuffer (double *buffer, const hier::Patch< DIM > &patch, const hier::Box< DIM > &region, const string &material_name, const string &species_name)
 This function packs cell-centered species fractions for the given species.

Detailed Description

template<int DIM>
class SAMRAI::appu::VisMaterialsDataStrategy< DIM >

Class VisMaterialsDataStrategy<DIM> is an abstract base class that defines an interface allowing an VisItDataWriter<DIM> object to generate plot files that contain material and species fractions, as well as state variables for individual materials. A concrete object of this type must be registered with the data writer in order to use materials or species with the data writer. The registration of the concrete object is done using the method setMaterialsDataWriter() from the VisItDataWriter class. VisIt requires that material fractions, species fractions, and material state variables be cell-centered. If they are not cell-centered in the simulation, it is the job of the relevant packing method to convert them to a cell-centered basis before packing them into the buffer.

The concrete strategy object is responsible for supplying an implementation of packMaterialFractionsIntoDoubleBuffer(). If species are used, packSpeciesFractionsIntoDoubleBuffer() must also be implemented. If material state variables are used, packMaterialStateVariableIntoDoubleBuffer() must be implemented.

See also:
appu::VisItDataWriter


Member Enumeration Documentation

template<int DIM>
enum SAMRAI::appu::VisMaterialsDataStrategy::PACK_RETURN_TYPE
 

Enumerated type for the allowable return values for packMaterialFractionsIntoDoubleBuffer() and packSpeciesFractionsIntoDoubleBuffer().

  • ALL_ZERO (Fractions are 0.0 for every cell in patch.)
  • ALL_ONE (Fractions are 1.0 for every cell in patch.)
  • MIXTURE (There is some of this species/material in one or more cells of this patch, but the above two cases do not apply.).

Enumeration values:
VISIT_ALLZERO 
VISIT_ALLONE 
VISIT_MIXED 


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::appu::VisMaterialsDataStrategy< DIM >::VisMaterialsDataStrategy  ) 
 

Default constructor for VisMaterialsDataStrategy<DIM>.

template<int DIM>
SAMRAI::appu::VisMaterialsDataStrategy< DIM >::~VisMaterialsDataStrategy  )  [virtual]
 

Destructor for VisMaterialsDataStrategy<DIM>.


Member Function Documentation

template<int DIM>
int SAMRAI::appu::VisMaterialsDataStrategy< DIM >::packMaterialFractionsIntoDoubleBuffer double *  buffer,
const hier::Patch< DIM > &  patch,
const hier::Box< DIM > &  region,
const string &  material_name
[virtual]
 

This function, which must be implemented whenever materials are used, packs cell-centered material fractions for the given material, patch, and region into the given 1D double precision buffer which will already have been allocated. If a non-zero ghost cell vector was specified when registerMaterialNames() was invoked, then ghost data corresponding to this ghost cell vector must be packed into this double buffer. The data must be packed into the buffer in column major order, i.e. (f(x_0,y_0,z_0), f(x_1,y_0,z_0), f(x_2,y_0,z_0), ...).

This method will be called once for each material for each patch.

A enumerated PACK_RETURN_TYPE is used for a return value. To save space in the visit data file, you may choose to set the return value to indicate if a material does not exist at all on the patch, or if the material exists fully on the patch. A return of ALL_ZERO indicates there is 0% of the material in each of the cells of the patch, while a return type of ALL_ONE indicates the material consumes 100% on each of the cells of the patch. If the patch has a mixture of the material (i.e. between 0% and 100%) then return MIXTURE.

Parameters:
buffer Double precision array into which cell-centered material fractions are packed.
patch hier::Patch on which fractions are defined.
region hier::Box region over which to pack fractions.
material_name String identifier for the material.
Returns:
The enumeration constant VisMaterialsDataStrategy::ALL_ZERO, VisMaterialsDataStrategy::ALL_ONE, or VisMaterialsDataStrategy::MIXTURE.

Reimplemented in SAMRAI::appu::EmbeddedBoundaryGeometry< DIM >.

template<int DIM>
int SAMRAI::appu::VisMaterialsDataStrategy< DIM >::packSpeciesFractionsIntoDoubleBuffer double *  buffer,
const hier::Patch< DIM > &  patch,
const hier::Box< DIM > &  region,
const string &  material_name,
const string &  species_name
[virtual]
 

This function packs cell-centered species fractions for the given species.

This user supplied function packs species fractions of the given material, patch, and region into the supplied 1D double precision buffer. If a non-zero ghost cell vector was specified when registerSpeciesNames() was invoked, then ghost data corresponding to this ghost cell vector must be packed into this double buffer. The data must be packed into the buffer in column major order.

This method will be called once for each species for each patch.

The method must return a PACK_RETURN_TYPE of ALL_ONE, ALL_ZERO, or MIXED. See the discussion above for the "packMaterialFractionsIntoDoubleBuffer()" method for an explanation of correct return values.

Parameters:
buffer Double precision array into which cell-centered species fractions are packed.
patch hier::Patch on which fractions are defined.
region hier::Box region over which to pack fractions.
material_name String identifier for the material to which the species belongs.
species_name String identifier for the species.
Returns:
The enumeration constant VisMaterialsDataStrategy::ALL_ZERO, VisMaterialsDataStrategy::ALL_ONE, or VisMaterialsDataStrategy::MIXTURE.


The documentation for this class was generated from the following files:
Generated on Fri Dec 2 11:23:41 2005 for SAMRAI by  doxygen 1.4.2