CrossDomainCoupler.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 __SPECKLEY_CROSSDOMAINCOUPLER_H__
#define __SPECKLEY_CROSSDOMAINCOUPLER_H__
#include <speckley/Brick.h>
#include <speckley/Rectangle.h>
#include <ripley/Brick.h>
#include <ripley/Rectangle.h>
namespace speckley {
class RipleyCoupler {
public:
RipleyCoupler(const SpeckleyDomain *speck, const double s_dx[2], int rank);
void interpolate(escript::Data& target, const escript::Data& source) const;
private:
// a struct type to hold all the relevant info on the target domain
struct Ripley {
const ripley::RipleyDomain *domain;
double dx[3];
dim_t NE[3];
dim_t mins[3];
dim_t maxs[3];
};
void calculateOrder2(int dim, double loc, double *results) const;
void calculateOrder3(int dim, double loc, double *results) const;
void calculateOrder4(int dim, double loc, double *results) const;
void calculateOrder5(int dim, double loc, double *results) const;
void calculateOrder6(int dim, double loc, double *results) const;
void calculateOrder7(int dim, double loc, double *results) const;
void calculateOrder8(int dim, double loc, double *results) const;
void calculateOrder9(int dim, double loc, double *results) const;
void calculateOrder10(int dim, double loc, double *results) const;
void generateLocations(struct Ripley& r, double **positions) const;
bool validInterpolation(escript::Data& target, const escript::Data& source,
const SpeckleyDomain *speck, const double *s_dx,
const ripley::RipleyDomain *other) const;
void calculate(struct Ripley& r, dim_t ex, dim_t ey, dim_t ez,
int oqx, int oqy, int oqz, double *out, const double *factor_x,
const double *factor_y, const double *factor_z,
const escript::Data& source) const;
void shareWithNeighbours(bool lowerFirst, int hasLower, int hasUpper,
double *bottom, double *top, double *brecv, double *trecv,
int bSize, int tSize, int distance) const;
void getEdgeSpacing(struct Ripley r, int *lower, int *upper) const;
void shareBrickXFaces(struct Ripley& r, int hasLower,
int hasUpper, int lower, int upper, escript::Data& target) const;
void shareBrickYFaces(struct Ripley& r, int hasLower,
int hasUpper, int lower, int upper, escript::Data& target) const;
void shareBrickZFaces(struct Ripley& r, int hasLower,
int hasUpper, int lower, int upper, escript::Data& target) const;
void shareRectangleXEdges(struct Ripley& r, int hasLower,
int hasUpper, int lower, int upper, escript::Data& target) const;
void shareRectangleYEdges(struct Ripley& r, int hasLower,
int hasUpper, int lower, int upper, escript::Data& target) const;
//speckley info
const SpeckleyDomain *speck;
dim_t s_NE[3];
double s_dx[3];
int s_NX[3];
double speckley_origin[3];
int order;
int numQuads;
//coupling info
bool hasLower[3];
bool hasUpper[3];
//per interpolation
mutable int numComp;
#ifdef ESYS_MPI
int rank;
MPI_Comm comm;
#endif
};
void interpolateAcross3D(escript::Data& target, const escript::Data& source,
const Brick *speck, const double s_dx[3], int rank,
MPI_Comm comm);
bool probeInterpolationAcross(int fsType_source,
const escript::AbstractDomain& domain, int fsType_target, int dim);
} // end of namespace speckley
#endif // __SPECKLEY_CROSSDOMAINCOUPLER_H__
MPI_Comm
int MPI_Comm
Definition: EsysMPI.h:44
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::RipleyDomain
RipleyDomain extends the AbstractContinuousDomain interface for the Ripley library and is the base cl...
Definition: ripley/src/RipleyDomain.h:103
speckley::Brick
Brick is the 3-dimensional implementation of a SpeckleyDomain.
Definition: speckley/src/Brick.h:34
speckley::RipleyCoupler
Definition: CrossDomainCoupler.h:29
speckley::RipleyCoupler::s_NX
int s_NX[3]
Definition: CrossDomainCoupler.h:85
speckley::RipleyCoupler::numComp
int numComp
Definition: CrossDomainCoupler.h:95
speckley::RipleyCoupler::s_NE
dim_t s_NE[3]
Definition: CrossDomainCoupler.h:83
speckley::RipleyCoupler::interpolate
void interpolate(escript::Data &target, const escript::Data &source) const
Definition: CrossDomainCoupler.cpp:453
speckley::RipleyCoupler::calculateOrder2
void calculateOrder2(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:259
speckley::RipleyCoupler::shareBrickXFaces
void shareBrickXFaces(struct Ripley &r, int hasLower, int hasUpper, int lower, int upper, escript::Data &target) const
Definition: CrossDomainCoupler.cpp:552
speckley::RipleyCoupler::speck
const SpeckleyDomain * speck
Definition: CrossDomainCoupler.h:82
speckley::RipleyCoupler::calculateOrder7
void calculateOrder7(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:319
speckley::RipleyCoupler::calculateOrder4
void calculateOrder4(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:280
speckley::RipleyCoupler::s_dx
double s_dx[3]
Definition: CrossDomainCoupler.h:84
speckley::RipleyCoupler::calculateOrder8
void calculateOrder8(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:334
speckley::RipleyCoupler::numQuads
int numQuads
Definition: CrossDomainCoupler.h:88
speckley::RipleyCoupler::RipleyCoupler
RipleyCoupler(const SpeckleyDomain *speck, const double s_dx[2], int rank)
Definition: CrossDomainCoupler.cpp:46
speckley::RipleyCoupler::getEdgeSpacing
void getEdgeSpacing(struct Ripley r, int *lower, int *upper) const
Definition: CrossDomainCoupler.cpp:385
speckley::RipleyCoupler::generateLocations
void generateLocations(struct Ripley &r, double **positions) const
Definition: CrossDomainCoupler.cpp:133
speckley::RipleyCoupler::calculateOrder10
void calculateOrder10(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:367
speckley::RipleyCoupler::calculate
void calculate(struct Ripley &r, dim_t ex, dim_t ey, dim_t ez, int oqx, int oqy, int oqz, double *out, const double *factor_x, const double *factor_y, const double *factor_z, const escript::Data &source) const
Definition: CrossDomainCoupler.cpp:409
speckley::RipleyCoupler::hasLower
bool hasLower[3]
Definition: CrossDomainCoupler.h:91
speckley::RipleyCoupler::speckley_origin
double speckley_origin[3]
Definition: CrossDomainCoupler.h:86
speckley::RipleyCoupler::shareRectangleXEdges
void shareRectangleXEdges(struct Ripley &r, int hasLower, int hasUpper, int lower, int upper, escript::Data &target) const
Definition: CrossDomainCoupler.cpp:822
speckley::RipleyCoupler::validInterpolation
bool validInterpolation(escript::Data &target, const escript::Data &source, const SpeckleyDomain *speck, const double *s_dx, const ripley::RipleyDomain *other) const
Definition: CrossDomainCoupler.cpp:75
speckley::RipleyCoupler::shareRectangleYEdges
void shareRectangleYEdges(struct Ripley &r, int hasLower, int hasUpper, int lower, int upper, escript::Data &target) const
Definition: CrossDomainCoupler.cpp:900
speckley::RipleyCoupler::order
int order
Definition: CrossDomainCoupler.h:87
speckley::RipleyCoupler::shareBrickZFaces
void shareBrickZFaces(struct Ripley &r, int hasLower, int hasUpper, int lower, int upper, escript::Data &target) const
Definition: CrossDomainCoupler.cpp:753
speckley::RipleyCoupler::shareWithNeighbours
void shareWithNeighbours(bool lowerFirst, int hasLower, int hasUpper, double *bottom, double *top, double *brecv, double *trecv, int bSize, int tSize, int distance) const
Definition: CrossDomainCoupler.cpp:960
speckley::RipleyCoupler::calculateOrder3
void calculateOrder3(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:269
speckley::RipleyCoupler::hasUpper
bool hasUpper[3]
Definition: CrossDomainCoupler.h:92
speckley::RipleyCoupler::shareBrickYFaces
void shareBrickYFaces(struct Ripley &r, int hasLower, int hasUpper, int lower, int upper, escript::Data &target) const
Definition: CrossDomainCoupler.cpp:669
speckley::RipleyCoupler::calculateOrder9
void calculateOrder9(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:350
speckley::RipleyCoupler::calculateOrder6
void calculateOrder6(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:305
speckley::RipleyCoupler::calculateOrder5
void calculateOrder5(int dim, double loc, double *results) const
Definition: CrossDomainCoupler.cpp:292
speckley::SpeckleyDomain
SpeckleyDomain extends the AbstractContinuousDomain interface for the Speckley library and is the bas...
Definition: speckley/src/SpeckleyDomain.h:86
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
speckley
Definition: AbstractAssembler.cpp:19
speckley::probeInterpolationAcross
bool probeInterpolationAcross(int fsType_source, const escript::AbstractDomain &domain, int fsType_target, int dim)
Definition: CrossDomainCoupler.cpp:32
speckley::interpolateAcross3D
void interpolateAcross3D(escript::Data &target, const escript::Data &source, const Brick *speck, const double s_dx[3], int rank, MPI_Comm comm)
interpolates data given on source onto target where source and target are given on different domains
speckley::RipleyCoupler::Ripley
Definition: CrossDomainCoupler.h:37
speckley::RipleyCoupler::Ripley::NE
dim_t NE[3]
Definition: CrossDomainCoupler.h:40
speckley::RipleyCoupler::Ripley::dx
double dx[3]
Definition: CrossDomainCoupler.h:39
speckley::RipleyCoupler::Ripley::domain
const ripley::RipleyDomain * domain
Definition: CrossDomainCoupler.h:38
speckley::RipleyCoupler::Ripley::mins
dim_t mins[3]
Definition: CrossDomainCoupler.h:41
speckley::RipleyCoupler::Ripley::maxs
dim_t maxs[3]
Definition: CrossDomainCoupler.h:42