escript
Revision_
|
#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 to the function space type of _DATA if the data object is not empty. | |
#define | functionSpaceTypeEqual(_FS, _DATA) ( (isEmpty(_DATA) || _FS==getFunctionSpaceType(_DATA)) ) ? 1 : 0 |
returns true if the function space type of _DATA is equal to _FS or is empty | |
Typedefs | |
typedef struct escriptDataC | escriptDataC |
Functions | |
int | getFunctionSpaceType (escriptDataC *data) |
Return the function space type code. | |
int | isEmpty (escriptDataC *data) |
Returns the true if the data are empty or data is NULL. | |
int | isDataPointShapeEqual (escriptDataC *data, int rank, const int *dimensions) |
Return true if the input shape matches the data point shape for 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. | |
int | getNumDataPointsPerSample (escriptDataC *data) |
Returns the number of data points per sample. | |
int | getDataPointRank (escriptDataC *data) |
Returns the rank of the point data for the data. | |
int | getDataPointShape (escriptDataC *data, int i) |
Returns the value of the i-th component of the shape of the point data. | |
int | getDataPointSize (escriptDataC *data) |
Return the number of doubles needed for each data point. | |
int | isExpanded (escriptDataC *data) |
Return true if data can be treated as expanded. | |
double * | 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. | |
double * | getSampleDataRW (escriptDataC *data, int sampleNo) |
double * | getSampleDataROFast (escriptDataC *data, int sampleNo) |
Return a pointer to the data for the given sample number. Fast version of getSampledataRO: does no error checking. | |
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. | |
double * | getDataRW (escriptDataC *data) |
Return getSampleDataRWFast(escriptDataC* data, 0) if there are samples. if not, returns NULL. | |
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 functionSpaceTypeEqual | ( | _FS, | |
_DATA | |||
) | ( (isEmpty(_DATA) || _FS==getFunctionSpaceType(_DATA)) ) ? 1 : 0 |
returns true if the function space type of _DATA is equal to _FS or is empty
_FS | Input - function space type to checked against |
_DATA | Input - C wrapper for Data. |
Referenced by Dudley_Assemble_PDE().
#define updateFunctionSpaceType | ( | _FS, | |
_DATA | |||
) | _FS=(isEmpty(_DATA) ? _FS : getFunctionSpaceType(_DATA)) |
sets the int variable _FS to the function space type of _DATA if the data object is not empty.
_FS | Input/Output - variable to be updated. |
_DATA | Input - C wrapper for Data. |
Referenced by Dudley_Assemble_PDE().
typedef struct escriptDataC escriptDataC |
int getDataPointRank | ( | escriptDataC * | data | ) |
Returns the rank of the point data for the data.
data | Input - C wrapper for Data. |
References escript::Data::getDataPointRank(), and escriptDataC::m_dataPtr.
Referenced by escript::saveDataCSV().
int getDataPointShape | ( | escriptDataC * | data, |
int | i | ||
) |
Returns the value of the i-th component of the shape of the point data.
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 escript::saveDataCSV().
int getDataPointSize | ( | escriptDataC * | data | ) |
Return the number of doubles needed for each data point.
data | Input - C wrapper for Data. |
References escript::Data::getDataPointSize(), and escriptDataC::m_dataPtr.
Referenced by Dudley_Assemble_AverageElementData(), Dudley_Assemble_CopyElementData(), Dudley_Assemble_CopyNodalData(), Dudley_Assemble_getAssembleParameters(), Dudley_Assemble_gradient(), Dudley_Assemble_integrate(), Dudley_Assemble_interpolate(), Dudley_ElementFile_setTags(), Dudley_NodeFile_setCoordinates(), and Dudley_NodeFile_setTags().
double* getDataRW | ( | escriptDataC * | data | ) |
Return getSampleDataRWFast(escriptDataC* data, 0) if there are samples. if not, returns NULL.
data | Input - C wrapper for Data. |
References escript::Data::getNumSamples(), getSampleDataRWFast(), escriptDataC::m_dataPtr, and requireWrite().
Referenced by Dudley_Assemble_CopyNodalData().
int getFunctionSpaceType | ( | escriptDataC * | data | ) |
Return the function space type code.
data | Input - C wrapper for Data. |
References escript::Data::getFunctionSpace(), escript::FunctionSpace::getTypeCode(), and escriptDataC::m_dataPtr.
Referenced by Dudley_Assemble_CopyNodalData(), Dudley_Assemble_gradient(), Dudley_Assemble_interpolate(), Dudley_Assemble_LumpedSystem(), and Dudley_Assemble_NodeCoordinates().
int getNumDataPointsPerSample | ( | escriptDataC * | data | ) |
Returns the number of data points per sample.
data | Input - C wrapper for Data. |
References escript::Data::getNumDataPointsPerSample(), escript::Data::isEmpty(), and escriptDataC::m_dataPtr.
Referenced by escript::Data::lazyAlgWorker().
double* 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.
data | Input - C wrapper for Data. |
sampleNo | Input - The sample number. |
References escript::Data::getSampleDataRO(), escript::Data::isEmpty(), and escriptDataC::m_dataPtr.
Referenced by Dudley_Assemble_AverageElementData(), Dudley_Assemble_CopyElementData(), Dudley_Assemble_gradient(), Dudley_Assemble_integrate(), Dudley_Assemble_interpolate(), Dudley_Assemble_LumpedSystem(), Dudley_Assemble_PDE_Points(), 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_ElementFile_setTags(), and Dudley_NodeFile_setTags().
double* getSampleDataROFast | ( | escriptDataC * | data, |
int | sampleNo | ||
) |
Return a pointer to the data for the given sample number. Fast version of getSampledataRO: does no error checking.
data | Input - C wrapper for Data. |
sampleNo | Input - The sample number. |
References escript::Data::getSampleDataRO(), and escriptDataC::m_dataPtr.
Referenced by Dudley_Assemble_CopyNodalData(), and Dudley_NodeFile_setCoordinates().
double* getSampleDataRW | ( | escriptDataC * | data, |
int | sampleNo | ||
) |
References escript::Data::getSampleDataRW(), escript::Data::isEmpty(), and escriptDataC::m_dataPtr.
Referenced by Dudley_Assemble_AverageElementData(), Dudley_Assemble_CopyElementData(), Dudley_Assemble_getSize(), Dudley_Assemble_gradient(), Dudley_Assemble_interpolate(), Dudley_Assemble_LumpedSystem(), Dudley_Assemble_PDE_Points(), 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(), and Dudley_Assemble_setNormal().
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.
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(), and getDataRW().
int isDataPointShapeEqual | ( | escriptDataC * | data, |
int | rank, | ||
const int * | dimensions | ||
) |
Return true if the input shape matches the data point shape for data.
data | Input - C wrapper for Data. |
rank | Input - number of dimensions. |
dimensions | Input - |
References escript::Data::isDataPointShapeEqual(), and escriptDataC::m_dataPtr.
Referenced by ripley::Brick::assembleCoordinates(), ripley::Rectangle::assembleCoordinates(), Dudley_Assemble_getSize(), Dudley_Assemble_LumpedSystem(), Dudley_Assemble_NodeCoordinates(), Dudley_Assemble_PDE(), and Dudley_Assemble_setNormal().
int isEmpty | ( | escriptDataC * | data | ) |
Returns the true if the data are empty or data is NULL.
data | Input - C wrapper for Data. |
References escript::Data::isEmpty(), and escriptDataC::m_dataPtr.
Referenced by ripley::WaveAssembler2D::assemblePDESystem(), ripley::WaveAssembler3D::assemblePDESystem(), ripley::LameAssembler2D::assemblePDESystem(), ripley::LameAssembler3D::assemblePDESystem(), Dudley_Assemble_getAssembleParameters(), Dudley_Assemble_LumpedSystem(), and Dudley_Assemble_PDE().
int isExpanded | ( | escriptDataC * | data | ) |
Return true if data can be treated as expanded.
Argument data may be NULL, in which case false is returnd.
data | Input - C wrapper for Data. |
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(), and Dudley_ElementFile_setTags().
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.
data | Input - C wrapper for Data. |
numDataPointsPerSample | Input - number of data points per sample |
numSamples | Input - number of samples |
References escriptDataC::m_dataPtr, and escript::Data::numSamplesEqual().
Referenced by ripley::Brick::assembleCoordinates(), ripley::Rectangle::assembleCoordinates(), 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 | ( | 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.
References escriptDataC::m_dataPtr, and requireWrite().
Referenced by Dudley_Assemble_AverageElementData(), Dudley_Assemble_CopyElementData(), Dudley_Assemble_CopyNodalData(), Dudley_Assemble_getSize(), Dudley_Assemble_gradient(), Dudley_Assemble_interpolate(), Dudley_Assemble_LumpedSystem(), Dudley_Assemble_NodeCoordinates(), Dudley_Assemble_PDE_Points(), 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(), getDataRW(), and requireWrite().