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;
232 virtual void assembleIntegrate(std::vector<real_t>& integrals,
234 virtual void assembleIntegrate(std::vector<cplx_t>& integrals,
236 virtual std::vector<IndexVector> getConnections(
bool includeShared=
false)
const;
238 #ifdef ESYS_HAVE_TRILINOS 239 virtual esys_trilinos::const_TrilinosGraph_ptr getTrilinosGraph()
const;
242 #ifdef ESYS_HAVE_PASO 244 bool reducedRowOrder,
bool reducedColOrder)
const;
255 virtual void populateSampleIds();
256 virtual void populateDofMap();
258 template<
typename Scalar>
262 template<
typename Scalar>
264 const std::vector<Scalar>& EM_S,
const std::vector<Scalar>& EM_F,
265 bool addS,
bool addF,
index_t firstNode,
int nEq=1,
int nComp=1)
const;
267 template<
typename ValueType>
268 void readBinaryGridImpl(
escript::Data& out,
const std::string& filename,
271 #ifdef ESYS_HAVE_BOOST_IO 272 template<
typename ValueType>
277 template<
typename ValueType>
279 const std::string& filename,
int byteOrder)
const;
281 virtual dim_t findNode(
const double *coords)
const;
285 long seed,
const boost::python::tuple& filter)
const;
333 #ifdef ESYS_HAVE_PASO 338 #ifdef ESYS_HAVE_TRILINOS 339 mutable esys_trilinos::const_TrilinosGraph_ptr m_graph;
343 template<
typename Scalar>
344 void assembleIntegrateImpl(std::vector<Scalar>& integrals,
const escript::Data& arg)
const;
346 template <
typename S>
349 template <
typename S>
352 bool reduced, S sentinel)
const;
358 return m_dofMap[node];
363 return (m_gNE[0]+1)*(m_gNE[1]+1);
368 ESYS_ASSERT(dim>=0 && dim<2,
"'dim' out of bounds");
369 ESYS_ASSERT(index>=0 && index<m_NN[dim],
"'index' out of bounds");
370 return m_origin[dim]+m_dx[dim]*(m_offset[dim]+index);
375 return boost::python::make_tuple(
376 boost::python::make_tuple(m_origin[0], m_origin[1]),
377 boost::python::make_tuple(m_dx[0], m_dx[1]),
378 boost::python::make_tuple(m_gNE[0], m_gNE[1]));
384 return (m_gNE[0]+1)/m_NX[0]*(m_gNE[1]+1)/m_NX[1];
391 return (m_gNE[axis]+1)/m_NX[axis];
397 return m_NN[0]*m_NN[1];
403 return m_NE[0]*m_NE[1];
409 return m_faceCount[0] + m_faceCount[1] + m_faceCount[2] + m_faceCount[3];
415 return m_offset[axis] == 0 ? 0 : 1;
420 #endif // __RIPLEY_RECTANGLE_H__ virtual dim_t getNumDOF() const
returns the number of degrees of freedom per MPI rank
Definition: ripley/src/Rectangle.h:382
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:361
virtual dim_t getNumNodes() const
returns the number of nodes per MPI rank
Definition: ripley/src/Rectangle.h:395
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:324
IndexVector m_nodeId
Definition: ripley/src/Rectangle.h:323
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:401
IndexVector m_dofId
vector of sample reference identifiers
Definition: ripley/src/Rectangle.h:322
virtual dim_t getNumFaceElements() const
returns the number of face elements on current MPI rank
Definition: ripley/src/Rectangle.h:407
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:366
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:328
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:373
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:325
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:319
IndexVector m_dofMap
Definition: ripley/src/Rectangle.h:331
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:413
virtual dim_t getNumDOFInAxis(unsigned axis) const
Definition: ripley/src/Rectangle.h:388
virtual dim_t getDofOfNode(dim_t node) const
Definition: ripley/src/Rectangle.h:356
Base class for escript system matrices.
Definition: AbstractSystemMatrix.h:42
Definition: ripley/src/AbstractAssembler.h:25
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