DataFactory.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#if !defined escript_DataFactory_20040721_H
#define escript_DataFactory_20040721_H
#include "system_dep.h"
#include "AbstractDomain.h"
#include "FunctionSpace.h"
#include "Data.h"
#include <boost/python/object.hpp>
namespace escript {
ESCRIPT_DLL_API Data
Scalar(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
ComplexScalar(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
Scalar(DataTypes::cplx_t value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
ComplexScalar(DataTypes::cplx_t value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
ScalarFromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
ComplexScalarFromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
Vector(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
ComplexVector(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
VectorFromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
ComplexVectorFromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
Tensor(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
ComplexTensor(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
TensorFromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
ComplexTensorFromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
Tensor3(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
ComplexTensor3(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
Tensor3FromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
ComplexTensor3FromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
Tensor4(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
ComplexTensor4(double value,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
Tensor4FromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
ComplexTensor4FromObj(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API
Data
ComplexData(boost::python::object o,
const FunctionSpace& what=FunctionSpace(),
bool expanded=false);
ESCRIPT_DLL_API Data
load(const std::string fileName,
const AbstractDomain& domain);
ESCRIPT_DLL_API bool
loadConfigured();
ESCRIPT_DLL_API Data
convertToData(const boost::python::object& value,
const FunctionSpace& what=FunctionSpace());
} // end of namespace
#endif
escript::ComplexVector
Data ComplexVector(double value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:145
escript::Tensor3C
Data Tensor3C(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:284
escript::DataTypes::maxRank
static const int maxRank
The maximum number of dimensions a datapoint can have.
Definition: DataTypes.h:74
escript::ComplexScalar
Data ComplexScalar(double value, const FunctionSpace &what, bool expanded)
Return a Complex Data object containing scalar data-points. ie: rank 0 data-points.
Definition: DataFactory.cpp:77
DataFactory.h
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript::ComplexTensor3C
Data ComplexTensor3C(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:290
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:79
escript::Tensor4FromObj
Data Tensor4FromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:377
escript::loadConfigured
bool loadConfigured()
returns true if the load funtion is configured.
Definition: DataFactory.cpp:932
escript::FunctionSpace::getNumSamples
DataTypes::dim_t getNumSamples() const
Returns the number of samples.
Definition: FunctionSpace.h:182
escript::ComplexTensorFromObj
Data ComplexTensorFromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:244
escript::ComplexVectorFromObj
Data ComplexVectorFromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:171
escript::ScalarFromObj
Data ScalarFromObj(boost::python::object o, const FunctionSpace &what, bool expanded)
Python interface for the Scalar factory.
Definition: DataFactory.cpp:96
escript::TensorFromObj
Data TensorFromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:219
escript::checkResult
bool checkResult(int res, int &mres, const JMPI &info)
Everyone puts in their error code and everyone gets the largest one.
Definition: EsysMPI.cpp:124
escript::FunctionSpace
Definition: FunctionSpace.h:49
escript::Data::complicate
void complicate()
Definition: Data.cpp:6057
escript::FunctionSpace::getDomain
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:103
escript::ComplexTensor4
Data ComplexTensor4(double value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:355
system_dep.h
escript::convertToData
Data convertToData(const bp::object &value, const FunctionSpace &what)
Definition: DataFactory.cpp:941
escript::Scalar
Data Scalar(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Return a Data object containing scalar data-points. ie: rank 0 data-points.
Definition: DataFactory.cpp:70
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
escript::DataException
Definition: DataException.h:41
escript::FunctionSpace::getNumDataPointsPerSample
int getNumDataPointsPerSample() const
Definition: FunctionSpace.h:191
escript::ComplexTensorC
Data ComplexTensorC(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:210
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:71
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:72
AbstractDomain.h
escript::ComplexScalar
Data ComplexScalar(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Return a Data object containing scalar data-points. ie: rank 0 data-points.
Definition: DataFactory.cpp:86
escript::Data::isEmpty
bool isEmpty() const
Definition: Data.cpp:1132
escript::ComplexData
Data ComplexData(boost::python::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:428
escript::Tensor3
Data Tensor3(double value, const FunctionSpace &what, bool expanded)
Return a Data object containing tensor3 datapoints. ie: rank 3 data-points.
Definition: DataFactory.cpp:270
NCHelper.h
escript::ComplexTensor4C
Data ComplexTensor4C(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:369
escript::DataTypes::RealVectorType
escript::DataTypes::DataVectorAlt< real_t > RealVectorType
Vector to store underlying data.
Definition: DataVector.h:44
escript::load
Data load(const std::string fileName, const AbstractDomain &domain)
reads Data on domain from file in netCDF format
Definition: DataFactory.cpp:722
escript::Tensor4C
Data Tensor4C(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:363
escript
Definition: AbstractContinuousDomain.cpp:23
escript::ComplexTensor3
Data ComplexTensor3(double value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:276
escript::Tensor
Data Tensor(double value, const FunctionSpace &what, bool expanded)
Return a Data object containing tensor datapoints. ie: rank 2 data-points.
Definition: DataFactory.cpp:190
escript::Vector
Data Vector(double value, const FunctionSpace &what, bool expanded)
Return a Data object containing vector data-points. ie: rank 1 data-points.
Definition: DataFactory.cpp:139
escript::ComplexTensor3FromObj
Data ComplexTensor3FromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:323
escript::TensorC
Data TensorC(DataTypes::cplx_t value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:204
escript::FunctionSpace::borrowSampleReferenceIDs
const DataTypes::dim_t * borrowSampleReferenceIDs() const
Returns a borrowed reference to the list of sample reference IDs.
Definition: FunctionSpace.cpp:199
escript::ComplexScalarFromObj
Data ComplexScalarFromObj(boost::python::object o, const FunctionSpace &what, bool expanded)
Python interface for the Complex Scalar factory.
Definition: DataFactory.cpp:118
escript::VectorFromObj
Data VectorFromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:153
Data.h
escript::Tensor3FromObj
Data Tensor3FromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:298
escript::shipString
bool shipString(const char *src, char **dest, MPI_Comm &comm)
Definition: EsysMPI.cpp:178
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:82
escript::Scalar
Data Scalar(double value, const FunctionSpace &what, bool expanded)
A collection of factory functions for creating Data objects which contain data points of various shap...
Definition: DataFactory.cpp:63
escript::ComplexTensor4FromObj
Data ComplexTensor4FromObj(bp::object o, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:402
escript::Tensor4
Data Tensor4(double value, const FunctionSpace &what, bool expanded)
Return a Data object containing tensor4 datapoints. ie: rank 4 data-points.
Definition: DataFactory.cpp:349
escript::ComplexTensor
Data ComplexTensor(double value, const FunctionSpace &what, bool expanded)
Definition: DataFactory.cpp:196
FunctionSpace.h