Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
NodeOptiCAD.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: ProcessJac.h
4 //
5 // For more information, please see: http://www.nektar.info/
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Calculate jacobians of elements.
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef UTILITIES_NEKMESH_NODEOPTICAD
37 #define UTILITIES_NEKMESH_NODEOPTICAD
38 
39 #include "NodeOpti.h"
40 
42 
43 namespace Nektar
44 {
45 namespace Utilities
46 {
47 
48 class NodeOpti1D3D : public NodeOpti // 1D optimsation in 3D space
49 {
50 public:
51  NodeOpti1D3D(NodeSharedPtr n, std::vector<ElUtilSharedPtr> e,
53  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d,
55  : NodeOpti(n, e, r, d, o), curve(c)
56  {
57  }
58 
60 
61  void Optimise();
62 
63  static int m_type;
65  NodeSharedPtr n, std::vector<ElUtilSharedPtr> e, ResidualSharedPtr r,
66  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d, optiType o)
67  {
68  std::vector<std::pair<int, CADCurveSharedPtr> > cs = n->GetCADCurves();
69  return NodeOptiSharedPtr(new NodeOpti1D3D(n, e, r, d, o, cs[0].second));
70  }
71 
72 private:
73  void ProcessGradient();
75 };
76 
77 class NodeOpti2D3D : public NodeOpti // 1D optimsation in 3D space
78 {
79 public:
80  NodeOpti2D3D(NodeSharedPtr n, std::vector<ElUtilSharedPtr> e,
82  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d,
84  : NodeOpti(n, e, r, d, o), surf(s)
85  {
86  }
87 
89 
90  void Optimise();
91 
92  static int m_type;
94  NodeSharedPtr n, std::vector<ElUtilSharedPtr> e, ResidualSharedPtr r,
95  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d, optiType o)
96  {
97  std::vector<std::pair<int, CADSurfSharedPtr> > ss = n->GetCADSurfs();
98  return NodeOptiSharedPtr(new NodeOpti2D3D(n, e, r, d, o, ss[0].second));
99  }
100 
101 private:
102  void ProcessGradient();
104 };
105 }
106 }
107 
108 #endif
static NodeOptiSharedPtr create(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o)
Definition: NodeOptiCAD.h:64
NodeOpti1D3D(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o, CADCurveSharedPtr c)
Definition: NodeOptiCAD.h:51
boost::shared_ptr< Residual > ResidualSharedPtr
Definition: ElUtil.h:54
static NodeOptiSharedPtr create(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o)
Definition: NodeOptiCAD.h:93
boost::shared_ptr< Node > NodeSharedPtr
Definition: Node.h:50
NodeOpti2D3D(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o, CADSurfSharedPtr s)
Definition: NodeOptiCAD.h:80
boost::shared_ptr< NodeOpti > NodeOptiSharedPtr
Definition: NodeOpti.h:107
boost::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADSurf.h:172
boost::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:194