MultiBrick.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 __RIPLEY_MULTIBRICK_H__
#define __RIPLEY_MULTIBRICK_H__
#include <ripley/Brick.h>
namespace ripley {
class RIPLEY_DLL_API MultiBrick: public Brick
{
template<class Scalar> friend class DefaultAssembler3D;
friend class WaveAssembler3D;
friend class LameAssembler3D;
public:
MultiBrick(dim_t n0, dim_t n1, dim_t n2, double x0, double y0, double z0,
double x1, double y1, double z1, int d0=-1, int d1=-1, int d2=-1,
const std::vector<double>& points = std::vector<double>(),
const std::vector<int>& tags = std::vector<int>(),
const TagMap& tagnamestonums = TagMap(),
escript::SubWorld_ptr w=escript::SubWorld_ptr(),
unsigned int subdivisions = 1
);
~MultiBrick();
virtual void interpolateAcross(escript::Data& target,
const escript::Data& source) const;
void validateInterpolationAcross(int fsType_source,
const escript::AbstractDomain& domain, int fsType_target) const;
virtual std::string getDescription() const;
virtual bool operator==(const escript::AbstractDomain& other) const;
void dump(const std::string& filename) const;
virtual void readNcGrid(escript::Data& out, std::string filename,
std::string varname, const ReaderParameters& params) const;
virtual void readBinaryGrid(escript::Data& out, std::string filename,
const ReaderParameters& params) const;
virtual void readBinaryGridFromZipped(escript::Data& out, std::string filename,
const ReaderParameters& params) const;
virtual void writeBinaryGrid(const escript::Data& in,
std::string filename,
int byteOrder, int dataType) const;
const dim_t* borrowSampleReferenceIDs(int fsType) const;
virtual bool ownSample(int fsType, index_t id) const;
virtual void setToNormal(escript::Data& out) const;
virtual void setToSize(escript::Data& out) const;
virtual void Print_Mesh_Info(const bool full=false) const;
virtual unsigned int getNumSubdivisionsPerElement() const { return m_subdivisions; }
virtual const dim_t* getNumFacesPerBoundary() const { return m_faceCount; }
virtual IndexVector getNodeDistribution() const { return m_nodeDistribution; }
virtual const int* getNumSubdivisionsPerDim() const { return m_NX; }
virtual RankVector getOwnerVector(int fsType) const;
protected:
virtual IndexVector getDiagonalIndices(bool upperOnly) const;
virtual void interpolateNodesToNodesFiner(const escript::Data& source, escript::Data& target, const MultiBrick& other) const;
virtual void interpolateNodesToElementsFiner(const escript::Data& source, escript::Data& target, const MultiBrick& other) const;
virtual void interpolateElementsToElementsCoarser(const escript::Data& source, escript::Data& target, const MultiBrick& other) const;
virtual void interpolateElementsToElementsFiner(const escript::Data& source, escript::Data& target, const MultiBrick& other) const;
virtual void interpolateReducedToElementsFiner(const escript::Data& source, escript::Data& target, const MultiBrick& other) const;
virtual void interpolateReducedToReducedFiner(const escript::Data& source, escript::Data& target, const MultiBrick& other) const;
virtual void populateSampleIds();
virtual std::vector<IndexVector> getConnections(bool includeShared) const;
dim_t findNode(const double *coords) const;
const unsigned int m_subdivisions;
private:
template <typename S>
void interpolateNodesToNodesFinerWorker(const escript::Data& source, escript::Data& target, const MultiBrick& other, S sentinel) const;
template <typename S>
void interpolateNodesToElementsFinerWorker(const escript::Data& source, escript::Data& target, const MultiBrick& other, S sentinel) const;
template <typename S>
void interpolateElementsToElementsCoarserWorker(const escript::Data& source, escript::Data& target, const MultiBrick& other, S sentinel) const;
template <typename S>
void interpolateElementsToElementsFinerWorker(const escript::Data& source, escript::Data& target, const MultiBrick& other, S sentinel) const;
template <typename S>
void interpolateReducedToElementsFinerWorker(const escript::Data& source, escript::Data& target, const MultiBrick& other, S sentinel) const;
template <typename S>
void interpolateReducedToReducedFinerWorker(const escript::Data& source, escript::Data& target, const MultiBrick& other, S sentinel) const;
};
} // end of namespace ripley
#endif // __RIPLEY_MULTIBRICK_H__
S
#define S(_J_, _I_)
Definition: ShapeFunctions.cpp:122
escript::AbstractDomain
Base class for all escript domains.
Definition: AbstractDomain.h:51
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
ripley::Brick
Brick is the 3-dimensional implementation of a RipleyDomain.
Definition: ripley/src/Brick.h:35
ripley::DefaultAssembler3D
Definition: ripley/src/DefaultAssembler3D.h:26
ripley::LameAssembler3D
Definition: LameAssembler3D.h:26
ripley::MultiBrick
Brick is the 3-dimensional implementation of a RipleyDomain.
Definition: MultiBrick.h:30
ripley::MultiBrick::getNumSubdivisionsPerDim
virtual const int * getNumSubdivisionsPerDim() const
returns the number of spatial subdivisions in each dimension
Definition: MultiBrick.h:168
ripley::MultiBrick::getNumFacesPerBoundary
virtual const dim_t * getNumFacesPerBoundary() const
returns the number of face elements in the order (left,right,bottom,top,front,back) on current MPI ra...
Definition: MultiBrick.h:156
ripley::MultiBrick::getNumSubdivisionsPerElement
virtual unsigned int getNumSubdivisionsPerElement() const
returns the number of times each root element has been subdivided
Definition: MultiBrick.h:149
ripley::MultiBrick::getNodeDistribution
virtual IndexVector getNodeDistribution() const
returns the node distribution vector
Definition: MultiBrick.h:162
ripley::MultiBrick::m_subdivisions
const unsigned int m_subdivisions
Definition: MultiBrick.h:193
ripley::WaveAssembler3D
Definition: ripley/src/WaveAssembler3D.h:26
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
escript::SubWorld_ptr
boost::shared_ptr< SubWorld > SubWorld_ptr
Definition: SubWorld.h:147
ripley
Definition: ripley/src/AbstractAssembler.h:26
ripley::IndexVector
std::vector< index_t > IndexVector
Definition: Ripley.h:44
ripley::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: ripleycpp.cpp:63
ripley::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: ripleycpp.cpp:117
ripley::TagMap
std::map< std::string, int > TagMap
Definition: Ripley.h:47
ripley::RankVector
std::vector< int > RankVector
Definition: Ripley.h:46
ripley::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: ripleycpp.cpp:88
RIPLEY_DLL_API
#define RIPLEY_DLL_API
Definition: ripley/src/system_dep.h:21
ripley::ReaderParameters
Structure that wraps parameters for the grid reading routines.
Definition: ripley/src/RipleyDomain.h:70