escript  Revision_
dudley/src/DomainFactory.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 #ifndef __DUDLEY_DOMAINFACTORY_H__
19 #define __DUDLEY_DOMAINFACTORY_H__
20 
21 #include <dudley/DudleyDomain.h>
22 
23 #include <boost/python/list.hpp>
24 
25 #include <sstream>
26 
32 namespace dudley {
33 
43 escript::Domain_ptr readMesh(const std::string& fileName,
44  int integrationOrder = -1,
45  int reducedIntegrationOrder = -1,
46  bool optimize = false);
47 
57 escript::Domain_ptr readGmsh(const std::string& fileName, int numDim,
58  int integrationOrder = -1,
59  int reducedIntegrationOrder = -1,
60  bool optimize = false);
61 
76  dim_t n0=1, dim_t n1=1, dim_t n2=1, int order=1,
77  double l0=1.0, double l1=1.0, double l2=1.0,
78  bool periodic0=false, bool periodic1=false, bool periodic2=false,
79  int integrationOrder=-1, int reducedIntegrationOrder=-1,
80  bool useElementsOnFace=false, bool useFullElementOrder=false,
81  bool optimize=false);
82 
87 escript::Domain_ptr brick_driver(const boost::python::list& args);
88 
107  dim_t n0 = 1, dim_t n1 = 1, int order = 1,
108  double l0 = 1.0, double l1 = 1.0,
109  bool periodic0 = false, bool periodic1 = false,
110  int integrationOrder = -1,
111  int reducedIntegrationOrder = -1,
112  bool useElementsOnFace = false,
113  bool useFullElementOrder = false,
114  bool optimize = false);
115 
120 escript::Domain_ptr rectangle_driver(const boost::python::list& args);
121 
122 
123 } // end of namespace
124 
125 #endif // __DUDLEY_DOMAINFACTORY_H__
126 
dudley::NodeFile::globalDegreesOfFreedom
index_t * globalDegreesOfFreedom
Definition: dudley/src/NodeFile.h:157
finley::NodeFile::updateTagList
void updateTagList()
Definition: finley/src/NodeFile.h:326
finley::FinleyDomain::setContactElements
void setContactElements(ElementFile *elements)
replaces the contact element file by elements
Definition: finley/src/FinleyDomain.cpp:134
finley::brick_driver
Domain_ptr brick_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:1105
dudley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: dudley/src/ElementFile.h:121
finley::ElementFile::minColor
index_t minColor
minimum color value
Definition: finley/src/ElementFile.h:153
finley::FinleyDomain::joinFaces
void joinFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_joinFaces.cpp:33
finley::FinleyDomain
FinleyDomain implements the AbstractContinuousDomain interface for the Finley library.
Definition: finley/src/FinleyDomain.h:95
finley::NodeFile::globalReducedNodesIndex
index_t * globalReducedNodesIndex
Definition: finley/src/NodeFile.h:181
message
Definition: blocktools.h:70
dudley::DudleyException
Definition: DudleyException.h:26
dudley::NodeFile
Definition: dudley/src/NodeFile.h:40
finley::ElementFile::allocTable
void allocTable(dim_t NE)
allocates the element table within an element file to hold NE elements
Definition: finley/src/ElementFile.cpp:65
dudley::rectangle
Domain_ptr rectangle(JMPI info, dim_t n0, dim_t n1, int order, double l0, double l1, bool periodic0, bool periodic1, int integrationOrder, int reducedIntegrationOrder, bool useElementsOnFace, bool useFullElementOrder, bool optimize)
Creates a 2-dimensional rectangular mesh with n0 x n1 x 2 Tri3 elements over the rectangle [0,...
Definition: dudley/src/DomainFactory.cpp:737
finley::NodeFile::globalDegreesOfFreedom
index_t * globalDegreesOfFreedom
Definition: finley/src/NodeFile.h:173
finley::FinleyDomain::glueFaces
void glueFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_glueFaces.cpp:33
INDEX2
#define INDEX2(_X1_, _X2_, _N1_)
Definition: index.h:23
finley::const_ReferenceElementSet_ptr
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition: ReferenceElementSets.h:80
finley::NodeFile::Tag
int * Tag
Tag[i] is the tag of node i.
Definition: finley/src/NodeFile.h:166
finley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: finley/src/ElementFile.h:129
dudley::ElementFile::Nodes
index_t * Nodes
Nodes[INDEX(k, i, numNodes)] is the k-th node in the i-th element.
Definition: dudley/src/ElementFile.h:133
dudley::DudleyDomain::setElements
void setElements(ElementFile *elements)
replaces the element file by elements
Definition: DudleyDomain.cpp:107
finley::FinleyException
Definition: FinleyException.h:27
escript::AbstractDomain::getPtr
Domain_ptr getPtr()
Returns smart pointer which is managing this object. If one does not exist yet it creates one.
Definition: AbstractDomain.cpp:25
dudley::ElementFile::allocTable
void allocTable(dim_t NE)
allocates the element table within an element file to hold NE elements
Definition: dudley/src/ElementFile.cpp:54
finley::NodeFile::globalReducedDOFIndex
index_t * globalReducedDOFIndex
Definition: finley/src/NodeFile.h:178
dudley::readGmsh
Domain_ptr readGmsh(const string &fileName, int numDim, int, int, bool optimize)
reads a gmsh mesh file
Definition: dudley/src/DomainFactory.cpp:681
dudley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: dudley/src/ElementFile.h:124
escript::Domain_ptr
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:41
dudley::DudleyDomain::createMappings
void createMappings(const std::vector< index_t > &dofDistribution, const std::vector< index_t > &nodeDistribution)
Definition: DudleyDomain.cpp:125
dudley::NodeFile::updateTagList
void updateTagList()
Definition: dudley/src/NodeFile.h:239
finley::ElementFile::Nodes
index_t * Nodes
Definition: finley/src/ElementFile.h:144
escript::makeInfo
JMPI makeInfo(MPI_Comm comm, bool owncom)
Definition: EsysMPI.cpp:29
finley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: finley/src/ElementFile.h:156
dudley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: dudley/src/ElementFile.h:144
dudley::rectangle_driver
Domain_ptr rectangle_driver(const bp::list &args)
Definition: dudley/src/DomainFactory.cpp:754
finley::NodeFile::Coordinates
double * Coordinates
Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.
Definition: finley/src/NodeFile.h:175
dudley::ElementFile::minColor
index_t minColor
minimum color value
Definition: dudley/src/ElementFile.h:141
finley::rectangle
Domain_ptr rectangle(JMPI info, dim_t n0, dim_t n1, int order, double l0, double l1, bool periodic0, bool periodic1, int integrationOrder, int reducedIntegrationOrder, bool useElementsOnFace, bool useFullElementOrder, bool optimize, const vector< double > &points, const vector< int > &tags, const std::map< std::string, int > &tagNamesToNums)
Creates a 2-dimensional rectangular mesh with n0 x n1 elements over the rectangle [0,...
Definition: finley/src/DomainFactory.cpp:1170
dudley
A suite of factory methods for creating 2D and 3D dudley domains.
Definition: dudley/src/Assemble.h:32
MPI_COMM_WORLD
#define MPI_COMM_WORLD
Definition: EsysMPI.h:48
finley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: finley/src/ElementFile.h:132
paso::util::l2
double l2(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:502
escript::IOError
An exception class for Input/Output errors.
Definition: EsysException.h:70
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:65
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:72
dudley::ElementFile
Definition: dudley/src/ElementFile.h:53
dudley::ElementFile::Id
index_t * Id
Definition: dudley/src/ElementFile.h:118
finley::FinleyDomain::addDiracPoints
void addDiracPoints(const std::vector< double > &points, const std::vector< int > &tags)
adds Dirac delta points. Do NOT call this at any time other than construction! Using them later creat...
Definition: Mesh_addPoints.cpp:49
finley::ElementFile::Color
index_t * Color
Definition: finley/src/ElementFile.h:150
finley::FinleyDomain::getNodes
NodeFile * getNodes() const
returns a pointer to this domain's node file
Definition: finley/src/FinleyDomain.h:285
finley::readGmsh_driver
Domain_ptr readGmsh_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:985
finley::NodeFile::Id
index_t * Id
Id[i] is the unique ID number of FEM node i.
Definition: finley/src/NodeFile.h:164
finley::ElementFile::Id
index_t * Id
Definition: finley/src/ElementFile.h:126
dudley::DudleyDomain::getNodes
NodeFile * getNodes() const
returns a pointer to this domain's node file
Definition: DudleyDomain.h:176
finley::joinFaces
Domain_ptr joinFaces(const bp::list &meshList, double safetyFactor, double tolerance, bool optimize)
Definition: finley/src/DomainFactory.cpp:1300
dudley::ElementFile::updateTagList
void updateTagList()
Definition: dudley/src/ElementFile.h:175
finley::FinleyDomain::getTagMap
const TagMap & getTagMap() const
returns a reference to the tag name->value map
Definition: finley/src/FinleyDomain.h:816
dudley::brick_driver
Domain_ptr brick_driver(const bp::list &args)
Definition: dudley/src/DomainFactory.cpp:712
finley::cleanupAndThrow
void cleanupAndThrow(FinleyDomain *dom, string msg)
Definition: finley/src/DomainFactory.cpp:91
finley::brick
Domain_ptr brick(JMPI info, dim_t n0, dim_t n1, dim_t 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/DomainFactory.cpp:1066
escript::load
Data load(const std::string fileName, const AbstractDomain &domain)
reads Data on domain from file in netCDF format
Definition: DataFactory.cpp:708
dudley::NodeFile::allocTable
void allocTable(dim_t numNodes)
allocates the node table within this node file to hold numNodes nodes.
Definition: dudley/src/NodeFile.cpp:63
finley::ElementTypeId
ElementTypeId
Definition: ReferenceElements.h:39
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:60
finley::glueFaces
Domain_ptr glueFaces(const bp::list &meshList, double safetyFactor, double tolerance, bool optimize)
Definition: finley/src/DomainFactory.cpp:1288
finley::FinleyDomain::setElements
void setElements(ElementFile *elements)
replaces the element file by elements
Definition: finley/src/FinleyDomain.cpp:122
finley::NodeFile
Definition: finley/src/NodeFile.h:42
escript
Definition: AbstractContinuousDomain.cpp:23
finley::FinleyDomain::getPoints
ElementFile * getPoints() const
returns a pointer to this domain's point (nodal) element file
Definition: finley/src/FinleyDomain.h:333
dudley::DudleyDomain::setTagMap
virtual void setTagMap(const std::string &name, int tag)
sets a map from a clear tag name to a tag key
Definition: DudleyDomain.cpp:1956
dudley::readMesh
Domain_ptr readMesh(const string &fileName, int, int, bool optimize)
reads a mesh from a fly file. For MPI parallel runs fans out the mesh to multiple processes.
Definition: dudley/src/DomainFactory.cpp:674
dudley::DudleyDomain::setPoints
void setPoints(ElementFile *elements)
replaces the point element file by elements
Definition: DudleyDomain.cpp:119
finley::FinleyDomain::setPoints
void setPoints(ElementFile *elements)
replaces the point element file by elements
Definition: finley/src/FinleyDomain.cpp:140
finley::NodeFile::globalNodesIndex
index_t * globalNodesIndex
assigns each local node a global unique ID in a dense labeling
Definition: finley/src/NodeFile.h:183
dudley::DudleyDomain
DudleyDomain implements the AbstractContinuousDomain interface for the Dudley library.
Definition: DudleyDomain.h:86
dudley::NodeFile::Id
index_t * Id
Id[i] is the unique ID number of FEM node i.
Definition: dudley/src/NodeFile.h:148
finley::ElementFile
Definition: finley/src/ElementFile.h:63
dudley::NodeFile::Tag
int * Tag
Tag[i] is the tag of node i.
Definition: dudley/src/NodeFile.h:150
finley::FinleyDomain::createMappings
void createMappings(const IndexVector &dofDistribution, const IndexVector &nodeDistribution)
Definition: finley/src/FinleyDomain.cpp:185
dudley::ElementFile::Color
index_t * Color
Definition: dudley/src/ElementFile.h:138
finley::FinleyDomain::setTagMap
virtual void setTagMap(const std::string &name, int tag)
sets a map from a clear tag name to a tag key
Definition: finley/src/FinleyDomain.cpp:2606
dudley::DudleyDomain::setFaceElements
void setFaceElements(ElementFile *elements)
replaces the face element file by elements
Definition: DudleyDomain.cpp:113
finley::TagMap
std::map< std::string, int > TagMap
Definition: finley/src/FinleyDomain.h:80
finley::ReferenceElementSet
Definition: ReferenceElementSets.h:27
finley::FinleyDomain::setFaceElements
void setFaceElements(ElementFile *elements)
replaces the face element file by elements
Definition: finley/src/FinleyDomain.cpp:128
finley::rectangle_driver
Domain_ptr rectangle_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:1207
finley::ElementFile::updateTagList
void updateTagList()
Definition: finley/src/ElementFile.h:179
finley
A suite of factory methods for creating various finley domains.
Definition: finley/src/Assemble.h:32
dudley::cleanupAndThrow
void cleanupAndThrow(DudleyDomain *dom, string msg)
Definition: dudley/src/DomainFactory.cpp:86
finley::NodeFile::allocTable
void allocTable(dim_t numNodes)
allocates the node table within this node file to hold numNodes nodes.
Definition: finley/src/NodeFile.cpp:127
dudley::NodeFile::Coordinates
double * Coordinates
Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.
Definition: dudley/src/NodeFile.h:159
escript::ValueError
An exception class that signals an invalid argument value.
Definition: EsysException.h:90
dudley::ElementTypeId
ElementTypeId
Definition: ElementType.h:25
escript::AbstractContinuousDomain
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:47
dudley::NodeFile::globalNodesIndex
index_t * globalNodesIndex
assigns each local node a global unique ID in a dense labeling
Definition: dudley/src/NodeFile.h:161
finley::readMesh_driver
Domain_ptr readMesh_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:904
finley::meshMerge
Domain_ptr meshMerge(const bp::list &meshList)
Definition: finley/src/DomainFactory.cpp:1272
dudley::brick
Domain_ptr brick(JMPI info, dim_t n0, dim_t n1, dim_t 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)
Creates a rectangular mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,...
Definition: dudley/src/DomainFactory.cpp:689
escript::DataTypes::IndexVector
std::vector< index_t > IndexVector
Definition: DataTypes.h:63