Classes | Defines | Typedefs | Functions

DataC.h File Reference

#include "system_dep.h"

Go to the source code of this file.

Classes

struct  escriptDataC
 Provide a wrapper around a Data object so Data may be accessed from C. More...

Defines

#define updateFunctionSpaceType(_fs_, _data_)   _fs_=(isEmpty(_data_) ? _fs_ : getFunctionSpaceType(_data_))
 sets the int variable _fs_ the function space type of _data_ if the data are not empty.
#define functionSpaceTypeEqual(_fs_, _data_)   ( (isEmpty(_data_) || _fs_==getFunctionSpaceType(_data_)) ) ? 1 : 0
 is true if the function space type of _data_ is equal to _fs_ or is empty

Typedefs

typedef struct escriptDataC escriptDataC

Functions

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

Define Documentation

#define functionSpaceTypeEqual (   _fs_,
  _data_ 
)    ( (isEmpty(_data_) || _fs_==getFunctionSpaceType(_data_)) ) ? 1 : 0

is true if the function space type of _data_ is equal to _fs_ or is empty

Parameters:
_fs_ Input - function space type to checked against
_data_ Input - C wrapper for Data.

Referenced by Dudley_Assemble_PDE(), and Finley_Assemble_PDE().

#define updateFunctionSpaceType (   _fs_,
  _data_ 
)    _fs_=(isEmpty(_data_) ? _fs_ : getFunctionSpaceType(_data_))

sets the int variable _fs_ the function space type of _data_ if the data are not empty.

Parameters:
_fs_ Input/Output - variable to be updated.
_data_ Input - C wrapper for Data.

Referenced by Dudley_Assemble_PDE(), and Finley_Assemble_PDE().


Typedef Documentation

typedef struct escriptDataC escriptDataC

Function Documentation

ESCRIPT_DLL_API 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 Dudley_Mesh_saveDX(), Dudley_Mesh_saveVTK(), Finley_Mesh_saveDX(), and Finley_Mesh_saveVTK().

ESCRIPT_DLL_API 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 Dudley_Mesh_saveDX(), Dudley_Mesh_saveVTK(), Finley_Mesh_saveDX(), and Finley_Mesh_saveVTK().

ESCRIPT_DLL_API int getDataPointSize ( escriptDataC data  ) 
ESCRIPT_DLL_API 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 Dudley_Assemble_CopyNodalData(), and Finley_Assemble_CopyNodalData().

ESCRIPT_DLL_API int getFunctionSpaceType ( escriptDataC data  ) 
ESCRIPT_DLL_API 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 Dudley_Mesh_saveVTK(), Finley_Mesh_saveVTK(), and escript::Data::lazyAlgWorker().

ESCRIPT_DLL_API double __const* getSampleDataRO ( escriptDataC data,
int  sampleNo 
)
ESCRIPT_DLL_API double __const* getSampleDataROFast ( escriptDataC data,
int  sampleNo 
)

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.

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

Referenced by Dudley_Assemble_CopyNodalData(), Dudley_NodeFile_setCoordinates(), Finley_Assemble_CopyNodalData(), and Finley_NodeFile_setCoordinates().

ESCRIPT_DLL_API double* getSampleDataRW ( escriptDataC data,
int  sampleNo 
)
ESCRIPT_DLL_API 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 Dudley_Assemble_CopyNodalData(), Dudley_Assemble_NodeCoordinates(), Finley_Assemble_CopyNodalData(), Finley_Assemble_NodeCoordinates(), and getDataRW().

ESCRIPT_DLL_API int isDataPointShapeEqual ( escriptDataC data,
int  rank,
int *  dimensions 
)
ESCRIPT_DLL_API int isEmpty ( escriptDataC data  ) 
ESCRIPT_DLL_API int isExpanded ( escriptDataC data  ) 

Return true if data can be treated as expanded.

Argument data may be NULL, in which case false is returnd.

Parameters:
data Input - C wrapper for Data.
Returns:
true if data is expanded or the data is lazy but would resolve to expanded. False otherwise.

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

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_Single2_1D(), Dudley_Assemble_PDE_Single2_2D(), Dudley_Assemble_PDE_Single2_3D(), Dudley_Assemble_PDE_System2_1D(), Dudley_Assemble_PDE_System2_2D(), Dudley_Assemble_PDE_System2_3D(), Dudley_Assemble_setNormal(), Dudley_ElementFile_setTags(), Dudley_Mesh_saveDX(), Dudley_Mesh_saveVTK(), Finley_Assemble_AverageElementData(), Finley_Assemble_CopyElementData(), Finley_Assemble_CopyNodalData(), Finley_Assemble_getAssembleParameters(), Finley_Assemble_getSize(), Finley_Assemble_gradient(), Finley_Assemble_integrate(), Finley_Assemble_interpolate(), Finley_Assemble_LumpedSystem(), Finley_Assemble_NodeCoordinates(), 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_Assemble_setNormal(), Finley_ElementFile_setTags(), Finley_Mesh_saveDX(), and Finley_Mesh_saveVTK().

ESCRIPT_DLL_API int numSamplesEqual ( escriptDataC data,
int  numDataPointsPerSample,
int  numSamples 
)
ESCRIPT_DLL_API void requireWrite ( escriptDataC data  )