DataC.cpp File Reference

#include "DataC.h"
#include "Data.h"
#include "DataTypes.h"

Functions

int getFunctionSpaceType (struct escriptDataC *data)
 Return the function space type code.
int isDataPointShapeEqual (struct escriptDataC *data, int rank, int *dimensions)
 Return true if the input shape matches the data point shape for data.
int getNumDataPointsPerSample (struct escriptDataC *data)
 Returns the number of data points per sample.
int numSamplesEqual (struct escriptDataC *data, int numDataPointsPerSample, int numSamples)
 Return true if the number of data points per sample and the number of samples equal the input values. In the case that data is empty or NULL, true is returned.
int getDataPointRank (struct escriptDataC *data)
 Returns the rank of the point data for the data.
int getDataPointShape (struct escriptDataC *data, int i)
 Returns the value of the i-th component of the shape of the point data.
int getDataPointSize (struct escriptDataC *data)
 Return the number of doubles needed for each data point.
int getLength (struct escriptDataC *data)
int isExpanded (struct escriptDataC *data)
 Return true if data can be treated as expanded.
int isEmpty (escriptDataC *data)
 Returns the true if the data are empty or data is NULL.
double const * getSampleDataRO (struct escriptDataC *data, int sampleNo, void *buffer)
 Return a pointer to the data for the given sample number. if data is empty NULL is returned. data may be NULL, in which case NULL is returnd.
double * getSampleDataRW (struct escriptDataC *data, int sampleNo)
const double * getSampleDataROFast (struct escriptDataC *data, int sampleNo, void *buffer)
 Return a pointer to the data for the given sample number. Fast version of getSampledataRO: does no error checking.
double * getSampleDataRWFast (struct escriptDataC *data, int sampleNo)
 Return a pointer to the data for the given sample number. Fast version of getSampledataRW: does no error checking.
double * getDataRW (escriptDataC *data)
 Return getSampleDataRWFast(escriptDataC* data, 0) if there are samples. if not, returns NULL.
void * allocSampleBuffer (escriptDataC *data)
 Create a buffer for use by getSample Allocates a DataVector large enough for DataLazy::resolveSample to operate on for the current Data. Do not use this buffer for other DataC instances (unless you are sure they will be the same size).
void freeSampleBuffer (void *buffer)
 Free a buffer allocated with allocSampleBuffer.
void requireWrite (escriptDataC *data)
 Ensure that this object is ready for writing. It will be resolved and copied if it is currently shared. Use only in single threaded sections of code. Do not create new Data objects based on this one between this call and writing to the object.

Function Documentation

void* allocSampleBuffer ( escriptDataC data  ) 

Create a buffer for use by getSample Allocates a DataVector large enough for DataLazy::resolveSample to operate on for the current Data. Do not use this buffer for other DataC instances (unless you are sure they will be the same size).

In multi-threaded sections, this needs to be called for each thread.

Returns:
A DataVector* if Data is not-NULL and lazy, NULL otherwise.
Warning:
This pointer must be deallocated using freeSampleBuffer to avoid cross library memory issues.
Parameters:
data Input - C wrapper for Data.

References escript::Data::allocSampleBuffer(), and escriptDataC::m_dataPtr.

Referenced by Finley_Assemble_AverageElementData(), Finley_Assemble_CopyElementData(), Finley_Assemble_CopyNodalData(), Finley_Assemble_gradient(), Finley_Assemble_integrate(), Finley_Assemble_interpolate(), Finley_Assemble_LumpedSystem(), Finley_Assemble_PDE_Single2_1D(), Finley_Assemble_PDE_Single2_2D(), Finley_Assemble_PDE_Single2_3D(), Finley_Assemble_PDE_Single2_C(), Finley_Assemble_PDE_System2_1D(), Finley_Assemble_PDE_System2_2D(), Finley_Assemble_PDE_System2_3D(), Finley_Assemble_PDE_System2_C(), Finley_ElementFile_setTags(), Finley_Mesh_saveDX(), Finley_Mesh_saveVTK(), Finley_NodeFile_setCoordinates(), and Finley_NodeFile_setTags().

void freeSampleBuffer ( void *  buffer  ) 

int getDataPointRank ( escriptDataC data  ) 

Returns the rank of the point data for the data.

Parameters:
data Input - C wrapper for Data.

References escript::Data::getDataPointRank(), and escriptDataC::m_dataPtr.

Referenced by Finley_Mesh_saveDX(), and Finley_Mesh_saveVTK().

int getDataPointShape ( escriptDataC data,
int  i 
)

Returns the value of the i-th component of the shape of the point data.

Parameters:
data Input - C wrapper for Data.
i Input - index of shape component.

References escript::Data::getDataPointRank(), escript::Data::getDataPointShape(), and escriptDataC::m_dataPtr.

Referenced by Finley_Mesh_saveDX(), and Finley_Mesh_saveVTK().

int getDataPointSize ( escriptDataC data  ) 

double* getDataRW ( escriptDataC data  ) 

Return getSampleDataRWFast(escriptDataC* data, 0) if there are samples. if not, returns NULL.

Warning:
This function calls requireWrite if there are samples so do not use in parallel sections.

Please do not use this in new code.

Parameters:
data Input - C wrapper for Data.

References escript::Data::getNumSamples(), getSampleDataRWFast(), escriptDataC::m_dataPtr, and requireWrite().

