/[escript]/branches/more_shared_ptrs_from_1812/finley/src/CPPAdapter/MeshAdapterFactory.h
ViewVC logotype

Contents of /branches/more_shared_ptrs_from_1812/finley/src/CPPAdapter/MeshAdapterFactory.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1820 - (show annotations)
Wed Oct 1 03:48:18 2008 UTC (10 years, 10 months ago) by jfenwick
File MIME type: text/plain
File size: 6568 byte(s)
Branch commit.

First experiments with shared_ptr.
There is a crash on exit due to deallocating the NullDomain object twice.
(One from shared_ptr and once in global destructors)


1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #if !defined finley_MeshAdapterFactory_20040526_H
16 #define finley_MeshAdapterFactory_20040526_H
17 #include "system_dep.h"
18
19 extern "C" {
20 #include "../Finley.h"
21 #include "../Mesh.h"
22 #include "../RectangularMesh.h"
23 }
24
25 #include "MeshAdapter.h"
26
27 #include "escript/AbstractContinuousDomain.h"
28
29 #include <boost/python/list.hpp>
30
31 #include <sstream>
32
33 namespace finley {
34 /**
35 \brief
36 A suite of factory methods for creating various MeshAdapters.
37
38 Description:
39 A suite of factory methods for creating various MeshAdapters.
40 */
41
42 /**
43 \brief
44 recovers mesg from a dump file
45 \param fileName Input - The name of the file.
46 */
47 FINLEY_DLL_API
48 escript::AbstractContinuousDomain* loadMesh(const std::string& fileName);
49 /**
50 \brief
51 Read a mesh from a file. For MPI parallel runs fan out the mesh to multiple processes.
52 \param fileName Input - The name of the file.
53 \param integrationOrder Input - order of the quadrature scheme.
54 If integrationOrder<0 the integration order is selected independently.
55 \param reducedIntegrationOrder Input - order of the reduced quadrature scheme.
56 If reducedIntegrationOrder<0 the integration order is selected independently.
57 \param optimize Input - switches on the optimization of node labels
58 */
59 FINLEY_DLL_API
60 escript::AbstractContinuousDomain* readMesh(const std::string& fileName,
61 int integrationOrder=-1,
62 int reducedIntegrationOrder=-1,
63 int optimize=0);
64 /**
65 \brief
66 Read a gmsh mesh file
67 \param fileName Input - The name of the file.
68 \param numDim Input - spatial dimension
69 \param integrationOrder Input - order of the quadrature scheme.
70 If integrationOrder<0 the integration order is selected independently.
71 \param reducedIntegrationOrder Input - order of the reduced quadrature scheme.
72 If reducedIntegrationOrder<0 the integration order is selected independently.
73 \param optimize Input - switches on the optimization of node labels
74 */
75 FINLEY_DLL_API
76 escript::AbstractContinuousDomain* readGmsh(const std::string& fileName,
77 int numDim,
78 int integrationOrder=-1,
79 int reducedIntegrationOrder=-1,
80 int optimize=0);
81 /**
82 \brief
83 Creates a rectangular mesh with n0 x n1 x n2 elements over the brick
84 [0,l0] x [0,l1] x [0,l2].
85
86 \param n0,n1,n2 Input - number of elements in each dimension
87 \param order Input - =1 or =2 gives the order of shape function
88 \param l0,l1,l2 Input - length of each side of brick
89 \param integrationOrder Input - order of the quadrature scheme.
90 If integrationOrder<0 the integration order is selected independently.
91 \param reducedIntegrationOrder Input - order of the reduced quadrature scheme.
92 If reducedIntegrationOrder<0 the integration order is selected independently.
93 \param useElementsOnFace Input - whether or not to use elements on face
94 \param periodic0, periodic1, periodic2 Input - whether or not boundary
95 conditions of the dimension are periodic
96 */
97 FINLEY_DLL_API
98 escript::AbstractContinuousDomain* brick(int n0=1,int n1=1,int n2=1,int order=1,
99 double l0=1.0,double l1=1.0,double l2=1.0,
100 int periodic0=0,int periodic1=0,
101 int periodic2=0,
102 int integrationOrder=-1,
103 int reducedIntegrationOrder=-1,
104 int useElementsOnFace=0,
105 int useFullElementOrder=0,
106 int optimize=0);
107 /**
108 \brief
109 Creates a rectangular mesh with n0 x n1 elements over the brick
110 [0,l0] x [0,l1].
111
112 \param n0,n1 Input - number of elements in each dimension
113 \param order Input - =1 or =2 gives the order of shape function
114 \param l0,l1 Input - length of each side of brick
115 \param integrationOrder Input - order of the quadrature scheme.
116 If integrationOrder<0 the integration order is selected
117 independently.
118 \param reducedIntegrationOrder Input - order of the reduced quadrature scheme.
119 If reducedIntegrationOrder<0 the integration order is selected independently.
120 \param periodic0, periodic1 Input - whether or not the boundary
121 conditions of the dimension are periodic
122 \param useElementsOnFace Input - whether or not to use elements on face
123 */
124 FINLEY_DLL_API
125 // escript::AbstractContinuousDomain* rectangle(int n0=1,int n1=1,int order=1,
126 escript::Domain_ptr rectangle(int n0=1,int n1=1,int order=1,
127 double l0=1.0, double l1=1.0,
128 int periodic0=false,int periodic1=false,
129 int integrationOrder=-1,
130 int reducedIntegrationOrder=-1,
131 int useElementsOnFace=0,
132 int useFullElementOrder=0,
133 int optimize=0);
134 /**
135 \brief
136 Merges a list of meshes into one list.
137 \param meshList Input - The list of meshes.
138 */
139 FINLEY_DLL_API
140 escript::AbstractContinuousDomain* meshMerge(const boost::python::list& meshList);
141 /**
142 \brief
143 Detects matching faces in the mesh, removes them from the mesh
144 and joins the elements touched by the face elements.
145 \param meshList Input - The list of meshes.
146 \param safetyFactor Input - ??
147 \param tolerance Input - ??
148 \param optimize Input - switches on the optimization of node labels
149 */
150 FINLEY_DLL_API
151 escript::AbstractContinuousDomain* glueFaces(const boost::python::list& meshList,
152 double safetyFactor=0.2,
153 double tolerance=1.e-8,
154 int optimize=0);
155 /**
156 \brief
157 Detects matching faces in the mesh and replaces them by joint elements.
158 \param meshList Input - The list of meshes.
159 \param safetyFactor Input - ??
160 \param tolerance Input - ??
161 \param optimize Input - switches on the optimization of node labels
162 */
163 FINLEY_DLL_API
164 escript::AbstractContinuousDomain* joinFaces(const boost::python::list& meshList,
165 double safetyFactor=0.2,
166 double tolerance=1.e-8,
167 int optimize=0);
168
169 } // end of namespace
170 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26