escript  Revision_
dudley/src/DomainFactory.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 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 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 #ifndef __DUDLEY_DOMAINFACTORY_H__
18 #define __DUDLEY_DOMAINFACTORY_H__
19 
20 #include <dudley/DudleyDomain.h>
21 
22 #include <boost/python/list.hpp>
23 
24 #include <sstream>
25 
31 namespace dudley {
32 
42 escript::Domain_ptr readMesh(const std::string& fileName,
43  int integrationOrder = -1,
44  int reducedIntegrationOrder = -1,
45  bool optimize = false);
46 
56 escript::Domain_ptr readGmsh(const std::string& fileName, int numDim,
57  int integrationOrder = -1,
58  int reducedIntegrationOrder = -1,
59  bool optimize = false);
60 
75  dim_t n0=1, dim_t n1=1, dim_t n2=1, int order=1,
76  double l0=1.0, double l1=1.0, double l2=1.0,
77  bool periodic0=false, bool periodic1=false, bool periodic2=false,
78  int integrationOrder=-1, int reducedIntegrationOrder=-1,
79  bool useElementsOnFace=false, bool useFullElementOrder=false,
80  bool optimize=false);
81 
86 escript::Domain_ptr brick_driver(const boost::python::list& args);
87 
106  dim_t n0 = 1, dim_t n1 = 1, int order = 1,
107  double l0 = 1.0, double l1 = 1.0,
108  bool periodic0 = false, bool periodic1 = false,
109  int integrationOrder = -1,
110  int reducedIntegrationOrder = -1,
111  bool useElementsOnFace = false,
112  bool useFullElementOrder = false,
113  bool optimize = false);
114 
119 escript::Domain_ptr rectangle_driver(const boost::python::list& args);
120 
121 
122 } // end of namespace
123 
124 #endif // __DUDLEY_DOMAINFACTORY_H__
125 
finley::FinleyDomain::setContactElements
void setContactElements(ElementFile *elements)
replaces the contact element file by elements
Definition: finley/src/FinleyDomain.cpp:132
finley::brick_driver
Domain_ptr brick_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:1103
dudley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: dudley/src/ElementFile.h:131
finley::ElementFile::minColor
index_t minColor
minimum color value
Definition: finley/src/ElementFile.h:163
finley::FinleyDomain::joinFaces
void joinFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_joinFaces.cpp:47
finley::FinleyDomain
FinleyDomain implements the AbstractContinuousDomain interface for the Finley library.
Definition: finley/src/FinleyDomain.h:137
message
Definition: blocktools.h:67
dudley::DudleyException
Definition: DudleyException.h:35
dudley::NodeFile
Definition: dudley/src/NodeFile.h:37
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:75
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:735
finley::FinleyDomain::glueFaces
void glueFaces(double safetyFactor, double tolerance, bool optimize)
Definition: Mesh_glueFaces.cpp:47
INDEX2
#define INDEX2(_X1_, _X2_, _N1_)
Definition: index.h:21
finley::const_ReferenceElementSet_ptr
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition: ReferenceElementSets.h:90
finley::ElementFile::Tag
int * Tag
Tag[i] is the tag of element i.
Definition: finley/src/ElementFile.h:139
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:143
dudley::DudleyDomain::setElements
void setElements(ElementFile *elements)
replaces the element file by elements
Definition: DudleyDomain.cpp:105
finley::FinleyException
Definition: FinleyException.h:36
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:36
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:64
dudley::readGmsh
Domain_ptr readGmsh(const string &fileName, int numDim, int, int, bool optimize)
reads a gmsh mesh file
Definition: dudley/src/DomainFactory.cpp:679
dudley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: dudley/src/ElementFile.h:134
escript::Domain_ptr
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:47
dudley::DudleyDomain::createMappings
void createMappings(const std::vector< index_t > &dofDistribution, const std::vector< index_t > &nodeDistribution)
Definition: DudleyDomain.cpp:123
finley::ElementFile::Nodes
index_t * Nodes
Definition: finley/src/ElementFile.h:154
escript::makeInfo
JMPI makeInfo(MPI_Comm comm, bool owncom)
Definition: EsysMPI.cpp:39
finley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: finley/src/ElementFile.h:166
dudley::ElementFile::maxColor
index_t maxColor
maximum color value
Definition: dudley/src/ElementFile.h:154
dudley::rectangle_driver
Domain_ptr rectangle_driver(const bp::list &args)
Definition: dudley/src/DomainFactory.cpp:752
dudley::ElementFile::minColor
index_t minColor
minimum color value
Definition: dudley/src/ElementFile.h:151
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:1168
dudley
A suite of factory methods for creating 2D and 3D dudley domains.
Definition: dudley/src/Assemble.h:31
MPI_COMM_WORLD
#define MPI_COMM_WORLD
Definition: EsysMPI.h:46
finley::ElementFile::Owner
int * Owner
Owner[i] contains the rank that owns element i.
Definition: finley/src/ElementFile.h:142
paso::util::l2
double l2(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:524
escript::IOError
An exception class for Input/Output errors.
Definition: EsysException.h:79
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:87
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:70
dudley::ElementFile
Definition: dudley/src/ElementFile.h:62
dudley::ElementFile::Id
index_t * Id
Definition: dudley/src/ElementFile.h:128
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:46
finley::ElementFile::Color
index_t * Color
Definition: finley/src/ElementFile.h:160
finley::FinleyDomain::getNodes
NodeFile * getNodes() const
returns a pointer to this domain's node file
Definition: finley/src/FinleyDomain.h:328
finley::readGmsh_driver
Domain_ptr readGmsh_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:983
finley::ElementFile::Id
index_t * Id
Definition: finley/src/ElementFile.h:136
dudley::DudleyDomain::getNodes
NodeFile * getNodes() const
returns a pointer to this domain's node file
Definition: DudleyDomain.h:210
finley::joinFaces
Domain_ptr joinFaces(const bp::list &meshList, double safetyFactor, double tolerance, bool optimize)
Definition: finley/src/DomainFactory.cpp:1298
dudley::ElementFile::updateTagList
void updateTagList()
Definition: dudley/src/ElementFile.h:185
finley::FinleyDomain::getTagMap
const TagMap & getTagMap() const
returns a reference to the tag name->value map
Definition: finley/src/FinleyDomain.h:842
dudley::brick_driver
Domain_ptr brick_driver(const bp::list &args)
Definition: dudley/src/DomainFactory.cpp:710
finley::cleanupAndThrow
void cleanupAndThrow(FinleyDomain *dom, string msg)
Definition: finley/src/DomainFactory.cpp:89
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:1064
escript::load
Data load(const std::string fileName, const AbstractDomain &domain)
reads Data on domain from file in netCDF format
Definition: DataFactory.cpp:494
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:73
finley::ElementTypeId
ElementTypeId
Definition: ReferenceElements.h:36
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:82
finley::glueFaces
Domain_ptr glueFaces(const bp::list &meshList, double safetyFactor, double tolerance, bool optimize)
Definition: finley/src/DomainFactory.cpp:1286
finley::FinleyDomain::setElements
void setElements(ElementFile *elements)
replaces the element file by elements
Definition: finley/src/FinleyDomain.cpp:120
finley::NodeFile
Definition: finley/src/NodeFile.h:39
escript
Definition: AbstractContinuousDomain.cpp:22
finley::FinleyDomain::getPoints
ElementFile * getPoints() const
returns a pointer to this domain's point (nodal) element file
Definition: finley/src/FinleyDomain.h:376
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:1910
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:672
dudley::DudleyDomain::setPoints
void setPoints(ElementFile *elements)
replaces the point element file by elements
Definition: DudleyDomain.cpp:117
finley::FinleyDomain::setPoints
void setPoints(ElementFile *elements)
replaces the point element file by elements
Definition: finley/src/FinleyDomain.cpp:138
dudley::DudleyDomain
DudleyDomain implements the AbstractContinuousDomain interface for the Dudley library.
Definition: DudleyDomain.h:119
finley::ElementFile
Definition: finley/src/ElementFile.h:72
finley::FinleyDomain::createMappings
void createMappings(const IndexVector &dofDistribution, const IndexVector &nodeDistribution)
Definition: finley/src/FinleyDomain.cpp:183
dudley::ElementFile::Color
index_t * Color
Definition: dudley/src/ElementFile.h:148
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:2504
dudley::DudleyDomain::setFaceElements
void setFaceElements(ElementFile *elements)
replaces the face element file by elements
Definition: DudleyDomain.cpp:111
finley::TagMap
std::map< std::string, int > TagMap
Definition: finley/src/FinleyDomain.h:123
finley::ReferenceElementSet
Definition: ReferenceElementSets.h:37
finley::FinleyDomain::setFaceElements
void setFaceElements(ElementFile *elements)
replaces the face element file by elements
Definition: finley/src/FinleyDomain.cpp:126
finley::rectangle_driver
Domain_ptr rectangle_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:1205
finley::ElementFile::updateTagList
void updateTagList()
Definition: finley/src/ElementFile.h:189
finley
A suite of factory methods for creating various finley domains.
Definition: finley/src/Assemble.h:31
dudley::cleanupAndThrow
void cleanupAndThrow(DudleyDomain *dom, string msg)
Definition: dudley/src/DomainFactory.cpp:84
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:137
escript::ValueError
An exception class that signals an invalid argument value.
Definition: EsysException.h:99
dudley::ElementTypeId
ElementTypeId
Definition: ElementType.h:35
escript::AbstractContinuousDomain
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:56
finley::readMesh_driver
Domain_ptr readMesh_driver(const bp::list &args)
Definition: finley/src/DomainFactory.cpp:902
finley::meshMerge
Domain_ptr meshMerge(const bp::list &meshList)
Definition: finley/src/DomainFactory.cpp:1270
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:687
escript::DataTypes::IndexVector
std::vector< index_t > IndexVector
Definition: DataTypes.h:85