18#ifndef __SPECKLEY_RECTANGLE_H__
19#define __SPECKLEY_RECTANGLE_H__
21#include <speckley/SpeckleyDomain.h>
44 Rectangle(
int order, dim_t n0, dim_t n1,
double x0,
double y0,
45 double x1,
double y1,
int d0=-1,
int d1=-1,
46 const std::vector<double>& points = std::vector<double>(),
47 const std::vector<int>& tags = std::vector<int>(),
62 virtual std::string getDescription()
const;
74 virtual void write(
const std::string& filename)
const;
81 void dump(
const std::string& filename)
const;
85 virtual void readNcGrid(
escript::Data& out, std::string filename,
90 virtual void readBinaryGrid(
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 fs_code, 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;
199 virtual Assembler_ptr createAssembler(std::string type,
224 virtual dim_t getNumNodes()
const;
225 virtual dim_t getNumElements()
const;
226 virtual dim_t getNumDOF()
const;
228 virtual void balanceNeighbours(
escript::Data& data,
bool average)
const;
233 virtual void assembleIntegrate(std::vector<real_t>& integrals,
235 virtual void assembleIntegrate(std::vector<cplx_t>& integrals,
242 virtual dim_t getDofOfNode(dim_t node)
const;
246 template<
typename Scalar>
248 template<
typename Scalar>
250 template<
typename Scalar>
252 template<
typename Scalar>
254 template<
typename Scalar>
256 template<
typename Scalar>
258 template<
typename Scalar>
260 template<
typename Scalar>
262 template<
typename Scalar>
265 template<
typename Scalar>
267 template<
typename Scalar>
269 template<
typename Scalar>
271 template<
typename Scalar>
273 template<
typename Scalar>
275 template<
typename Scalar>
277 template<
typename Scalar>
279 template<
typename Scalar>
281 template<
typename Scalar>
284 template<
typename Scalar>
285 void integral_order2(std::vector<Scalar>&,
const escript::Data&)
const;
286 template<
typename Scalar>
287 void integral_order3(std::vector<Scalar>&,
const escript::Data&)
const;
288 template<
typename Scalar>
289 void integral_order4(std::vector<Scalar>&,
const escript::Data&)
const;
290 template<
typename Scalar>
291 void integral_order5(std::vector<Scalar>&,
const escript::Data&)
const;
292 template<
typename Scalar>
293 void integral_order6(std::vector<Scalar>&,
const escript::Data&)
const;
294 template<
typename Scalar>
295 void integral_order7(std::vector<Scalar>&,
const escript::Data&)
const;
296 template<
typename Scalar>
297 void integral_order8(std::vector<Scalar>&,
const escript::Data&)
const;
298 template<
typename Scalar>
299 void integral_order9(std::vector<Scalar>&,
const escript::Data&)
const;
300 template<
typename Scalar>
301 void integral_order10(std::vector<Scalar>&,
const escript::Data&)
const;
303 template<
typename Scalar>
304 void assembleIntegrateWorker(std::vector<Scalar>& integrals,
307 template<
typename Scalar>
312 template<
typename Scalar>
317 template<
typename Scalar>
318 void balanceNeighboursWorker(
escript::Data& data,
bool average)
const;
323 template<
typename Scalar>
328 template<
typename Scalar>
334 template<
typename Scalar>
335 void shareVertical(
escript::Data& out,
int rx,
int ry)
const;
344 void populateSampleIds();
346 template<
typename ValueType>
347 void readBinaryGridImpl(
escript::Data& out,
const std::string& filename,
350#ifdef ESYS_HAVE_BOOST_IO
351 template<
typename ValueType>
356 template<
typename ValueType>
358 const std::string& filename,
int byteOrder)
const;
360 dim_t findNode(
const double *coords)
const;
387 dim_t m_faceCount[4];
418 ESYS_ASSERT(dim>=0 && dim<2,
"'dim' out of bounds");
427 return boost::python::make_tuple(
429 boost::python::make_tuple(
m_dx[0],
m_dx[1]),
430 boost::python::make_tuple(
m_gNE[0],
m_gNE[1]));
#define ESYS_ASSERT(a, b)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false.
Definition Assert.h:79
Base class for all escript domains.
Definition AbstractDomain.h:51
Data represents a collection of datapoints.
Definition Data.h:64
Definition FunctionSpace.h:36
Definition speckley/src/DefaultAssembler2D.h:26
Rectangle is the 2-dimensional implementation of a SpeckleyDomain.
Definition speckley/src/Rectangle.h:34
virtual const dim_t * getNumElementsPerDim() const
returns the number of elements per MPI rank in each dimension
Definition speckley/src/Rectangle.h:155
dim_t m_offset[2]
first node on this rank is at (offset0,offset1) in global mesh
Definition speckley/src/Rectangle.h:384
dim_t m_gNE[2]
total number of elements in each dimension
Definition speckley/src/Rectangle.h:363
IndexVector m_nodeId
Definition speckley/src/Rectangle.h:391
double m_origin[2]
origin of domain
Definition speckley/src/Rectangle.h:366
virtual const dim_t * getNumNodesPerDim() const
returns the number of nodes per MPI rank in each dimension
Definition speckley/src/Rectangle.h:149
double m_dx[2]
grid spacings / cell sizes of domain
Definition speckley/src/Rectangle.h:372
dim_t m_NE[2]
number of elements for this rank in each dimension including shared
Definition speckley/src/Rectangle.h:378
IndexVector m_dofId
vector of sample reference identifiers
Definition speckley/src/Rectangle.h:390
virtual dim_t getNumNodes() const
returns the number of nodes per MPI rank
Definition speckley/src/Rectangle.h:440
IndexVector m_nodeDistribution
Definition speckley/src/Rectangle.h:395
dim_t m_NN[2]
number of nodes for this rank in each dimension
Definition speckley/src/Rectangle.h:381
IndexVector m_elementId
Definition speckley/src/Rectangle.h:392
virtual const dim_t * getNumFacesPerBoundary() const
returns the number of face elements in the order (left,right,bottom,top) on current MPI rank
Definition speckley/src/Rectangle.h:162
virtual IndexVector getNodeDistribution() const
returns the node distribution vector
Definition speckley/src/Rectangle.h:168
virtual dim_t getNumElements() const
returns the number of elements per MPI rank
Definition speckley/src/Rectangle.h:446
const double * getLength() const
returns the lengths of the domain
Definition speckley/src/Rectangle.h:221
virtual double getLocalCoordinate(index_t index, int dim) const
returns the index'th coordinate value in given dimension for this rank
Definition speckley/src/Rectangle.h:416
virtual dim_t getNumDOF() const
returns the number of degrees of freedom per MPI rank
Definition speckley/src/Rectangle.h:434
virtual dim_t getNumDataPointsGlobal() const
returns the number of data points summed across all MPI processes
Definition speckley/src/Rectangle.h:411
virtual boost::python::tuple getGridParameters() const
returns the tuple (origin, spacing, number_of_elements)
Definition speckley/src/Rectangle.h:425
virtual const int * getNumSubdivisionsPerDim() const
returns the number of spatial subdivisions in each dimension
Definition speckley/src/Rectangle.h:174
virtual escript::Data randomFill(const escript::DataTypes::ShapeType &shape, const escript::FunctionSpace &what, long seed, const boost::python::tuple &filter) const
Returns a Data object filled with random data passed through filter.
virtual dim_t getDofOfNode(dim_t node) const
Definition speckley/src/Rectangle.h:406
Definition CrossDomainCoupler.h:29
SpeckleyDomain extends the AbstractContinuousDomain interface for the Speckley library and is the bas...
Definition speckley/src/SpeckleyDomain.h:86
int m_order
element order (will be m_order + 1 quad points in each axis)
Definition speckley/src/SpeckleyDomain.h:755
Definition speckley/src/WaveAssembler2D.h:26
std::vector< int > ShapeType
The shape of a single datapoint.
Definition DataTypes.h:44
boost::shared_ptr< SubWorld > SubWorld_ptr
Definition SubWorld.h:147
Definition AbstractAssembler.cpp:19
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition CrossDomainCoupler.cpp:32
std::map< std::string, int > TagMap
Definition Speckley.h:46
std::vector< index_t > IndexVector
Definition Speckley.h:44
const double point_locations[][11]
Definition Speckley.h:71
std::map< std::string, escript::Data > DataMap
Definition speckley/src/domainhelpers.h:25
#define Speckley_DLL_API
Definition speckley/src/system_dep.h:23
Structure that wraps parameters for the grid reading routines.
Definition speckley/src/SpeckleyDomain.h:53