17 #ifndef __RIPLEY_RECTANGLE_H__ 18 #define __RIPLEY_RECTANGLE_H__ 20 #include <paso/Coupler.h> 21 #include <ripley/RipleyDomain.h> 45 const std::vector<double>& points = std::vector<double>(),
46 const std::vector<int>& tags = std::vector<int>(),
61 virtual std::string getDescription()
const;
73 virtual void write(
const std::string& filename)
const;
80 void dump(
const std::string& filename)
const;
94 virtual void readBinaryGridFromZipped(
escript::Data& out, std::string filename,
101 std::string filename,
102 int byteOrder,
int dataType)
const;
109 const dim_t* borrowSampleReferenceIDs(
int fsType)
const;
115 virtual bool ownSample(
int fsType,
index_t id)
const;
136 virtual dim_t getNumDataPointsGlobal()
const;
143 virtual void Print_Mesh_Info(
const bool full=
false)
const;
180 virtual double getLocalCoordinate(
index_t index,
int dim)
const;
186 virtual boost::python::tuple getGridParameters()
const;
194 const boost::python::tuple& filter)
const;
200 virtual Assembler_ptr createAssembler(std::string type,
220 virtual RankVector getOwnerVector(
int fsType)
const;
223 virtual dim_t getNumNodes()
const;
224 virtual dim_t getNumElements()
const;
225 virtual dim_t getNumFaceElements()
const;
226 virtual dim_t getNumDOF()
const;
227 virtual dim_t getNumDOFInAxis(
unsigned axis)
const;
228 virtual index_t getFirstInDim(
unsigned axis)
const;
230 virtual IndexVector getDiagonalIndices(
bool upperOnly)
const;
237 bool reducedRowOrder,
bool reducedColOrder)
const;
247 virtual void populateSampleIds();
248 virtual void populateDofMap();
249 virtual std::vector<IndexVector> getConnections()
const;
252 bool addS,
bool addF,
index_t firstNode,
int nEq=1,
int nComp=1)
const;
254 template<
typename ValueType>
255 void readBinaryGridImpl(
escript::Data& out,
const std::string& filename,
258 template<
typename ValueType>
262 template<
typename ValueType>
264 const std::string& filename,
int byteOrder)
const;
266 virtual dim_t findNode(
const double *coords)
const;
270 long seed,
const boost::python::tuple& filter)
const;
329 return m_dofMap[node];
334 return (m_gNE[0]+1)*(m_gNE[1]+1);
339 EsysAssert((dim>=0 && dim<2),
"'dim' out of bounds");
340 EsysAssert((index>=0 && index<m_NN[dim]),
"'index' out of bounds");
341 return m_origin[dim]+m_dx[dim]*(m_offset[dim]+index);
346 return boost::python::make_tuple(
347 boost::python::make_tuple(m_origin[0], m_origin[1]),
348 boost::python::make_tuple(m_dx[0], m_dx[1]),
349 boost::python::make_tuple(m_gNE[0], m_gNE[1]));
355 return (m_gNE[0]+1)/m_NX[0]*(m_gNE[1]+1)/m_NX[1];
361 EsysAssert((axis < m_numDim),
"Invalid axis");
362 return (m_gNE[axis]+1)/m_NX[axis];
368 return m_NN[0]*m_NN[1];
374 return m_NE[0]*m_NE[1];
380 return m_faceCount[0] + m_faceCount[1] + m_faceCount[2] + m_faceCount[3];
386 return m_offset[axis] == 0 ? 0 : 1;
391 #endif // __RIPLEY_RECTANGLE_H__ Definition: FunctionSpace.h:34
virtual dim_t getNumFaceElements() const
returns the number of face elements on current MPI rank
Definition: ripley/src/Rectangle.h:378
virtual const int * getNumSubdivisionsPerDim() const
returns the number of spatial subdivisions in each dimension
Definition: ripley/src/Rectangle.h:174
virtual dim_t getNumNodes() const
returns the number of nodes per MPI rank
Definition: ripley/src/Rectangle.h:366
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:117
IndexVector m_elementId
Definition: ripley/src/Rectangle.h:309
IndexVector m_nodeId
Definition: ripley/src/Rectangle.h:308
virtual boost::python::tuple getGridParameters() const
returns the tuple (origin, spacing, number_of_elements)
Definition: ripley/src/Rectangle.h:344
Definition: ripley/src/WaveAssembler2D.h:24
virtual const dim_t * getNumElementsPerDim() const
returns the number of elements per MPI rank in each dimension
Definition: ripley/src/Rectangle.h:155
Definition: LameAssembler2D.h:24
virtual dim_t getNumElements() const
returns the number of elements per MPI rank
Definition: ripley/src/Rectangle.h:372
const double * getLength() const
returns the lengths of the domain
Definition: ripley/src/Rectangle.h:207
virtual index_t getFirstInDim(unsigned axis) const
Definition: ripley/src/Rectangle.h:384
IndexVector m_dofId
vector of sample reference identifiers
Definition: ripley/src/Rectangle.h:307
Definition: ripley/src/DefaultAssembler2D.h:24
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:38
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:162
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:65
boost::shared_ptr< SystemMatrixPattern > SystemMatrixPattern_ptr
Definition: SystemMatrixPattern.h:38
IndexVector m_nodeDistribution
Definition: ripley/src/Rectangle.h:313
std::map< std::string, int > TagMap
Definition: Ripley.h:41
virtual IndexVector getNodeDistribution() const
returns the node distribution vector
Definition: ripley/src/Rectangle.h:168
virtual dim_t getNumDOF() const
returns the number of degrees of freedom per MPI rank
Definition: ripley/src/Rectangle.h:353
Rectangle is the 2-dimensional implementation of a RipleyDomain.
Definition: ripley/src/Rectangle.h:29
std::vector< index_t > IndexVector
Definition: Ripley.h:38
virtual const dim_t * getNumNodesPerDim() const
returns the number of nodes per MPI rank in each dimension
Definition: ripley/src/Rectangle.h:149
virtual dim_t getNumDataPointsGlobal() const
returns the number of data points summed across all MPI processes
Definition: ripley/src/Rectangle.h:332
std::map< std::string, escript::Data > DataMap
Definition: ripley/src/domainhelpers.h:24
boost::shared_ptr< SubWorld > SubWorld_ptr
Definition: SubWorld.h:142
Structure that wraps parameters for the grid reading routines.
Definition: ripley/src/RipleyDomain.h:52
Data represents a collection of datapoints.
Definition: Data.h:68
#define EsysAssert(AssertTest, AssertMessage)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false...
Definition: EsysAssert.h:96
const double * getElementLength() const
returns the lengths of an element
Definition: ripley/src/Rectangle.h:213
IndexVector m_faceId
Definition: ripley/src/Rectangle.h:310
RipleyDomain extends the AbstractContinuousDomain interface for the Ripley library and is the base cl...
Definition: ripley/src/RipleyDomain.h:85
IndexVector m_faceOffset
Definition: ripley/src/Rectangle.h:304
IndexVector m_dofMap
Definition: ripley/src/Rectangle.h:316
int index_t
Definition: types.h:24
std::vector< Esys_MPI_rank > RankVector
Definition: Ripley.h:40
virtual dim_t getDofOfNode(dim_t node) const
Definition: ripley/src/Rectangle.h:327
boost::shared_ptr< Connector > Connector_ptr
Definition: Coupler.h:35
index_t dim_t
Definition: types.h:27
Base class for escript system matrices.
Definition: AbstractSystemMatrix.h:37
Definition: ripley/src/AbstractAssembler.h:25
paso::Connector_ptr m_connector
Definition: ripley/src/Rectangle.h:320
Base class for all escript domains.
Definition: AbstractDomain.h:45
#define RIPLEY_DLL_API
Definition: ripley/src/system_dep.h:22
virtual dim_t getNumDOFInAxis(unsigned axis) const
Definition: ripley/src/Rectangle.h:359
paso::SystemMatrixPattern_ptr m_pattern
Definition: ripley/src/Rectangle.h:323
#define S(_J_, _I_)
Definition: ShapeFunctions.cpp:121
std::vector< double > DoubleVector
Definition: Ripley.h:39
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:337