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 
44 escript::Domain_ptr readMesh(const std::string& fileName,
45  int integrationOrder = -1,
46  int reducedIntegrationOrder = -1,
47  bool optimize = false);
48 
59 escript::Domain_ptr readGmsh(const std::string& fileName, int numDim,
60  int integrationOrder = -1,
61  int reducedIntegrationOrder = -1,
62  bool optimize = false);
63 
79  dim_t n0=1, dim_t n1=1, dim_t n2=1, int order=1,
80  double l0=1.0, double l1=1.0, double l2=1.0,
81  bool periodic0=false, bool periodic1=false, bool periodic2=false,
82  int integrationOrder=-1, int reducedIntegrationOrder=-1,
83  bool useElementsOnFace=false, bool useFullElementOrder=false,
84  bool optimize=false);
85 
91 escript::Domain_ptr brick_driver(const boost::python::list& args);
92 
112  dim_t n0 = 1, dim_t n1 = 1, int order = 1,
113  double l0 = 1.0, double l1 = 1.0,
114  bool periodic0 = false, bool periodic1 = false,
115  int integrationOrder = -1,
116  int reducedIntegrationOrder = -1,
117  bool useElementsOnFace = false,
118  bool useFullElementOrder = false,
119  bool optimize = false);
120 
126 escript::Domain_ptr rectangle_driver(const boost::python::list& args);
127 
128 
129 } // end of namespace
130 
131 #endif // __DUDLEY_DOMAINFACTORY_H__
132 
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:97
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
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
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
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
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::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::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
DUDLEY_DLL_API
#define DUDLEY_DLL_API
Definition: dudley/src/system_dep.h:29
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
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:50
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:501
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::IOError
An exception class for Input/Output errors.
Definition: EsysException.h:80
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
dudley::ElementFile
Definition: dudley/src/ElementFile.h:53
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::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:287
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:178
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:818
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
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:41
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
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
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
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:335
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:1970
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:88
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:2620
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:82
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
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
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:100
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
escript::DataTypes::IndexVector
std::vector< index_t > IndexVector
Definition: DataTypes.h:64