Go to the documentation of this file.
17 #ifndef __ESCRIPT_UTILS_H__
18 #define __ESCRIPT_UTILS_H__
21 #include <boost/python/dict.hpp>
23 #ifdef ESYS_HAVE_BOOST_NUMPY
24 #include <boost/python/numpy.hpp>
106 boost::python::dict arg,
107 const std::string& sep,
108 const std::string& csep,
112 #ifdef ESYS_HAVE_BOOST_NUMPY
130 #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:142
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:28
DataAbstract * borrowData(void) const
return the object produced by the factory, which is a DataConstant or DataExpanded TODO Ownership of ...
Definition: Data.cpp:4624
void MPIBarrierWorld()
performs a barrier synchronization across all processors.
Definition: Utils.cpp:376
int getSvnVersion()
some functions
Definition: Utils.cpp:42
void saveDataCSV(const std::string &filename, bp::dict arg, const std::string &sep, const std::string &csep, bool refid, bool append)
Definition: Utils.cpp:387
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:73
void getNumpy(bp::dict arg)
Definition: Utils.cpp:919
double getMaxFloat()
Definition: Utils.cpp:371
The base class for escript exceptions.
Definition: EsysException.h:39
const_Domain_ptr getDomain() const
Return the domain.
Definition: Data.h:473
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:133
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:1975
void resolveGroup(bp::object obj)
Definition: Utils.cpp:924
Data interpolate(const FunctionSpace &functionspace) const
Interpolates this onto the given functionspace and returns the result as a Data object.
Definition: Data.cpp:1314
Definition: FileWriter.h:39
#define MPI_SUM
Definition: EsysMPI.h:50
int getMPISizeWorld()
returns the total number of available MPI processes for MPI_COMM_WORLD
Definition: Utils.cpp:93
int get_core_id()
Definition: Utils.cpp:53
Definition: FunctionSpace.h:45
#define CHILD_FAIL
Definition: Utils.cpp:163
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:461
bool openFile(std::string filename, size_t initialSize=0, bool binary=false, bool append=false)
Definition: FileWriter.h:71
#define MPI_INT
Definition: EsysMPI.h:44
bool initialize(const std::string &simFile, const std::string &comment)
Definition: VisItControl.cpp:200
#define MPI_MAX
Definition: EsysMPI.h:52
int getNumberOfThreads()
returns the number of threads
Definition: Utils.cpp:84
#define MPI_COMM_WORLD
Definition: EsysMPI.h:46
Data represents a collection of datapoints.
Definition: Data.h:62
Definition: DataException.h:37
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:65
int runMPIProgram(bp::list args)
Definition: Utils.cpp:311
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:89
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:123
#define OVERLORDPATH
Definition: Utils.cpp:37
#define CHILD_COMPLETE
Definition: Utils.cpp:164
void printParallelThreadCnt()
print a message about how many MPI CPUs and OpenMP threads we're using
Definition: Utils.cpp:135
Definition: AbstractContinuousDomain.cpp:22
#define MPI_COMM_NULL
Definition: EsysMPI.h:47
int getMPIWorldMax(int val)
returns the maximum value of an integer over all processors within MPI_COMM_WORLD
Definition: Utils.cpp:111
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:93
bool isLazy() const
Return true if this Data is lazy.
Definition: Data.cpp:1149
virtual const char * what() const
Returns a description of the exception.
Definition: EsysException.h:69
int MPI_Comm
Definition: EsysMPI.h:40
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:1121
int getMPIRankWorld()
returns the MPI processor number within MPI_COMM_WORLD
Definition: Utils.cpp:102
void close()
Definition: FileWriter.h:221
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:76
void setNumberOfThreads(int num_threads)
set the number of threads
Definition: Utils.cpp:77
double getMachinePrecision()
returns the machine precision
Definition: Utils.cpp:366
static bool active()
Definition: EsysMPI.cpp:247
bool writeOrdered(std::ostringstream &oss)
Definition: FileWriter.h:148
unsigned int getDataPointRank() const
Return the rank of the point data.
Definition: Data.h:498