Go to the documentation of this file.
18 #ifndef __ESCRIPT_UTILS_H__
19 #define __ESCRIPT_UTILS_H__
22 #include <boost/python/dict.hpp>
24 #ifdef ESYS_HAVE_BOOST_NUMPY
25 #include <boost/python/numpy.hpp>
107 boost::python::dict arg,
108 const std::string& sep,
109 const std::string& csep,
113 #ifdef ESYS_HAVE_BOOST_NUMPY
119 #ifdef ESYS_HAVE_BOOST_NUMPY
137 #endif // __ESCRIPT_UTILS_H__
bool ownSample(DataTypes::dim_t sampleNo) const
Does this process own the sample? For non-MPI builds will always return true.
Definition: FunctionSpace.h:132
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
int getNumDataPointsPerSample() const
Return the number of data points per sample.
Definition: Data.h:544
bool isComplex() const
True if components of this data are stored as complex.
Definition: Data.cpp:1160
DataAbstract * borrowData(void) const
return the object produced by the factory, which is a DataConstant or DataExpanded TODO Ownership of ...
Definition: Data.cpp:4621
void MPIBarrierWorld()
performs a barrier synchronization across all processors.
Definition: Utils.cpp:377
int getSvnVersion()
some functions
Definition: Utils.cpp:43
void saveDataCSV(const std::string &filename, bp::dict arg, const std::string &sep, const std::string &csep, bool refid, bool append)
Definition: Utils.cpp:388
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:51
void getNumpy(bp::dict arg)
Definition: Utils.cpp:920
double getMaxFloat()
Definition: Utils.cpp:372
The base class for escript exceptions.
Definition: EsysException.h:30
const_Domain_ptr getDomain() const
Return the domain.
Definition: Data.h:487
DataTypes::dim_t getReferenceIDOfSample(DataTypes::dim_t sampleNo) const
Returns the reference number associated with the given sample number. This function is not efficient....
Definition: FunctionSpace.h:123
const DataTypes::real_t * getSampleDataRO(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
Return the sample data for the given sample no. Please do not use this unless you NEED to access samp...
Definition: Data.h:1989
const DataTypes::ShapeType & getDataPointShape() const
Return a reference to the data point shape.
Definition: Data.h:705
void resolveGroup(bp::object obj)
Definition: Utils.cpp:986
Data interpolate(const FunctionSpace &functionspace) const
Interpolates this onto the given functionspace and returns the result as a Data object.
Definition: Data.cpp:1311
Definition: FileWriter.h:30
#define MPI_SUM
Definition: EsysMPI.h:52
int getMPISizeWorld()
returns the total number of available MPI processes for MPI_COMM_WORLD
Definition: Utils.cpp:94
int get_core_id()
Definition: Utils.cpp:54
Definition: FunctionSpace.h:36
#define CHILD_FAIL
Definition: Utils.cpp:164
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
bool openFile(std::string filename, size_t initialSize=0, bool binary=false, bool append=false)
Definition: FileWriter.h:49
#define MPI_INT
Definition: EsysMPI.h:46
bool initialize(const std::string &simFile, const std::string &comment)
Definition: VisItControl.cpp:178
#define MPI_MAX
Definition: EsysMPI.h:54
int getNumberOfThreads()
returns the number of threads
Definition: Utils.cpp:85
int getNumSamples() const
Return the number of samples.
Definition: Data.h:533
#define MPI_COMM_WORLD
Definition: EsysMPI.h:48
Data represents a collection of datapoints.
Definition: Data.h:64
Definition: DataException.h:28
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:43
int runMPIProgram(bp::list args)
Definition: Utils.cpp:312
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:91
void pointToStream(std::ostream &os, const RealVectorType::ElementType *data, const ShapeType &shape, int offset, bool needsep=true, const std::string &sep=",")
Display a single value (with the specified shape) from the data.
int getMPIWorldSum(int val)
returns sum of an integer over all processors with MPI_COMM_WORLD
Definition: Utils.cpp:124
#define OVERLORDPATH
Definition: Utils.cpp:38
#define CHILD_COMPLETE
Definition: Utils.cpp:165
void printParallelThreadCnt()
print a message about how many MPI CPUs and OpenMP threads we're using
Definition: Utils.cpp:136
Definition: AbstractContinuousDomain.cpp:23
#define MPI_COMM_NULL
Definition: EsysMPI.h:49
int getMPIWorldMax(int val)
returns the maximum value of an integer over all processors within MPI_COMM_WORLD
Definition: Utils.cpp:112
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:95
bool isLazy() const
Return true if this Data is lazy.
Definition: Data.cpp:1146
long getShapeProduct() const
Returns the product of the data point shapes.
Definition: Data.cpp:745
virtual const char * what() const
Returns a description of the exception.
Definition: EsysException.h:47
int MPI_Comm
Definition: EsysMPI.h:42
bool actsExpanded() const
Return true if this Data is expanded or resolves to expanded. That is, if it has a separate value for...
Definition: Data.cpp:1118
int getMPIRankWorld()
returns the MPI processor number within MPI_COMM_WORLD
Definition: Utils.cpp:103
void convertToNumpy(escript::Data data)
Definition: Utils.cpp:981
void close()
Definition: FileWriter.h:199
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:54
void setNumberOfThreads(int num_threads)
set the number of threads
Definition: Utils.cpp:78
double getMachinePrecision()
returns the machine precision
Definition: Utils.cpp:367
static bool active()
Definition: EsysMPI.cpp:237
bool writeOrdered(std::ostringstream &oss)
Definition: FileWriter.h:126
unsigned int getDataPointRank() const
Return the rank of the point data.
Definition: Data.h:512
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:49