escript  Revision_
Macros | Functions
DataC.cpp File Reference
#include "esysUtils/first.h"
#include "DataC.h"
#include "Data.h"
#include "DataTypes.h"

Macros

#define ESNEEDPYTHON
 

Functions

int getFunctionSpaceType (const escript::Data *data)
 Return the function space type code. More...
 
int isDataPointShapeEqual (const escript::Data *data, int rank, const int *dimensions)
 Return true if the input shape matches the data point shape for data. More...
 
int getNumDataPointsPerSample (const escript::Data *data)
 Returns the number of data points per sample. More...
 
int numSamplesEqual (const escript::Data *data, int numDataPointsPerSample, dim_t 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. More...
 
int getDataPointRank (const escript::Data *data)
 Returns the rank of the point data for the data. More...
 
int getDataPointShape (const escript::Data *data, int i)
 Returns the value of the i-th component of the shape of the point data. More...
 
int getDataPointSize (const escript::Data *data)
 Return the number of doubles needed for each data point. More...
 
int getLength (const escript::Data *data)
 
int isExpanded (const escript::Data *data)
 Return true if data can be treated as expanded. More...
 
int isEmpty (const escript::Data *data)
 Returns the true if the data are empty or data is NULL. More...
 
double const * getSampleDataRO (const escript::Data *data, int sampleNo)
 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. More...
 
double * getSampleDataRW (escript::Data *data, int sampleNo)
 
const double * getSampleDataROFast (const escript::Data *data, int sampleNo)
 Return a pointer to the data for the given sample number. Fast version of getSampledataRO: does no error checking. More...
 
double * getSampleDataRWFast (escript::Data *data, int sampleNo)
 Return a pointer to the data for the given sample number. Fast version of getSampledataRW: does no error checking. More...
 
double * getDataRW (escript::Data *data)
 Return getSampleDataRWFast(escriptDataC* data, 0) if there are samples. if not, returns NULL. More...
 
void requireWrite (escript::Data *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. More...
 

Macro Definition Documentation

#define ESNEEDPYTHON

Function Documentation

int getDataPointRank ( const escript::Data data)

Returns the rank of the point data for the data.

Parameters
dataInput - C wrapper for Data.

References escript::Data::getDataPointRank().

Referenced by escript::saveDataCSV().

int getDataPointShape ( const escript::Data data,
int  i 
)

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

Parameters
dataInput - C wrapper for Data.
iInput - index of shape component.

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

Referenced by escript::saveDataCSV().

int getDataPointSize ( const escript::Data data)
double* getDataRW ( escript::Data 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
dataInput - C wrapper for Data.

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

int getFunctionSpaceType ( const escript::Data data)

Return the function space type code.

Parameters
dataInput - C wrapper for Data.

References escript::Data::getFunctionSpace(), and escript::FunctionSpace::getTypeCode().

Referenced by Dudley_Assemble_CopyNodalData(), Dudley_Assemble_gradient(), Dudley_Assemble_interpolate(), and Dudley_Assemble_NodeCoordinates().

int getLength ( const escript::Data data)
int getNumDataPointsPerSample ( const escript::Data data)

Returns the number of data points per sample.

Parameters
dataInput - C wrapper for Data.

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

Referenced by escript::FunctionSpace::getNumDPPSample().

double const* getSampleDataRO ( const escript::Data data,
int  sampleNo 
)
const double* getSampleDataROFast ( const escript::Data data,
int  sampleNo 
)

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

Parameters
dataInput - C wrapper for Data.
sampleNoInput - The sample number.

References escript::Data::getSampleDataRO().

Referenced by Dudley_Assemble_CopyNodalData(), and Dudley_NodeFile_setCoordinates().

double* getSampleDataRW ( escript::Data data,
int  sampleNo 
)
double* getSampleDataRWFast ( escript::Data data,
int  sampleNo 
)

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

Parameters
dataInput - C wrapper for Data.
sampleNoInput - The sample number.

References escript::Data::getSampleDataRW().

Referenced by Dudley_Assemble_CopyNodalData(), Dudley_Assemble_NodeCoordinates(), and getDataRW().

int isDataPointShapeEqual ( const escript::Data data,
int  rank,
const int *  dimensions 
)

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

Parameters
dataInput - C wrapper for Data.
rankInput - number of dimensions.
dimensionsInput -

References escript::Data::isDataPointShapeEqual().

Referenced by Dudley_Assemble_getSize(), Dudley_Assemble_LumpedSystem(), Dudley_Assemble_NodeCoordinates(), Dudley_Assemble_PDE(), and Dudley_Assemble_setNormal().

int isEmpty ( const escript::Data data)
int isExpanded ( const escript::Data data)
int numSamplesEqual ( const escript::Data data,
int  numDataPointsPerSample,
dim_t  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
dataInput - C wrapper for Data.
numDataPointsPerSampleInput - number of data points per sample
numSamplesInput - number of samples

References escript::Data::numSamplesEqual().

Referenced by Dudley_Assemble_AverageElementData(), Dudley_Assemble_CopyElementData(), Dudley_Assemble_CopyNodalData(), Dudley_Assemble_getAssembleParameters(), Dudley_Assemble_getSize(), Dudley_Assemble_gradient(), Dudley_Assemble_integrate(), Dudley_Assemble_interpolate(), Dudley_Assemble_LumpedSystem(), Dudley_Assemble_NodeCoordinates(), Dudley_Assemble_PDE(), Dudley_Assemble_setNormal(), Dudley_ElementFile_setTags(), Dudley_NodeFile_setCoordinates(), and Dudley_NodeFile_setTags().

void requireWrite ( escript::Data data)