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

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

Class VisDerivedDataStrategy<DIM> is an abstract base class that defines an interface allowing an VisItDataWriter<DIM> object and/or an CartesianVizamraiDataWriter<DIM> object to generate plot files that contain "derived" quantities; that is, data that does not reside on the hierarchy, but which is derived from data that does reside on the hierarchy. The derived data may be scalar, vector, or tensor (VisIt only), and cell-centered or node-centered (VisIt only). A concrete object of this type must be registered with the data writer if any derived variable is registered with the data writer. The registration of the concrete strategy object may be done independently using the method setDerivedDataWriter() (Vizamrai only) or setDefaultDerivedDataWriter() (VisIt only) from the relevant DataWriter class, or the concrete strategy object may be registered concurrently with the derived variable using the method registerDerivedPlotScalar/Vector/Tensor(). More...

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

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

 VisDerivedDataStrategy ()
 Default constructor for VisDerivedDataStrategy<DIM>.
virtual ~VisDerivedDataStrategy ()
 Destructor for VisDerivedDataStrategy<DIM>.
virtual bool packDerivedDataIntoDoubleBuffer (double *buffer, const hier::Patch< DIM > &patch, const hier::Box< DIM > &region, const string &variable_name, int depth_index)=0
 This function calculates and packs derived cell-centered data to a 1D double precision buffer. In the case of the VisIt data writer, node-centered data may also be used. It is called once for each component of multicomponent data.

Detailed Description

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

Class VisDerivedDataStrategy<DIM> is an abstract base class that defines an interface allowing an VisItDataWriter<DIM> object and/or an CartesianVizamraiDataWriter<DIM> object to generate plot files that contain "derived" quantities; that is, data that does not reside on the hierarchy, but which is derived from data that does reside on the hierarchy. The derived data may be scalar, vector, or tensor (VisIt only), and cell-centered or node-centered (VisIt only). A concrete object of this type must be registered with the data writer if any derived variable is registered with the data writer. The registration of the concrete strategy object may be done independently using the method setDerivedDataWriter() (Vizamrai only) or setDefaultDerivedDataWriter() (VisIt only) from the relevant DataWriter class, or the concrete strategy object may be registered concurrently with the derived variable using the method registerDerivedPlotScalar/Vector/Tensor().

The concrete strategy object is responsible for supplying an implementation of the function packDerivedDataIntoDoubleBuffer() which calculates the derived data and writes it into the double precision buffer passed in to it.

This class is shared by both VisDataWriter<DIM> and CartesianVizamraiDataWriter<DIM>.

See also:
appu::VisItDataWriter


Constructor & Destructor Documentation

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

Default constructor for VisDerivedDataStrategy<DIM>.

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

Destructor for VisDerivedDataStrategy<DIM>.


Member Function Documentation

template<int DIM>
virtual bool SAMRAI::appu::VisDerivedDataStrategy< DIM >::packDerivedDataIntoDoubleBuffer double *  buffer,
const hier::Patch< DIM > &  patch,
const hier::Box< DIM > &  region,
const string &  variable_name,
int  depth_index
[pure virtual]
 

This function calculates and packs derived cell-centered data to a 1D double precision buffer. In the case of the VisIt data writer, node-centered data may also be used. It is called once for each component of multicomponent data.

The buffer will be already allocated. This routine is needed to construct data values that are not stored on the hierarchy, but which may be important to visualize. The data to be packed corresponds to the plot variable that the user has registered with the data writer using registerDerivedPlotScalar/Vector/Tensor() with the string "variable_name". The data to be packed is derived from the data that lives on the given patch. The box describes the patch region over which to pack the data. It is assumed that all data needed to compute the derived quantity exists on the given patch.

The method packDerivedDataIntoDoubleBuffer() will be called DIM times for vector data, and DIM*DIM times for tensor data, with the integer "depth_index" argument indicating the particular component of vector to be packed. For scalar values, the depth_index will be 0.

This routine must include ghost data if the ghost_cell_width parameter was set when the derived data was registered. The data must be packed into the buffer in column major order, the ordering used by SAMRAI, i.e. (f(x_0,y_0,z_0), f(x_1,y_0,z_0), f(x_2,y_0,z_0), ...). If the derived data was registered as node-centered, a buffer of node-centered data is expected. Derived data need not be defined on all patches. It is the responsibility of this routine to determine if data exists on the patch and set the return value of of this routine appropriately: true if the data exists on the patch, false otherwise.

Parameters:
buffer Double precision array into which derived data is packed.
patch hier::Patch on which to calculate and pack derived data.
region hier::Box region over which to pack data.
variable_name Name identifier for the derived variable as registered in registerDerivedPlotScalar/Vector/Tensor().
depth_index For scalar quantities index will be zero. For vector data, index varies between 0 and DIM-1. For tensor data, index varies from 0 (DIM*DIM)-1.
Returns:
Boolean value indicating if derived data defined on this patch.


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