Nektar++
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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Calculate jacobians of elements.
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef UTILITIES_NEKMESH_NODEOPTICAD
36 #define UTILITIES_NEKMESH_NODEOPTICAD
37 
38 #include "NodeOpti.h"
39 
41 
42 namespace Nektar
43 {
44 namespace Utilities
45 {
46 
47 class NodeOpti1D3D : public NodeOpti // 1D optimsation in 3D space
48 {
49 public:
50  NodeOpti1D3D(NodeSharedPtr n, std::vector<ElUtilSharedPtr> e,
52  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d,
54  : NodeOpti(n, e, r, d, o, 3), curve(c)
55  {
56  }
57 
59 
60  void Optimise();
61 
62  static int m_type;
64  NodeSharedPtr n, std::vector<ElUtilSharedPtr> e, ResidualSharedPtr r,
65  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d, optiType o)
66  {
67  std::vector<CADCurveSharedPtr> cs = n->GetCADCurves();
68  return NodeOptiSharedPtr(new NodeOpti1D3D(n, e, r, d, o, cs[0]));
69  }
70 
71 private:
72  void ProcessGradient();
74 };
75 
76 class NodeOpti2D3D : public NodeOpti // 1D optimsation in 3D space
77 {
78 public:
79  NodeOpti2D3D(NodeSharedPtr n, std::vector<ElUtilSharedPtr> e,
81  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d,
83  : NodeOpti(n, e, r, d, o, 3), surf(s)
84  {
85  }
86 
88 
89  void Optimise();
90 
91  static int m_type;
93  NodeSharedPtr n, std::vector<ElUtilSharedPtr> e, ResidualSharedPtr r,
94  std::map<LibUtilities::ShapeType, DerivUtilSharedPtr> d, optiType o)
95  {
96  std::vector<CADSurfSharedPtr> ss = n->GetCADSurfs();
97  return NodeOptiSharedPtr(new NodeOpti2D3D(n, e, r, d, o, ss[0]));
98  }
99 
100 private:
101  void ProcessGradient();
103 };
104 }
105 }
106 
107 #endif
std::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADCurve.h:51
static NodeOptiSharedPtr create(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o)
Definition: NodeOptiCAD.h:63
std::shared_ptr< Residual > ResidualSharedPtr
Definition: ElUtil.h:53
NodeOpti1D3D(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o, CADCurveSharedPtr c)
Definition: NodeOptiCAD.h:50
std::shared_ptr< NodeOpti > NodeOptiSharedPtr
Definition: NodeOpti.h:135
std::shared_ptr< Node > NodeSharedPtr
Definition: CADVert.h:49
static NodeOptiSharedPtr create(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o)
Definition: NodeOptiCAD.h:92
std::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:219
NodeOpti2D3D(NodeSharedPtr n, std::vector< ElUtilSharedPtr > e, ResidualSharedPtr r, std::map< LibUtilities::ShapeType, DerivUtilSharedPtr > d, optiType o, CADSurfSharedPtr s)
Definition: NodeOptiCAD.h:79