17 #ifndef __RIPLEY_RECTANGLE_H__ 18 #define __RIPLEY_RECTANGLE_H__ 20 #include <ripley/RipleyDomain.h> 44 const std::vector<double>& points = std::vector<double>(),
45 const std::vector<int>& tags = std::vector<int>(),
60 virtual std::string getDescription()
const;
72 virtual void write(
const std::string& filename)
const;
79 void dump(
const std::string& filename)
const;
100 int byteOrder,
int dataType)
const;
107 const dim_t* borrowSampleReferenceIDs(
int fsType)
const;
113 virtual bool ownSample(
int fsType,
index_t id)
const;
134 virtual dim_t getNumDataPointsGlobal()
const;
141 virtual void Print_Mesh_Info(
const bool full=
false)
const;
178 virtual double getLocalCoordinate(
index_t index,
int dim)
const;
184 virtual boost::python::tuple getGridParameters()
const;
192 const boost::python::tuple& filter)
const;
198 virtual Assembler_ptr createAssembler(std::string type,
218 virtual RankVector getOwnerVector(
int fsType)
const;
221 virtual dim_t getNumNodes()
const;
222 virtual dim_t getNumElements()
const;
223 virtual dim_t getNumFaceElements()
const;
224 virtual dim_t getNumDOF()
const;
225 virtual dim_t getNumDOFInAxis(
unsigned axis)
const;
226 virtual index_t getFirstInDim(
unsigned axis)
const;
228 virtual IndexVector getDiagonalIndices(
bool upperOnly)
const;
234 virtual std::vector<IndexVector> getConnections(
bool includeShared=
false)
const;
236 #ifdef ESYS_HAVE_TRILINOS 237 virtual esys_trilinos::const_TrilinosGraph_ptr getTrilinosGraph()
const;
240 #ifdef ESYS_HAVE_PASO 242 bool reducedRowOrder,
bool reducedColOrder)
const;
252 virtual void populateSampleIds();
253 virtual void populateDofMap();
255 template<
typename Scalar>
257 const std::vector<Scalar>& EM_S,
const std::vector<Scalar>& EM_F,
258 bool addS,
bool addF,
index_t firstNode,
int nEq=1,
int nComp=1)
const;
260 template<
typename ValueType>
261 void readBinaryGridImpl(
escript::Data& out,
const std::string& filename,
264 #ifdef ESYS_HAVE_BOOST_IO 265 template<
typename ValueType>
270 template<
typename ValueType>
272 const std::string& filename,
int byteOrder)
const;
274 virtual dim_t findNode(
const double *coords)
const;
278 long seed,
const boost::python::tuple& filter)
const;
326 #ifdef ESYS_HAVE_PASO 331 #ifdef ESYS_HAVE_TRILINOS 332 mutable esys_trilinos::const_TrilinosGraph_ptr m_graph;
340 return m_dofMap[node];
345 return (m_gNE[0]+1)*(m_gNE[1]+1);
350 ESYS_ASSERT(dim>=0 && dim<2,
"'dim' out of bounds");
351 ESYS_ASSERT(index>=0 && index<m_NN[dim],
"'index' out of bounds");
352 return m_origin[dim]+m_dx[dim]*(m_offset[dim]+index);
357 return boost::python::make_tuple(
358 boost::python::make_tuple(m_origin[0], m_origin[1]),
359 boost::python::make_tuple(m_dx[0], m_dx[1]),
360 boost::python::make_tuple(m_gNE[0], m_gNE[1]));
366 return (m_gNE[0]+1)/m_NX[0]*(m_gNE[1]+1)/m_NX[1];
373 return (m_gNE[axis]+1)/m_NX[axis];
379 return m_NN[0]*m_NN[1];
385 return m_NE[0]*m_NE[1];
391 return m_faceCount[0] + m_faceCount[1] + m_faceCount[2] + m_faceCount[3];
397 return m_offset[axis] == 0 ? 0 : 1;
402 #endif // __RIPLEY_RECTANGLE_H__ virtual dim_t getNumDOF() const
returns the number of degrees of freedom per MPI rank
Definition: ripley/src/Rectangle.h:364
Definition: FunctionSpace.h:34
virtual dim_t getNumDataPointsGlobal() const
returns the number of data points summed across all MPI processes
Definition: ripley/src/Rectangle.h:343
virtual dim_t getNumNodes() const
returns the number of nodes per MPI rank
Definition: ripley/src/Rectangle.h:377
const double * getLength() const
returns the lengths of the domain
Definition: ripley/src/Rectangle.h:205
std::vector< int > RankVector
Definition: Ripley.h:45
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: ripleycpp.cpp:116
IndexVector m_elementId
Definition: ripley/src/Rectangle.h:317
IndexVector m_nodeId
Definition: ripley/src/Rectangle.h:316
virtual const dim_t * getNumFacesPerBoundary() const
returns the number of face elements in the order (left,right,bottom,top) on current MPI rank ...
Definition: ripley/src/Rectangle.h:160
Definition: ripley/src/WaveAssembler2D.h:24
Definition: LameAssembler2D.h:24
virtual dim_t getNumElements() const
returns the number of elements per MPI rank
Definition: ripley/src/Rectangle.h:383
IndexVector m_dofId
vector of sample reference identifiers
Definition: ripley/src/Rectangle.h:315
virtual dim_t getNumFaceElements() const
returns the number of face elements on current MPI rank
Definition: ripley/src/Rectangle.h:389
Definition: ripley/src/DefaultAssembler2D.h:24
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:42
virtual double getLocalCoordinate(index_t index, int dim) const
returns the index'th coordinate value in given dimension for this rank
Definition: ripley/src/Rectangle.h:348
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: ripleycpp.cpp:62
boost::shared_ptr< SystemMatrixPattern > SystemMatrixPattern_ptr
Definition: SystemMatrixPattern.h:39
IndexVector m_nodeDistribution
Definition: ripley/src/Rectangle.h:321
std::map< std::string, int > TagMap
Definition: Ripley.h:46
virtual boost::python::tuple getGridParameters() const
returns the tuple (origin, spacing, number_of_elements)
Definition: ripley/src/Rectangle.h:355
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
Rectangle is the 2-dimensional implementation of a RipleyDomain.
Definition: ripley/src/Rectangle.h:28
std::vector< index_t > IndexVector
Definition: Ripley.h:43
std::map< std::string, escript::Data > DataMap
Definition: ripley/src/domainhelpers.h:24
virtual const dim_t * getNumElementsPerDim() const
returns the number of elements per MPI rank in each dimension
Definition: ripley/src/Rectangle.h:153
boost::shared_ptr< SubWorld > SubWorld_ptr
Definition: SubWorld.h:146
Structure that wraps parameters for the grid reading routines.
Definition: ripley/src/RipleyDomain.h:68
virtual const int * getNumSubdivisionsPerDim() const
returns the number of spatial subdivisions in each dimension
Definition: ripley/src/Rectangle.h:172
virtual const dim_t * getNumNodesPerDim() const
returns the number of nodes per MPI rank in each dimension
Definition: ripley/src/Rectangle.h:147
Data represents a collection of datapoints.
Definition: Data.h:63
IndexVector m_faceId
Definition: ripley/src/Rectangle.h:318
RipleyDomain extends the AbstractContinuousDomain interface for the Ripley library and is the base cl...
Definition: ripley/src/RipleyDomain.h:101
IndexVector m_faceOffset
Definition: ripley/src/Rectangle.h:312
IndexVector m_dofMap
Definition: ripley/src/Rectangle.h:324
const double * getElementLength() const
returns the lengths of an element
Definition: ripley/src/Rectangle.h:211
virtual index_t getFirstInDim(unsigned axis) const
Definition: ripley/src/Rectangle.h:395
virtual dim_t getNumDOFInAxis(unsigned axis) const
Definition: ripley/src/Rectangle.h:370
virtual dim_t getDofOfNode(dim_t node) const
Definition: ripley/src/Rectangle.h:338
Base class for escript system matrices.
Definition: AbstractSystemMatrix.h:42
Definition: ripley/src/AbstractAssembler.h:25
std::vector< real_t > DoubleVector
Definition: Ripley.h:44
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: ripleycpp.cpp:87
Base class for all escript domains.
Definition: AbstractDomain.h:45
virtual IndexVector getNodeDistribution() const
returns the node distribution vector
Definition: ripley/src/Rectangle.h:166
#define ESYS_ASSERT(a, b)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false...
Definition: Assert.h:78
#define RIPLEY_DLL_API
Definition: ripley/src/system_dep.h:20
#define S(_J_, _I_)
Definition: ShapeFunctions.cpp:121
index_t dim_t
Definition: DataTypes.h:64