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:144
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
int getNumDataPointsPerSample() const
Return the number of data points per sample.
Definition: Data.h:543
bool isComplex() const
True if components of this data are stored as complex.
Definition: Data.cpp:1164
DataAbstract * borrowData(void) const
return the object produced by the factory, which is a DataConstant or DataExpanded TODO Ownership of ...
Definition: Data.cpp:4625
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:76
void getNumpy(bp::dict arg)
Definition: Utils.cpp:920
double getMaxFloat()
Definition: Utils.cpp:372
The base class for escript exceptions.
Definition: EsysException.h:41
const_Domain_ptr getDomain() const
Return the domain.
Definition: Data.h:486
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:135
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:1988
const DataTypes::ShapeType & getDataPointShape() const
Return a reference to the data point shape.
Definition: Data.h:704
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:1315
Definition: FileWriter.h:41
#define MPI_SUM
Definition: EsysMPI.h:51
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:47
#define CHILD_FAIL
Definition: Utils.cpp:164
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:462
bool openFile(std::string filename, size_t initialSize=0, bool binary=false, bool append=false)
Definition: FileWriter.h:74
#define MPI_INT
Definition: EsysMPI.h:45
bool initialize(const std::string &simFile, const std::string &comment)
Definition: VisItControl.cpp:203
#define MPI_MAX
Definition: EsysMPI.h:53
int getNumberOfThreads()
returns the number of threads
Definition: Utils.cpp:85
int getNumSamples() const
Return the number of samples.
Definition: Data.h:532
#define MPI_COMM_WORLD
Definition: EsysMPI.h:47
Data represents a collection of datapoints.
Definition: Data.h:63
Definition: DataException.h:39
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:68
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:90
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:48
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:94
bool isLazy() const
Return true if this Data is lazy.
Definition: Data.cpp:1150
long getShapeProduct() const
Returns the product of the data point shapes.
Definition: Data.cpp:749
virtual const char * what() const
Returns a description of the exception.
Definition: EsysException.h:72
int MPI_Comm
Definition: EsysMPI.h:41
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:1122
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:224
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:79
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:249
bool writeOrdered(std::ostringstream &oss)
Definition: FileWriter.h:151
unsigned int getDataPointRank() const
Return the rank of the point data.
Definition: Data.h:511