18 #if !defined finley_MeshAdapter_20040526_H
19 #define finley_MeshAdapter_20040526_H
22 #include "finley/Mesh.h"
23 #include "finley/Finley.h"
24 #include "finley/Assemble.h"
27 #include <pasowrap/SystemMatrixAdapter.h>
28 #include <pasowrap/TransportProblemAdapter.h>
29 #include "escript/AbstractContinuousDomain.h"
30 #include "escript/FunctionSpace.h"
31 #include "escript/FunctionSpaceFactory.h"
33 #include <boost/shared_ptr.hpp>
34 #include <boost/python/dict.hpp>
35 #include <boost/python/extract.hpp>
49 double l0,
double l1,
double l2,
50 bool periodic0,
bool periodic1,
bool periodic2,
51 int integrationOrder,
int reducedIntegrationOrder,
52 bool useElementsOnFace,
bool useFullElementOrder,
53 bool optimize,
const std::vector<double>& points,
54 const std::vector<int>& tags,
55 const std::map<std::string, int>& tagnamestonums);
60 bool periodic0,
bool periodic1,
61 int integrationOrder,
int reducedIntegrationOrder,
62 bool useElementsOnFace,
bool useFullElementOrder,
63 bool optimize,
const std::vector<double>& points,
64 const std::vector<int>& tags,
65 const std::map<std::string, int>& tagnamestonums);
181 void write(
const std::string& fileName)
const;
196 void dump(
const std::string& fileName)
const;
351 virtual int getDim()
const;
378 virtual std::pair<int,int>
getDataShape(
int functionSpaceCode)
const;
395 virtual void setTagMap(
const std::string& name,
int tag);
403 virtual int getTag(
const std::string& name)
const;
508 virtual int getSystemMatrixTypeId(
const int solver,
const int preconditioner,
const int package,
const bool symmetry)
const;
520 virtual int getTransportTypeId(
const int solver,
const int preconditioner,
const int package,
const bool symmetry)
const;
563 const bool useHRZ)
const;
594 const int row_blocksize,
596 const int column_blocksize,
598 const int type)
const;
609 const int type)
const;
643 virtual void setTags(
const int functionSpaceType,
const int newTag,
const escript::Data& mask)
const;
661 bool canTag(
int functionSpaceCode)
const;
689 void addDiracPoints(
const std::vector<double>& points,
const std::vector<int>& tags)
const;
712 double l0,
double l1,
double l2,
713 bool periodic0,
bool periodic1,
bool periodic2,
714 int integrationOrder,
715 int reducedIntegrationOrder,
716 bool useElementsOnFace,
717 bool useFullElementOrder,
719 const std::vector<double>& points,
720 const std::vector<int>& tags,
721 const std::map<std::string, int>& tagnamestonums);
725 double l0,
double l1,
726 bool periodic0,
bool periodic1,
727 int integrationOrder,
728 int reducedIntegrationOrder,
729 bool useElementsOnFace,
730 bool useFullElementOrder,
732 const std::vector<double>& points,
733 const std::vector<int>& tags,
734 const std::map<std::string, int>& tagnamestonums);
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:46
static const int ReducedFaceElements
Definition: finley/src/CPPAdapter/MeshAdapter.h:93
Give a short description of what FunctionSpace does.
Definition: FunctionSpace.h:46
virtual void setToNormal(escript::Data &out) const
copies the surface normals at data points into out. The actual function space to be considered is def...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1155
double l2(dim_t n, const double *x, Esys_MPIInfo *mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:484
virtual void setToGradient(escript::Data &grad, const escript::Data &arg) const
copies the gradient of arg into grad. The actual function space to be considered for the gradient is ...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1271
static const int ReducedDegreesOfFreedom
Definition: finley/src/CPPAdapter/MeshAdapter.h:87
virtual int getMPIRank() const
return the number MPI rank of this processor
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:80
MeshAdapter(Mesh *finleyMesh=0)
Constructor for MeshAdapter.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:51
virtual int getReducedSolutionCode() const
Return a ReducedSolution code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:618
virtual int getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const
return the identifier of the matrix type to be used for the global stiffness matrix when a particular...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1845
static FunctionSpaceNamesMapType m_functionSpaceTypeNames
Definition: finley/src/CPPAdapter/MeshAdapter.h:709
friend escript::Domain_ptr brick(int n0, int n1, int n2, int order, double l0, double l1, double l2, bool periodic0, bool periodic1, bool periodic2, int integrationOrder, int reducedIntegrationOrder, bool useElementsOnFace, bool useFullElementOrder, bool optimize, const std::vector< double > &points, const std::vector< int > &tags, const std::map< std::string, int > &tagnamestonums)
Creates a rectangular mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0...
Definition: finley/src/CPPAdapter/MeshAdapterFactory.cpp:523
virtual int getFunctionOnContactOneCode() const
Return a FunctionOnContactOne code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:603
virtual int getReducedFunctionOnBoundaryCode() const
Return a function on boundary with reduced integration order FunctionSpace code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:588
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:57
void dump(const std::string &fileName) const
dumps the mesh to a file with the given name.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:127
virtual void addPDEToSystem(escript::AbstractSystemMatrix &mat, escript::Data &rhs, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y, const escript::Data &d, const escript::Data &y, const escript::Data &d_contact, const escript::Data &y_contact, const escript::Data &d_dirac, const escript::Data &y_dirac) const
returns the function space representation of the type functionSpaceCode on this domain as a vtkObject...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:742
virtual bool operator!=(const escript::AbstractDomain &other) const
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1840
~MeshAdapter()
Destructor for MeshAdapter. As specified in the constructor this calls Finley_Mesh_free for the point...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:67
virtual escript::Data getX() const
returns locations in the FEM nodes
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1859
virtual void setToIntegrals(std::vector< double > &integrals, const escript::Data &arg) const
copies the integrals of the function defined by arg into integrals. arg has to be defined on this...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1213
static const int Nodes
Definition: finley/src/CPPAdapter/MeshAdapter.h:88
Definition: finley/src/CPPAdapter/MeshAdapter.h:67
virtual int getReducedFunctionOnContactOneCode() const
Return a FunctionOnContactOne code with reduced integration order.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:608
void addDiracPoints(const std::vector< double > &points, const std::vector< int > &tags) const
adds points to support more Dirac delta function.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2178
bool commonFunctionSpace(const std::vector< int > &fs, int &resultcode) const
given a vector of FunctionSpace typecodes, pass back a code which then can all be interpolated to...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1537
void setFunctionSpaceTypeNames()
Build the table of function space type names.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:533
int getTagFromSampleNo(int functionSpaceType, int sampleNo) const
Return the tag key for the given sample number.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1916
static const int ContactElementsOne
Definition: finley/src/CPPAdapter/MeshAdapter.h:97
void Print_Mesh_Info(const bool full=false) const
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:122
bool supportsContactElements() const
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2160
virtual int getNumDataPointsGlobal() const
Return the number of data points summed across all MPI processes.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:640
static const int Elements
Definition: finley/src/CPPAdapter/MeshAdapter.h:90
virtual void addPDEToLumpedSystem(escript::Data &mat, const escript::Data &D, const escript::Data &d, const escript::Data &d_dirac, const bool useHRZ) const
adds a PDE onto the lumped stiffness matrix matrix
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:775
virtual int getNumberOfTagsInUse(int functionSpaceCode) const
return the number of tags in use and a pointer to an array with the number of tags in use ...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2033
virtual void addPDEToRHS(escript::Data &rhs, const escript::Data &X, const escript::Data &Y, const escript::Data &y, const escript::Data &y_contact, const escript::Data &y_dirac) const
adds a PDE onto the stiffness matrix mat and a rhs
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:793
virtual int getContinuousFunctionCode() const
Return a continuous FunctionSpace code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:563
virtual std::string functionSpaceTypeAsString(int functionSpaceType) const
Return a description for the given function space type code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:515
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:38
static dim_t M
Definition: SparseMatrix_saveHB.cpp:36
virtual bool ownSample(int fs_code, index_t id) const
True if this rank owns the sample(id) Must be implemented by the Domain adapter.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1394
virtual bool isCellOriented(int functionSpaceCode) const
returns true if data on this domain and a function space of type functionSpaceCode has to considered ...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1510
implements the AbstractContinuousDomain interface for the Finley library.
Definition: finley/src/CPPAdapter/MeshAdapter.h:80
static const int ReducedElements
Definition: finley/src/CPPAdapter/MeshAdapter.h:91
escript::Domain_ptr rectangle(int n0, int n1, int order, double l0, double l1, bool periodic0, bool periodic1, int integrationOrder, int reducedIntegrationOrder, bool useElementsOnFace, bool useFullElementOrder, bool optimize, const std::vector< double > &points, const std::vector< int > &tags, const std::map< std::string, int > &tagnamestonums)
Creates a rectangular mesh with n0 x n1 elements over the brick [0,l0] x [0,l1].
Definition: finley/src/CPPAdapter/MeshAdapterFactory.cpp:626
virtual void setTags(const int functionSpaceType, const int newTag, const escript::Data &mask) const
assigns new tag newTag to all samples of functionspace with a positive value of mask for any its samp...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1960
static const int ContactElementsZero
Definition: finley/src/CPPAdapter/MeshAdapter.h:95
boost::shared_ptr< AbstractTransportProblem > ATP_ptr
Definition: AbstractTransportProblem.h:162
virtual int getReducedFunctionCode() const
Return a function with reduced integration order FunctionSpace code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:578
int MPI_Comm
Definition: Esys_MPI.h:29
boost::shared_ptr< Mesh > getMesh()
Definition: finley/src/CPPAdapter/MeshAdapter.h:704
virtual int getDiracDeltaFunctionsCode() const
Return a DiracDeltaFunctions code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:623
virtual int getSolutionCode() const
Return a Solution code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:613
virtual void MPIBarrier() const
If compiled for MPI then execute an MPI_Barrier, else do nothing.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:85
virtual const int * borrowListOfTagsInUse(int functionSpaceCode) const
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2067
virtual bool probeInterpolationACross(int functionSpaceType_source, const escript::AbstractDomain &targetDomain, int functionSpaceType_target) const
determines whether interpolation from source to target is possible. Must be implemented by the actual...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1823
virtual int getApproximationOrder(const int functionSpaceCode) const
returns the approximation order used for a function space functionSpaceCode
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2126
escript::ASM_ptr newSystemMatrix(const int row_blocksize, const escript::FunctionSpace &row_functionspace, const int column_blocksize, const escript::FunctionSpace &column_functionspace, const int type) const
creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros:
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1429
virtual bool isValidFunctionSpaceType(int functionSpaceType) const
Returns true if the given integer is a valid function space type for this domain. ...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:526
virtual int getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const
return the identifier of the transport problem type to be used when a particular solver, perconditioner, package and symmetric matrix is used.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1852
virtual std::string getDescription() const
Return a description for this domain.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:510
boost::shared_ptr< Mesh > m_finleyMesh
Definition: finley/src/CPPAdapter/MeshAdapter.h:700
int StatusType
Definition: AbstractDomain.h:78
escript::Domain_ptr brick(int n0, int n1, int n2, int order, double l0, double l1, double l2, bool periodic0, bool periodic1, bool periodic2, int integrationOrder, int reducedIntegrationOrder, bool useElementsOnFace, bool useFullElementOrder, bool optimize, const std::vector< double > &points, const std::vector< int > &tags, const std::map< std::string, int > &tagnamestonums)
Creates a rectangular mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0...
Definition: finley/src/CPPAdapter/MeshAdapterFactory.cpp:523
Data represents a collection of datapoints.
Definition: Data.h:71
friend escript::Domain_ptr rectangle(int n0, int n1, int order, double l0, double l1, bool periodic0, bool periodic1, int integrationOrder, int reducedIntegrationOrder, bool useElementsOnFace, bool useFullElementOrder, bool optimize, const std::vector< double > &points, const std::vector< int > &tags, const std::map< std::string, int > &tagnamestonums)
Creates a rectangular mesh with n0 x n1 elements over the brick [0,l0] x [0,l1].
Definition: finley/src/CPPAdapter/MeshAdapterFactory.cpp:626
virtual int getDim() const
Returns the spatial dimension of the domain.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:631
virtual int getTag(const std::string &name) const
Return the tag key for tag name.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2005
virtual bool operator==(const escript::AbstractDomain &other) const
comparison operators
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1830
const int * borrowSampleReferenceIDs(int functionSpaceType) const
Return the reference number of the given sample number.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1874
virtual void setToX(escript::Data &arg) const
copies the location of data points into arg. The domain of arg has to match this. has to be implement...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1134
escript::ATP_ptr newTransportProblem(const int blocksize, const escript::FunctionSpace &functionspace, const int type) const
creates a TransportProblemAdapter
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1479
virtual int getFunctionOnContactZeroCode() const
Return a FunctionOnContactZero code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:593
static const int ReducedContactElementsOne
Definition: finley/src/CPPAdapter/MeshAdapter.h:98
virtual escript::Data randomFill(const escript::DataTypes::ShapeType &shape, const escript::FunctionSpace &what, long seed, const boost::python::tuple &filter) const
Fills the data object with filtered random values.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2165
virtual bool onMasterProcessor() const
Return true if on MPI processor 0, else false.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:92
int index_t
Definition: types.h:25
virtual int getFunctionCode() const
Return a function FunctionSpace code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:573
void write(const std::string &fileName) const
Write the current mesh to a file with the given name.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:116
virtual bool probeInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
True if interpolation is possible from source to target.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1659
static const int ReducedContactElementsZero
Definition: finley/src/CPPAdapter/MeshAdapter.h:96
static const int ReducedNodes
Definition: finley/src/CPPAdapter/MeshAdapter.h:89
virtual void interpolateACross(escript::Data &target, const escript::Data &source) const
interpolates data given on source onto target where source and target are given on different domains...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1205
virtual int getReducedContinuousFunctionCode() const
Return a continuous on reduced order nodes FunctionSpace code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:568
virtual void setNewX(const escript::Data &arg)
assigns new location to the domain
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1380
virtual StatusType getStatus() const
Returns a status indicator of the domain. The status identifier should be unique over the live time i...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2120
static const int FaceElements
Definition: finley/src/CPPAdapter/MeshAdapter.h:92
Give a short description of what AbstractTransportProblem does.
Definition: AbstractTransportProblem.h:45
virtual escript::Data getNormal() const
return boundary normals at the quadrature point on the face elements
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1864
virtual void interpolateOnDomain(escript::Data &target, const escript::Data &source) const
interpolates data given on source onto target where source and target have to be given on the same do...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:868
#define FINLEY_DLL_API
Definition: finley/src/CPPAdapter/system_dep.h:44
virtual void setToSize(escript::Data &out) const
copies the size of samples into out. The actual function space to be considered is defined by out...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1335
static const int Points
Definition: finley/src/CPPAdapter/MeshAdapter.h:94
Give a short description of what AbstractSystemMatrix does.
Definition: AbstractSystemMatrix.h:44
virtual bool isValidTagName(const std::string &name) const
Returns true if name is a defined tage name.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2013
virtual int getMPISize() const
return the number of processors used for this domain
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:75
virtual bool canTag(int functionSpaceCode) const
Checks if this domain allows tags for the specified functionSpaceCode.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2101
static const int DegreesOfFreedom
Definition: finley/src/CPPAdapter/MeshAdapter.h:86
boost::shared_ptr< AbstractSystemMatrix > ASM_ptr
Definition: AbstractSystemMatrix.h:201
Definition: AbstractDomain.h:62
Mesh * getFinley_Mesh() const
return the pointer to the underlying finley mesh structure
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:111
virtual signed char preferredInterpolationOnDomain(int functionSpaceType_source, int functionSpaceType_target) const
Preferred direction of interpolation.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1812
virtual std::string showTagNames() const
Returns all tag names in a single string sperated by commas.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:2019
void operator()(void const *ptr) const
Definition: finley/src/CPPAdapter/MeshAdapter.h:69
virtual std::pair< int, int > getDataShape(int functionSpaceCode) const
Return the number of data points per sample, and the number of samples as a pair. ...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:649
virtual void setTagMap(const std::string &name, int tag)
sets a map from a clear tag name to a tag key
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1998
virtual int getReducedFunctionOnContactZeroCode() const
Return a FunctionOnContactZero code with reduced integration order.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:598
Definition: finley/src/Mesh.h:78
virtual void addPDEToTransportProblem(escript::AbstractTransportProblem &tp, escript::Data &source, const escript::Data &M, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y, const escript::Data &d, const escript::Data &y, const escript::Data &d_contact, const escript::Data &y_contact, const escript::Data &d_dirac, const escript::Data &y_dirac) const
adds a PDE onto a transport problem
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:822
unsigned int getMPIComm() const
get the communicator for this domain. Returns 0 on non-MPI builds Routine must be implemented by the ...
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:102
virtual int getFunctionOnBoundaryCode() const
Return a function on boundary FunctionSpace code.
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:583
std::map< int, std::string > FunctionSpaceNamesMapType
Definition: finley/src/CPPAdapter/MeshAdapter.h:345
virtual escript::Data getSize() const
returns the element size
Definition: finley/src/CPPAdapter/MeshAdapter.cpp:1869