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 
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:1104
dudley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: dudley/src/ElementFile.h:133
finley::ElementFile::minColor
index_t minColor
minimum color value
Definition: finley/src/ElementFile.h:165
finley::FinleyDomain::joinFaces
void joinFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_joinFaces.cpp:49
finley::FinleyDomain
FinleyDomain implements the AbstractContinuousDomain interface for the Finley library.
Definition: finley/src/FinleyDomain.h:139
message
Definition: blocktools.h:68
dudley::DudleyException
Definition: DudleyException.h:37
dudley::NodeFile
Definition: dudley/src/NodeFile.h:38
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:77
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:736
finley::FinleyDomain::glueFaces
void glueFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_glueFaces.cpp:49
INDEX2
#define INDEX2(_X1_, _X2_, _N1_)
Definition: index.h:22
finley::const_ReferenceElementSet_ptr
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition: ReferenceElementSets.h:92
finley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: finley/src/ElementFile.h:141
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:145
dudley::DudleyDomain::setElements
void setElements(ElementFile *elements)
replaces the element file by elements
Definition: DudleyDomain.cpp:106
finley::FinleyException
Definition: FinleyException.h:38
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:38
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:66
dudley::readGmsh
Domain_ptr readGmsh(const string &fileName, int numDim, int, int, bool optimize)
reads a gmsh mesh file
Definition: dudley/src/DomainFactory.cpp:680
dudley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: dudley/src/ElementFile.h:136
escript::Domain_ptr
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:53
dudley::DudleyDomain::createMappings
void createMappings(const std::vector< index_t > &dofDistribution, const std::vector< index_t > &nodeDistribution)
Definition: DudleyDomain.cpp:124
finley::ElementFile::Nodes
index_t * Nodes
Definition: finley/src/ElementFile.h:156
escript::makeInfo
JMPI makeInfo(MPI_Comm comm, bool owncom)
Definition: EsysMPI.cpp:41
finley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: finley/src/ElementFile.h:168
dudley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: dudley/src/ElementFile.h:156
dudley::rectangle_driver
Domain_ptr rectangle_driver(const bp::list &args)
Definition: dudley/src/DomainFactory.cpp:753
dudley::ElementFile::minColor
index_t minColor
minimum color value
Definition: dudley/src/ElementFile.h:153
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:1169
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:47
finley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: finley/src/ElementFile.h:144
paso::util::l2
double l2(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:527
escript::IOError
An exception class for Input/Output errors.
Definition: EsysException.h:81
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:90
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
dudley::ElementFile
Definition: dudley/src/ElementFile.h:64
dudley::ElementFile::Id
index_t * Id
Definition: dudley/src/ElementFile.h:130
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:47
finley::ElementFile::Color
index_t * Color
Definition: finley/src/ElementFile.h:162
finley::FinleyDomain::getNodes
NodeFile * getNodes() const
returns a pointer to this domain's node file
Definition: finley/src/FinleyDomain.h:330
finley::readGmsh_driver
Domain_ptr readGmsh_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:984
finley::ElementFile::Id
index_t * Id
Definition: finley/src/ElementFile.h:138
dudley::DudleyDomain::getNodes
NodeFile * getNodes() const
returns a pointer to this domain's node file
Definition: DudleyDomain.h:212
finley::joinFaces
Domain_ptr joinFaces(const bp::list &meshList, double safetyFactor, double tolerance, bool optimize)
Definition: finley/src/DomainFactory.cpp:1299
dudley::ElementFile::updateTagList
void updateTagList()
Definition: dudley/src/ElementFile.h:187
finley::FinleyDomain::getTagMap
const TagMap & getTagMap() const
returns a reference to the tag name->value map
Definition: finley/src/FinleyDomain.h:861
dudley::brick_driver
Domain_ptr brick_driver(const bp::list &args)
Definition: dudley/src/DomainFactory.cpp:711
finley::cleanupAndThrow
void cleanupAndThrow(FinleyDomain *dom, string msg)
Definition: finley/src/DomainFactory.cpp:90
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:1065
escript::load
Data load(const std::string fileName, const AbstractDomain &domain)
reads Data on domain from file in netCDF format
Definition: DataFactory.cpp:721
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:75
finley::ElementTypeId
ElementTypeId
Definition: ReferenceElements.h:37
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:85
finley::glueFaces
Domain_ptr glueFaces(const bp::list &meshList, double safetyFactor, double tolerance, bool optimize)
Definition: finley/src/DomainFactory.cpp:1287
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:40
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:378
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:1955
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:673
dudley::DudleyDomain::setPoints
void setPoints(ElementFile *elements)
replaces the point element file by elements
Definition: DudleyDomain.cpp:118
finley::FinleyDomain::setPoints
void setPoints(ElementFile *elements)
replaces the point element file by elements
Definition: finley/src/FinleyDomain.cpp:140
dudley::DudleyDomain
DudleyDomain implements the AbstractContinuousDomain interface for the Dudley library.
Definition: DudleyDomain.h:121
finley::ElementFile
Definition: finley/src/ElementFile.h:74
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:150
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:112
finley::TagMap
std::map< std::string, int > TagMap
Definition: finley/src/FinleyDomain.h:125
finley::ReferenceElementSet
Definition: ReferenceElementSets.h:39
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:1206
finley::ElementFile::updateTagList
void updateTagList()
Definition: finley/src/ElementFile.h:191
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:85
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:139
escript::ValueError
An exception class that signals an invalid argument value.
Definition: EsysException.h:101
dudley::ElementTypeId
ElementTypeId
Definition: ElementType.h:37
escript::AbstractContinuousDomain
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:58
finley::readMesh_driver
Domain_ptr readMesh_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:903
finley::meshMerge
Domain_ptr meshMerge(const bp::list &meshList)
Definition: finley/src/DomainFactory.cpp:1271
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:688
escript::DataTypes::IndexVector
std::vector< index_t > IndexVector
Definition: DataTypes.h:88