speckley/src/SpeckleyDomain.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
**
*****************************************************************************/
#ifndef __Speckley_DOMAIN_H__
#define __Speckley_DOMAIN_H__
#include <speckley/Speckley.h>
#include <speckley/SpeckleyException.h>
#include <speckley/AbstractAssembler.h>
#include <speckley/domainhelpers.h>
#include <escript/AbstractContinuousDomain.h>
#include <escript/Data.h>
#include <escript/FunctionSpace.h>
#include <escript/SubWorld.h>
#include <boost/python/tuple.hpp>
#include <boost/python/list.hpp>
namespace speckley {
enum assembler_t {
DEFAULT_ASSEMBLER
};
/* There is no particular significance to this type,
It is here as a typedef because a bug in clang++ prevents
that compiler from recognising it as a valid part of
a constant expression.
*/
typedef std::map<std::string, int> simap_t;
struct ReaderParameters
{
std::vector<dim_t> first;
std::vector<dim_t> numValues;
std::vector<int> multiplier;
std::vector<int> reverse;
int byteOrder;
int dataType;
};
struct DiracPoint
{
dim_t node;
int tag;
};
class Speckley_DLL_API SpeckleyDomain : public escript::AbstractContinuousDomain
{
public:
SpeckleyDomain(dim_t dim, int order, escript::SubWorld_ptr p=escript::SubWorld_ptr());
~SpeckleyDomain();
virtual escript::JMPI getMPI() const { return m_mpiInfo; }
virtual int getMPISize() const { return m_mpiInfo->size; }
virtual int getMPIRank() const { return m_mpiInfo->rank; }
virtual void MPIBarrier() const {
#ifdef ESYS_MPI
MPI_Barrier(m_mpiInfo->comm);
#endif
}
virtual bool onMasterProcessor() const { return getMPIRank()==0; }
MPI_Comm getMPIComm() const { return m_mpiInfo->comm; }
virtual bool isValidFunctionSpaceType(int fsType) const;
virtual std::string functionSpaceTypeAsString(int fsType) const;
virtual int getDim() const { return m_numDim; }
virtual bool operator==(const escript::AbstractDomain& other) const;
virtual bool operator!=(const escript::AbstractDomain& other) const {
return !(operator==(other));
}
virtual std::pair<int,dim_t> getDataShape(int fsType) const;
int getTagFromSampleNo(int fsType, dim_t sampleNo) const;
virtual void setTagMap(const std::string& name, int tag) {
m_tagMap[name] = tag;
}
virtual int getTag(const std::string& name) const {
if (m_tagMap.find(name) != m_tagMap.end()) {
return m_tagMap.find(name)->second;
} else {
throw SpeckleyException("getTag: invalid tag name");
}
}
virtual bool isValidTagName(const std::string& name) const {
return (m_tagMap.find(name)!=m_tagMap.end());
}
virtual std::string showTagNames() const;
virtual void setNewX(const escript::Data& arg);
virtual void interpolateOnDomain(escript::Data& target,
const escript::Data& source) const;
virtual bool probeInterpolationOnDomain(int fsType_source,
int fsType_target) const;
virtual signed char preferredInterpolationOnDomain(int fsType_source,
int fsType_target) const;
bool
commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const;
virtual void interpolateAcross(escript::Data& target,
const escript::Data& source) const = 0;
virtual bool probeInterpolationAcross(int, const escript::AbstractDomain&,
int) const = 0;
virtual escript::Data getX() const;
#ifdef ESYS_HAVE_BOOST_NUMPY
virtual boost::python::numpy::ndarray getNumpyX() const;
virtual boost::python::numpy::ndarray getConnectivityInfo() const;
#endif
virtual escript::Data getNormal() const;
virtual escript::Data getSize() const;
virtual void setToX(escript::Data& arg) const;
virtual void setToGradient(escript::Data& out,
const escript::Data& in) const;
virtual void setTags(int fsType, int newTag, const escript::Data& mask) const;
virtual bool isCellOriented(int fsType) const;
virtual StatusType getStatus() const { return m_status; }
virtual int getNumberOfTagsInUse(int fsType) const;
virtual const int* borrowListOfTagsInUse(int fsType) const;
virtual bool canTag(int fsType) const;
virtual int getApproximationOrder(int fsType) const { return 1; }
virtual bool supportsContactElements() const { return false; }
virtual int getContinuousFunctionCode() const { return Nodes; }
virtual int getReducedContinuousFunctionCode() const {
throw SpeckleyException("Speckley does not support reduced functionspaces");
}
virtual int getFunctionCode() const { return Elements; }
virtual int getReducedFunctionCode() const {
return ReducedElements;
}
virtual int getFunctionOnBoundaryCode() const {
throw SpeckleyException("Speckley does not support face elements");
}
virtual int getReducedFunctionOnBoundaryCode() const {
throw SpeckleyException("Speckley does not support face elements");
}
virtual int getFunctionOnContactZeroCode() const {
throw SpeckleyException("Speckley does not support contact elements");
}
virtual int getReducedFunctionOnContactZeroCode() const {
throw SpeckleyException("Speckley does not support contact elements");
}
virtual int getFunctionOnContactOneCode() const {
throw SpeckleyException("Speckley does not support contact elements");
}
virtual int getReducedFunctionOnContactOneCode() const {
throw SpeckleyException("Speckley does not support contact elements");
}
virtual int getSolutionCode() const {
return DegreesOfFreedom;
}
virtual int getReducedSolutionCode() const {
throw SpeckleyException("Speckley does not support reduced function spaces");
}
virtual int getDiracDeltaFunctionsCode() const { return Points; }
virtual int getSystemMatrixTypeId(const boost::python::object& options) const;
virtual int getTransportTypeId(int solver, int preconditioner, int package,
bool symmetry) const;
virtual void setToIntegrals(std::vector<real_t>& integrals,
const escript::Data& arg) const;
virtual void setToIntegrals(std::vector<cplx_t>& integrals,
const escript::Data& arg) const;
virtual void addToSystem(escript::AbstractSystemMatrix& mat,
escript::Data& rhs, const DataMap& data,
Assembler_ptr assembler) const;
virtual void addToSystemFromPython(escript::AbstractSystemMatrix& mat,
escript::Data& rhs, const boost::python::list& data,
Assembler_ptr assembler) const;
virtual void addToRHS(escript::Data& rhs, const DataMap& data,
Assembler_ptr assembler) const;
virtual void addToRHSFromPython(escript::Data& rhs,
const boost::python::list& data,
Assembler_ptr assembler) const;
using escript::AbstractContinuousDomain::addPDEToTransportProblem;
virtual void addPDEToTransportProblem(escript::AbstractTransportProblem& tp,
escript::Data& source, const DataMap& data,
Assembler_ptr assembler) const;
void addPDEToTransportProblemFromPython(
escript::AbstractTransportProblem& tp,
escript::Data& source, const boost::python::list& data,
Assembler_ptr assembler) const;
virtual escript::ASM_ptr newSystemMatrix(int row_blocksize,
const escript::FunctionSpace& row_functionspace,
int column_blocksize,
const escript::FunctionSpace& column_functionspace, int type) const;
virtual escript::ATP_ptr newTransportProblem(int blocksize,
const escript::FunctionSpace& functionspace,
int type) const;
virtual void Print_Mesh_Info(bool full=false) const;
/************************************************************************/
virtual void write(const std::string& filename) const = 0;
virtual std::string getDescription() const = 0;
void dump(const std::string& filename) const = 0;
const index_t* borrowSampleReferenceIDs(int fsType) const = 0;
virtual void setToNormal(escript::Data& out) const = 0;
virtual void setToSize(escript::Data& out) const = 0;
virtual void readNcGrid(escript::Data& out, std::string filename,
std::string varname, const ReaderParameters& params) const = 0;
virtual void readBinaryGrid(escript::Data& out, std::string filename,
const ReaderParameters& params) const = 0;
virtual void readBinaryGridFromZipped(escript::Data& out,
std::string filename, const ReaderParameters& params) const = 0;
virtual void writeBinaryGrid(const escript::Data& in, std::string filename,
int byteOrder, int dataType) const = 0;
virtual bool ownSample(int fsType, index_t id) const = 0;
virtual dim_t getNumDataPointsGlobal() const = 0;
virtual const dim_t* getNumNodesPerDim() const = 0;
virtual const dim_t* getNumElementsPerDim() const = 0;
virtual const dim_t* getNumFacesPerBoundary() const = 0;
virtual IndexVector getNodeDistribution() const = 0;
virtual const int* getNumSubdivisionsPerDim() const = 0;
virtual double getLocalCoordinate(dim_t index, int dim) const = 0;
virtual boost::python::tuple getGridParameters() const = 0;
virtual bool supportsFilter(const boost::python::tuple& t) const;
virtual Assembler_ptr createAssembler(const std::string type,
const DataMap& options) const {
throw SpeckleyException("Domain does not support custom assemblers");
}
Assembler_ptr createAssemblerFromPython(const std::string type,
const boost::python::list& options) const;
virtual const double *getLength() const = 0;
inline int getOrder() const { return m_order;}
protected:
int m_numDim;
StatusType m_status;
escript::JMPI m_mpiInfo;
TagMap m_tagMap;
mutable std::vector<int> m_nodeTags, m_nodeTagsInUse;
mutable std::vector<int> m_elementTags, m_elementTagsInUse;
std::vector<DiracPoint> m_diracPoints;
IndexVector m_diracPointNodeIDs; //for borrowSampleID
assembler_t assembler_type;
int m_order;
template<typename Scalar>
void copyData(escript::Data& out, const escript::Data& in) const;
// this is const because setTags is const
void updateTagsInUse(int fsType) const;
void addToSystemMatrix(escript::AbstractSystemMatrix* mat,
const IndexVector& nodes, dim_t numEq,
const DoubleVector& array) const;
void addPoints(const std::vector<double>& coords,
const std::vector<int>& tags);
template<typename Scalar>
void multiplyData(escript::Data& out, const escript::Data& in) const;
/***********************************************************************/
virtual dim_t getNumNodes() const = 0;
virtual dim_t getNumElements() const = 0;
virtual dim_t getNumDOF() const = 0;
virtual void assembleCoordinates(escript::Data& arg) const = 0;
virtual void assembleGradient(escript::Data& out,
const escript::Data& in) const = 0;
virtual void assembleIntegrate(std::vector<real_t>& integrals,
const escript::Data& arg) const = 0;
virtual void assembleIntegrate(std::vector<cplx_t>& integrals,
const escript::Data& arg) const = 0;
virtual void interpolateNodesOnElements(escript::Data& out,
const escript::Data& in,
bool reduced) const = 0;
virtual void interpolateElementsOnNodes(escript::Data& out,
const escript::Data& in) const = 0;
virtual dim_t getDofOfNode(dim_t node) const = 0;
virtual void reduceElements(escript::Data& out, const escript::Data& in) const = 0;
#ifdef ESYS_MPI
virtual void balanceNeighbours(escript::Data& data, bool average) const = 0;
#endif
private:
void assemblePDE(escript::AbstractSystemMatrix* mat, escript::Data& rhs,
const DataMap& coefs, Assembler_ptr assembler) const;
void assemblePDEBoundary(escript::AbstractSystemMatrix* mat,
escript::Data& rhs, const DataMap& coefs,
Assembler_ptr assembler) const;
void assemblePDEDiracWrap(escript::AbstractSystemMatrix* mat,
escript::Data& rhs, const DataMap& coefs,
Assembler_ptr assembler) const;
void assemblePDEDirac(escript::AbstractSystemMatrix* mat,
escript::Data& rhs, const DataMap& coefs,
Assembler_ptr assembler) const;
void assembleComplexPDEDirac(escript::AbstractSystemMatrix* mat,
escript::Data& rhs, const DataMap& coefs,
Assembler_ptr assembler) const;
template<typename Scalar>
void setToIntegralsWorker(std::vector<Scalar>& integrals,
const escript::Data& arg) const;
virtual dim_t findNode(const double *coords) const = 0;
};
} // end of namespace speckley
#endif // __Speckley_DOMAIN_H__
speckley::DATATYPE_INT32
@ DATATYPE_INT32
Definition: speckley/src/system_dep.h:61
speckley::simap_t
std::map< std::string, int > simap_t
Definition: speckley/src/SpeckleyDomain.h:59
speckley::TagMap
std::map< std::string, int > TagMap
Definition: Speckley.h:63
weipa::SpeckleyDomain::initFromFile
virtual bool initFromFile(const std::string &filename)
Reads the domain from a dump file.
Definition: weipa/src/SpeckleyDomain.cpp:69
escript::Data::getNumDataPointsPerSample
int getNumDataPointsPerSample() const
Return the number of data points per sample.
Definition: Data.h:544
ripley::isNotEmpty
bool isNotEmpty(const std::string target, const DataMap &mapping)
Definition: ripley/src/domainhelpers.h:54
escript::Data::isComplex
bool isComplex() const
True if components of this data are stored as complex.
Definition: Data.cpp:1160
speckley::readNcGrid
escript::Data readNcGrid(std::string filename, std::string varname, escript::FunctionSpace fs, const object &pyShape, double fill, const object &pyFirst, const object &pyNum, const object &pyMultiplier, const object &pyReverse)
Definition: speckleycpp.cpp:115
escript::FunctionSpace::getSize
escript::Data getSize() const
Returns the sample size (e.g. the diameter of elements, radius of particles).
Definition: FunctionSpace.cpp:295
speckley::SpeckleyDomain::showTagNames
virtual std::string showTagNames() const
returns all tag names in a single string separated by commas
Definition: speckley/src/SpeckleyDomain.cpp:152
dudley::Points
@ Points
Definition: Dudley.h:72
ripley::DataMap
std::map< std::string, escript::Data > DataMap
Definition: ripley/src/domainhelpers.h:39
speckley::DoubleVector
std::vector< real_t > DoubleVector
Definition: Speckley.h:62
REGISTER_ESCRIPT_EXCEPTION_TRANSLATORS
#define REGISTER_ESCRIPT_EXCEPTION_TRANSLATORS
Definition: ExceptionTranslators.h:26
getTag
int getTag(unsigned char sourcex, unsigned char sourcey, unsigned char sourcez, unsigned char targetx, unsigned char targety, unsigned char targetz)
Definition: blocktools.cpp:413
speckley::assembler_t
assembler_t
Definition: speckley/src/SpeckleyDomain.h:50
speckley::SpeckleyDomain::getDescription
virtual std::string getDescription() const =0
returns a description for this domain
escript::Data::requireWrite
void requireWrite()
Ensures data is ready for write access. This means that the data will be resolved if lazy and will be...
Definition: Data.cpp:1239
weipa::SpeckleyDomain
Represents a full Speckley domain including nodes and elements.
Definition: weipa/src/SpeckleyDomain.h:50
weipa::SpeckleyDomain::getCenteringForFunctionSpace
virtual Centering getCenteringForFunctionSpace(int fsCode) const
Returns whether data on given function space is node or cell centered.
Definition: weipa/src/SpeckleyDomain.cpp:75
speckley::SpeckleyDomain::getNormal
virtual escript::Data getNormal() const
returns boundary normals at the quadrature point on the face elements
Definition: speckley/src/SpeckleyDomain.cpp:454
dudley::Nodes
@ Nodes
Definition: Dudley.h:67
speckley::DATATYPE_FLOAT64
@ DATATYPE_FLOAT64
Definition: speckley/src/system_dep.h:63
INDEX2
#define INDEX2(_X1_, _X2_, _N1_)
Definition: index.h:23
speckley::SpeckleyDomain::addToRHSFromPython
virtual void addToRHSFromPython(escript::Data &rhs, const boost::python::list &data, Assembler_ptr assembler) const
a wrapper for addToRHS that allows calling from Python
Definition: speckley/src/SpeckleyDomain.cpp:765
escript::Data::getSampleDataRO
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
speckley::_rectangle
escript::Domain_ptr _rectangle(int order, double _n0, double _n1, const object &l0, const object &l1, int d0, int d1, const object &objpoints, const object &objtags, escript::SubWorld_ptr world)
Definition: speckleycpp.cpp:235
weipa::VisItControl::initialized
bool initialized
Definition: VisItControl.cpp:66
escript::continuousFunction
FunctionSpace continuousFunction(const AbstractDomain &domain)
Create function space objects.
Definition: FunctionSpaceFactory.cpp:45
weipa::SpeckleyDomain::siloPath
std::string siloPath
Definition: weipa/src/SpeckleyDomain.h:94
escript::Data::getDataPointShape
const DataTypes::ShapeType & getDataPointShape() const
Return a reference to the data point shape.
Definition: Data.h:705
speckley::SpeckleyDomain::onMasterProcessor
virtual bool onMasterProcessor() const
returns true if on MPI processor 0, else false
Definition: speckley/src/SpeckleyDomain.h:146
speckley::SpeckleyDomain::createAssemblerFromPython
Assembler_ptr createAssemblerFromPython(const std::string type, const boost::python::list &options) const
Definition: speckley/src/SpeckleyDomain.cpp:757
speckley::SpeckleyDomain::dump
void dump(const std::string &filename) const =0
dumps the mesh to a file with the given name
speckley::SpeckleyDomain::getOrder
int getOrder() const
returns the order of the domain
Definition: speckley/src/SpeckleyDomain.h:756
speckley::SpeckleyDomain::m_nodeTags
std::vector< int > m_nodeTags
Definition: speckley/src/SpeckleyDomain.h:763
speckley::ReaderParameters::byteOrder
int byteOrder
byte order in the file (used by binary reader only)
Definition: speckley/src/SpeckleyDomain.h:78
speckley::readBinaryGridFromZipped
escript::Data readBinaryGridFromZipped(std::string filename, escript::FunctionSpace fs, const object &pyShape, double fill, int byteOrder, int dataType, const object &pyFirst, const object &pyNum, const object &pyMultiplier, const object &pyReverse)
Definition: speckleycpp.cpp:86
speckley::SpeckleyDomain::SpeckleyDomain
SpeckleyDomain(dim_t dim, int order, escript::SubWorld_ptr p=escript::SubWorld_ptr())
Constructor with number of dimensions. Allocates MPI info structure.
Definition: speckley/src/SpeckleyDomain.cpp:65
weipa::SpeckleyDomain::getMeshByName
virtual NodeData_ptr getMeshByName(const std::string &name) const
Returns the node mesh with given name.
Definition: weipa/src/SpeckleyDomain.cpp:200
weipa::SpeckleyNodes_ptr
boost::shared_ptr< SpeckleyNodes > SpeckleyNodes_ptr
Definition: SpeckleyNodes.h:31
escript::Domain_ptr
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:55
escript::AbstractTransportProblem
Give a short description of what AbstractTransportProblem does.
Definition: AbstractTransportProblem.h:58
finley::ReducedNodes
@ ReducedNodes
Definition: Finley.h:83
dudley::DegreesOfFreedom
@ DegreesOfFreedom
Definition: Dudley.h:66
speckley::SpeckleyDomain::Print_Mesh_Info
virtual void Print_Mesh_Info(bool full=false) const
writes information about the mesh to standard output
Definition: speckley/src/SpeckleyDomain.cpp:706
escript::Data::getDataPointSize
int getDataPointSize() const
Return the size of the data point. It is the product of the data point shape dimensions.
Definition: Data.cpp:1360
weipa::SpeckleyDomain::writeToSilo
virtual bool writeToSilo(DBfile *dbfile, const std::string &pathInSilo, const StringVec &labels, const StringVec &units, bool writeMeshData)
Writes the domain to a Silo file.
Definition: weipa/src/SpeckleyDomain.cpp:222
speckley::ReaderParameters::first
std::vector< dim_t > first
the (global) offset into the data object to start writing into
Definition: speckley/src/SpeckleyDomain.h:69
speckley::SpeckleyDomain::newSystemMatrix
virtual escript::ASM_ptr newSystemMatrix(int row_blocksize, const escript::FunctionSpace &row_functionspace, int column_blocksize, const escript::FunctionSpace &column_functionspace, int type) const
creates a stiffness matrix and initializes it with zeros
Definition: speckley/src/SpeckleyDomain.cpp:733
speckley::SpeckleyDomain::getGridParameters
virtual boost::python::tuple getGridParameters() const =0
returns the tuple (origin, spacing, number_of_elements)
ripley::unpackData
const escript::Data unpackData(const std::string target, const DataMap &mapping)
Definition: ripley/src/domainhelpers.h:43
weipa::SpeckleyDomain::getMeshNames
virtual StringVec getMeshNames() const
Returns the names of all meshes within this domain.
Definition: weipa/src/SpeckleyDomain.cpp:126
escript::FunctionSpace
Definition: FunctionSpace.h:49
escript::makeInfo
JMPI makeInfo(MPI_Comm comm, bool owncom)
Definition: EsysMPI.cpp:43
weipa::SpeckleyDomain::faces
SpeckleyElements_ptr faces
Definition: weipa/src/SpeckleyDomain.h:93
escript::Data::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
escript::Data::complicate
void complicate()
Definition: Data.cpp:6057
dudley::Elements
@ Elements
Definition: Dudley.h:68
weipa::DataVar_ptr
boost::shared_ptr< DataVar > DataVar_ptr
Definition: weipa.h:65
weipa
Definition: DataVar.cpp:51
speckley::probeInterpolationAcross
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition: CrossDomainCoupler.cpp:32
escript::FunctionSpace::getDomain
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:103
MPI_INT
#define MPI_INT
Definition: EsysMPI.h:46
speckley::BYTEORDER_NATIVE
@ BYTEORDER_NATIVE
Definition: speckley/src/system_dep.h:48
speckley
Definition: AbstractAssembler.cpp:19
weipa::ZONE_CENTERED
@ ZONE_CENTERED
Definition: DomainChunk.h:33
escript::Data::getNumSamples
int getNumSamples() const
Return the number of samples.
Definition: Data.h:533
paso::util::copy
void copy(dim_t N, double *out, const double *in)
out = in
Definition: PasoUtil.h:116
speckley::SpeckleyDomain::setTagMap
virtual void setTagMap(const std::string &name, int tag)
sets a map from a clear tag name to a tag key
Definition: speckley/src/SpeckleyDomain.h:207
speckley::readBinaryGrid
escript::Data readBinaryGrid(std::string filename, escript::FunctionSpace fs, const object &pyShape, double fill, int byteOrder, int dataType, const object &pyFirst, const object &pyNum, const object &pyMultiplier, const object &pyReverse)
Definition: speckleycpp.cpp:61
weipa::SpeckleyDomain::initFromEscript
virtual bool initFromEscript(const escript::AbstractDomain *domain)
Initialises the domain using an escript domain instance.
Definition: weipa/src/SpeckleyDomain.cpp:50
MPI_COMM_WORLD
#define MPI_COMM_WORLD
Definition: EsysMPI.h:48
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
speckley::SpeckleyDomain::m_elementTags
std::vector< int > m_elementTags
Definition: speckley/src/SpeckleyDomain.h:764
paso::util::l2
double l2(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:530
weipa::SpeckleyDomain::getDataVarByName
virtual DataVar_ptr getDataVarByName(const std::string &name) const
Creates and returns a variable with domain data.
Definition: weipa/src/SpeckleyDomain.cpp:157
escript::FunctionSpace::getX
escript::Data getX() const
Returns the spatial locations of the data points.
Definition: FunctionSpace.cpp:229
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
speckley::tupleListToMap
void tupleListToMap(DataMap &mapping, const bp::list &list)
Definition: speckley/src/SpeckleyDomain.cpp:50
speckley::ReaderParameters::reverse
std::vector< int > reverse
if non-zero, values are written from last index to first index
Definition: speckley/src/SpeckleyDomain.h:76
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:72
speckley::SpeckleyDomain::readBinaryGridFromZipped
virtual void readBinaryGridFromZipped(escript::Data &out, std::string filename, const ReaderParameters &params) const =0
reads grid data from a compressed raw binary file into a Data object
finley::ReducedDegreesOfFreedom
@ ReducedDegreesOfFreedom
Definition: Finley.h:81
escript::ATP_ptr
boost::shared_ptr< AbstractTransportProblem > ATP_ptr
Definition: AbstractTransportProblem.h:175
escript::AbstractSystemMatrix
Base class for escript system matrices.
Definition: AbstractSystemMatrix.h:57
weipa::SpeckleyElements
Stores and manipulates one type of speckley mesh elements (cells, faces).
Definition: SpeckleyElements.h:45
speckley::DATATYPE_FLOAT32
@ DATATYPE_FLOAT32
Definition: speckley/src/system_dep.h:62
speckley::SpeckleyDomain::getX
virtual escript::Data getX() const
returns locations in the SEM nodes
Definition: speckley/src/SpeckleyDomain.cpp:437
escript::Data::getSampleDataRW
DataTypes::real_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
Return the sample data for the given sample no. Please do not use this unless you NEED to access samp...
Definition: Data.h:1954
speckley::isComplexCoef
bool isComplexCoef(const std::string target, const DataMap &mapping)
returns trure if the target data object is complex
Definition: speckley/src/domainhelpers.h:61
speckley::SpeckleyDomain::getMPISize
virtual int getMPISize() const
returns the number of processors used for this domain
Definition: speckley/src/SpeckleyDomain.h:124
weipa::ElementData_ptr
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:67
speckley::Brick
Brick is the 3-dimensional implementation of a SpeckleyDomain.
Definition: speckley/src/Brick.h:47
weipa::SpeckleyDomain::reorderGhostZones
virtual void reorderGhostZones(int ownIndex)
Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last.
Definition: weipa/src/SpeckleyDomain.cpp:212
speckley::SpeckleyDomain::writeBinaryGrid
virtual void writeBinaryGrid(const escript::Data &in, std::string filename, int byteOrder, int dataType) const =0
writes a Data object to a file in raw binary format
weipa::NODE_CENTERED
@ NODE_CENTERED
Definition: DomainChunk.h:32
speckley::SpeckleyDomain
SpeckleyDomain extends the AbstractContinuousDomain interface for the Speckley library and is the bas...
Definition: speckley/src/SpeckleyDomain.h:99
speckley::ReducedElements
@ ReducedElements
Definition: Speckley.h:81
speckley::SpeckleyDomain::MPIBarrier
virtual void MPIBarrier() const
if compiled for MPI then executes an MPI_Barrier, else does nothing
Definition: speckley/src/SpeckleyDomain.h:136
escript::Data::isEmpty
bool isEmpty() const
Definition: Data.cpp:1132
ripley::DoubleVector
std::vector< real_t > DoubleVector
Definition: Ripley.h:62
weipa::SpeckleyDomain::initialized
bool initialized
Definition: weipa/src/SpeckleyDomain.h:90
speckley::FaceElements
@ FaceElements
Definition: Speckley.h:82
speckley::SpeckleyDomain::isValidTagName
virtual bool isValidTagName(const std::string &name) const
returns true if name is a defined tag name
Definition: speckley/src/SpeckleyDomain.h:229
speckley::SpeckleyDomain::m_tagMap
TagMap m_tagMap
Definition: speckley/src/SpeckleyDomain.h:762
weipa::SpeckleyElements_ptr
boost::shared_ptr< SpeckleyElements > SpeckleyElements_ptr
Definition: SpeckleyElements.h:33
speckley::Rectangle
Rectangle is the 2-dimensional implementation of a SpeckleyDomain.
Definition: speckley/src/Rectangle.h:47
speckley::SpeckleyDomain::getTag
virtual int getTag(const std::string &name) const
returns the tag key for tag name
Definition: speckley/src/SpeckleyDomain.h:216
speckley::DegreesOfFreedom
@ DegreesOfFreedom
Definition: Speckley.h:76
dudley::ReducedElements
@ ReducedElements
Definition: Dudley.h:69
speckley::Elements
@ Elements
Definition: Speckley.h:80
weipa::SpeckleyDomain::getElementsForFunctionSpace
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const
Returns the element data for given function space code.
Definition: weipa/src/SpeckleyDomain.cpp:97
weipa::SpeckleyDomain::getVarNames
virtual StringVec getVarNames() const
Returns the names of all 'special' domain variables.
Definition: weipa/src/SpeckleyDomain.cpp:142
speckley::ReducedNodes
@ ReducedNodes
Definition: Speckley.h:79
escript::SubWorld_ptr
boost::shared_ptr< SubWorld > SubWorld_ptr
Definition: SubWorld.h:161
speckley::SpeckleyDomain::getDataShape
virtual std::pair< int, dim_t > getDataShape(int fsType) const
returns the number of data points per sample, and the number of samples as a pair.
Definition: speckley/src/SpeckleyDomain.cpp:126
MPI_MIN
#define MPI_MIN
Definition: EsysMPI.h:53
weipa::SpeckleyDomain::cells
SpeckleyElements_ptr cells
Definition: weipa/src/SpeckleyDomain.h:92
speckley::BYTEORDER_LITTLE_ENDIAN
@ BYTEORDER_LITTLE_ENDIAN
Definition: speckley/src/system_dep.h:56
weipa::SpeckleyDomain::getElementsByName
virtual ElementData_ptr getElementsByName(const std::string &name) const
Returns element data with given name.
Definition: weipa/src/SpeckleyDomain.cpp:189
weipa::SpeckleyDomain::nodes
SpeckleyNodes_ptr nodes
Definition: weipa/src/SpeckleyDomain.h:91
speckley::BYTEORDER_BIG_ENDIAN
@ BYTEORDER_BIG_ENDIAN
Definition: speckley/src/system_dep.h:57
speckley::ReaderParameters::dataType
int dataType
data type in the file (used by binary reader only)
Definition: speckley/src/SpeckleyDomain.h:80
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(speckleycpp)
Definition: speckleycpp.cpp:319
dudley::FaceElements
@ FaceElements
Definition: Dudley.h:70
escript::RuntimeErrorTranslator
void RuntimeErrorTranslator(const EsysException &e)
Function which translates an EsysException into a python RuntimeError.
Definition: ExceptionTranslators.cpp:51
weipa::SpeckleyDomain::removeGhostZones
virtual void removeGhostZones(int ownIndex)
Removes 'ghost' elements and nodes.
Definition: weipa/src/SpeckleyDomain.cpp:217
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:88
escript::Data::isExpanded
bool isExpanded() const
Return true if this Data is expanded.
Definition: Data.cpp:1111
speckley::ReaderParameters::multiplier
std::vector< int > multiplier
Definition: speckley/src/SpeckleyDomain.h:74
dudley::ReducedFaceElements
@ ReducedFaceElements
Definition: Dudley.h:71
speckley::SpeckleyDomain::readBinaryGrid
virtual void readBinaryGrid(escript::Data &out, std::string filename, const ReaderParameters &params) const =0
reads grid data from a raw binary file into a Data object
weipa::NodeData_ptr
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:69
weipa::StringVec
std::vector< std::string > StringVec
Definition: weipa.h:61
escript::FunctionSpace::getTypeCode
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:95
speckley::DEFAULT_ASSEMBLER
@ DEFAULT_ASSEMBLER
Definition: speckley/src/SpeckleyDomain.h:65
escript::FunctionSpace::getDim
int getDim() const
Return the number of spatial dimensions of the underlying domain.
Definition: FunctionSpace.h:197
speckley::SpeckleyDomain::getMPIRank
virtual int getMPIRank() const
returns the MPI rank of this processor
Definition: speckley/src/SpeckleyDomain.h:130
escript::function
FunctionSpace function(const AbstractDomain &domain)
Return a function FunctionSpace.
Definition: FunctionSpaceFactory.cpp:57
weipa::SpeckleyDomain::getNodes
virtual NodeData_ptr getNodes() const
Returns a pointer to the full nodes.
Definition: weipa/src/SpeckleyDomain.h:85
speckley::DiracPoint::node
dim_t node
Definition: speckley/src/SpeckleyDomain.h:89
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
speckley::ReaderParameters
Structure that wraps parameters for the grid reading routines.
Definition: speckley/src/SpeckleyDomain.h:66
speckley::SpeckleyDomain::getDim
virtual int getDim() const
returns the number of spatial dimensions of the domain
Definition: speckley/src/SpeckleyDomain.h:171
weipa::SpeckleyDomain::SpeckleyDomain
SpeckleyDomain()
Definition: weipa/src/SpeckleyDomain.cpp:36
speckley::Points
@ Points
Definition: Speckley.h:84
MPI_Comm
int MPI_Comm
Definition: EsysMPI.h:42
escript::Data::actsExpanded
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
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:64
speckley::IndexVector
std::vector< index_t > IndexVector
Definition: Speckley.h:61
speckley::ReaderParameters::numValues
std::vector< dim_t > numValues
the number of values to read from file
Definition: speckley/src/SpeckleyDomain.h:71
Speckley_DLL_API
#define Speckley_DLL_API
Definition: speckley/src/system_dep.h:23
speckley::SpeckleyDomain::getNumDataPointsGlobal
virtual dim_t getNumDataPointsGlobal() const =0
returns the number of data points summed across all MPI processes
escript::ASM_ptr
boost::shared_ptr< AbstractSystemMatrix > ASM_ptr
Definition: AbstractSystemMatrix.h:47
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:82
speckley::DiracPoint
A struct to contain a dirac point's information.
Definition: speckley/src/SpeckleyDomain.h:87
weipa::Centering
Centering
Definition: DomainChunk.h:31
escript::AbstractSystemMatrix::getRowBlockSize
int getRowBlockSize() const
returns the row block size
Definition: AbstractSystemMatrix.h:128
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
speckley::SpeckleyDomain::getSize
virtual escript::Data getSize() const
returns the element size
Definition: speckley/src/SpeckleyDomain.cpp:459
speckley::SpeckleyDomain::readNcGrid
virtual void readNcGrid(escript::Data &out, std::string filename, std::string varname, const ReaderParameters &params) const =0
reads grid data from a netCDF file into a Data object
speckley::DataMap
std::map< std::string, escript::Data > DataMap
Definition: speckley/src/domainhelpers.h:39
escript::Data::expand
void expand()
Whatever the current Data type make this into a DataExpanded.
Definition: Data.cpp:1180
escript::AbstractSystemMatrix::getColumnBlockSize
int getColumnBlockSize() const
returns the column block size
Definition: AbstractSystemMatrix.h:139
weipa::IntVec
std::vector< int > IntVec
Definition: weipa.h:60
weipa::SpeckleyDomain::getMeshForFunctionSpace
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const
Returns the node mesh for given function space code.
Definition: weipa/src/SpeckleyDomain.cpp:81
speckley::SpeckleyDomain::getSystemMatrixTypeId
virtual int getSystemMatrixTypeId(const boost::python::object &options) const
returns the identifier of the matrix type to be used for the global stiffness matrix when a particula...
Definition: speckley/src/SpeckleyDomain.cpp:722
escript::ValueError
An exception class that signals an invalid argument value.
Definition: EsysException.h:103
speckley::DiracPoint::tag
int tag
Definition: speckley/src/SpeckleyDomain.h:90
weipa::DataVar
A class that provides functionality to read an escript data object from a dump file or an escript::Da...
Definition: DataVar.h:36
escript::AbstractContinuousDomain
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:60
speckley::SpeckleyException
SpeckleyException exception class.
Definition: SpeckleyException.h:44
speckley::_brick
escript::Domain_ptr _brick(int order, double _n0, double _n1, double _n2, const object &l0, const object &l1, const object &l2, int d0, int d1, int d2, const object &objpoints, const object &objtags, escript::SubWorld_ptr world)
Definition: speckleycpp.cpp:143
escript::DataTypes::IndexVector
std::vector< index_t > IndexVector
Definition: DataTypes.h:91
weipa::SpeckleyNodes
Stores and manipulates speckley mesh nodes.
Definition: SpeckleyNodes.h:39
escript::AbstractContinuousDomain::addPDEToTransportProblem
virtual void addPDEToTransportProblem(AbstractTransportProblem &tp, escript::Data &source, const escript::Data &M, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y, const escript::Data &d, const escript::Data &y, const escript::Data &d_contact, const escript::Data &y_contact, const escript::Data &d_dirac, const escript::Data &y_dirac) const
adds a PDE onto a transport problem
Definition: AbstractContinuousDomain.cpp:166
speckley::SpeckleyDomain::addToSystemFromPython
virtual void addToSystemFromPython(escript::AbstractSystemMatrix &mat, escript::Data &rhs, const boost::python::list &data, Assembler_ptr assembler) const
a wrapper for addToSystem that allows calling from Python
Definition: speckley/src/SpeckleyDomain.cpp:747
speckley::Nodes
@ Nodes
Definition: Speckley.h:78
speckley::extractPyArray
std::vector< T > extractPyArray(const object &obj, const std::string &name, int expectedLength=0)
Definition: speckleycpp.cpp:36