Referenced by Finley_Assemble_CopyNodalData().

int getFunctionSpaceType ( escriptDataC data  ) 

int getLength ( struct escriptDataC data  ) 

int getNumDataPointsPerSample ( escriptDataC data  ) 

Returns the number of data points per sample.

Parameters:
data Input - C wrapper for Data.

References escript::Data::getNumDataPointsPerSample(), escript::Data::isEmpty(), and escriptDataC::m_dataPtr.

Referenced by Finley_Mesh_saveVTK().

double const* getSampleDataRO ( escriptDataC data,
int  sampleNo,
void *  buffer 
)

Return a pointer to the data for the given sample number. if data is empty NULL is returned. data may be NULL, in which case NULL is returnd.

Parameters:
data Input - C wrapper for Data.
sampleNo Input - The sample number.
buffer - storage to be used when computing the value of the sample.
Buffers can be created and freed using the allocSampleBuffer and freeSampleBuffer calls.

References escript::Data::getSampleDataRO(), escript::Data::isEmpty(), and escriptDataC::m_dataPtr.

Referenced by Finley_Assemble_AverageElementData(), Finley_Assemble_CopyElementData(), Finley_Assemble_gradient(), Finley_Assemble_integrate(), Finley_Assemble_interpolate(), Finley_Assemble_LumpedSystem(), Finley_Assemble_PDE_Single2_1D(), Finley_Assemble_PDE_Single2_2D(), Finley_Assemble_PDE_Single2_3D(), Finley_Assemble_PDE_Single2_C(), Finley_Assemble_PDE_System2_1D(), Finley_Assemble_PDE_System2_2D(), Finley_Assemble_PDE_System2_3D(), Finley_Assemble_PDE_System2_C(), Finley_ElementFile_setTags(), Finley_Mesh_saveDX(), Finley_Mesh_saveVTK(), and Finley_NodeFile_setTags().

const double* getSampleDataROFast ( escriptDataC data,
int  sampleNo,
void *  buffer 
)

Return a pointer to the data for the given sample number. Fast version of getSampledataRO: does no error checking.

Parameters:
data Input - C wrapper for Data.
sampleNo Input - The sample number.
buffer - storage to be used when computing the value of the sample.
Buffers can be created and freed using the allocSampleBuffer and freeSampleBuffer calls.

References escript::Data::getSampleDataRO(), and escriptDataC::m_dataPtr.

Referenced by Finley_Assemble_CopyNodalData(), and Finley_NodeFile_setCoordinates().

double* getSampleDataRW ( struct escriptDataC data,
int  sampleNo 
)

double* getSampleDataRWFast ( escriptDataC data,
int  sampleNo 
)

Return a pointer to the data for the given sample number. Fast version of getSampledataRW: does no error checking.

Parameters:
data Input - C wrapper for Data.
sampleNo Input - The sample number.

References escript::Data::getSampleDataRW(), and escriptDataC::m_dataPtr.

Referenced by Finley_Assemble_CopyNodalData(), Finley_Assemble_NodeCoordinates(), and getDataRW().

int isDataPointShapeEqual ( escriptDataC data,
int  rank,
int *  dimensions 
)

Return true if the input shape matches the data point shape for data.

Parameters:
data Input - C wrapper for Data.
rank Input - number of dimensions.
dimensions Input -

References escript::Data::getDataPointShape(), escript::Data::isEmpty(), and escriptDataC::m_dataPtr.

Referenced by Finley_Assemble_getSize(), Finley_Assemble_LumpedSystem(), Finley_Assemble_NodeCoordinates(), Finley_Assemble_PDE(), and Finley_Assemble_setNormal().

int isEmpty ( escriptDataC data  ) 

Returns the true if the data are empty or data is NULL.

Parameters:
data Input - C wrapper for Data.

References escript::Data::isEmpty(), and escriptDataC::m_dataPtr.

Referenced by Assemble_getAssembleParameters(), Finley_Assemble_LumpedSystem(), Finley_Assemble_PDE(), Finley_Mesh_saveDX(), and Finley_Mesh_saveVTK().

int isExpanded ( escriptDataC data  ) 

int numSamplesEqual ( escriptDataC data,
int  numDataPointsPerSample,
int  numSamples 
)

Return true if the number of data points per sample and the number of samples equal the input values. In the case that data is empty or NULL, true is returned.

Parameters:
data Input - C wrapper for Data.
numDataPointsPerSample Input - number of data points per sample
numSamples Input - number of samples

References escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::isEmpty(), and escriptDataC::m_dataPtr.

Referenced by Assemble_getAssembleParameters(), Finley_Assemble_AverageElementData(), Finley_Assemble_CopyElementData(), Finley_Assemble_CopyNodalData(), Finley_Assemble_getSize(), Finley_Assemble_gradient(), Finley_Assemble_integrate(), Finley_Assemble_interpolate(), Finley_Assemble_LumpedSystem(), Finley_Assemble_NodeCoordinates(), Finley_Assemble_PDE(), Finley_Assemble_setNormal(), Finley_ElementFile_setTags(), Finley_NodeFile_setCoordinates(), and Finley_NodeFile_setTags().

void requireWrite ( escriptDataC data  ) 


Generated on Mon Aug 10 10:04:43 2009 for ESYS13 by  doxygen 1.5.6