Nektar++
ElUtil.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_PROCESSVAROPTI_ELUTIL
36 #define UTILITIES_NEKMESH_PROCESSVAROPTI_ELUTIL
37 
39 
41 
42 namespace Nektar
43 {
44 namespace Utilities
45 {
46 
47 using namespace NekMeshUtils;
48 
49 struct DerivUtil;
50 struct Residual;
51 
52 typedef std::shared_ptr<DerivUtil> DerivUtilSharedPtr;
53 typedef std::shared_ptr<Residual> ResidualSharedPtr;
54 
55 class ElUtilJob;
56 
57 class ElUtil : public std::enable_shared_from_this<ElUtil>
58 {
59 public:
60  ElUtil(ElementSharedPtr e, DerivUtilSharedPtr d,
61  ResidualSharedPtr, int n, int o);
62 
63  ElUtilJob *GetJob();
64 
65  int GetId()
66  {
67  return m_el->GetId();
68  }
69 
70  //leaving these varibles as public for sake of efficency
71  std::vector<std::vector<NekDouble *> > nodes;
72  std::vector<std::vector<NekDouble> > maps, mapsStd;
73 
74  void Evaluate();
75  void InitialMinJac();
76 
78  {
79  return m_el;
80  }
81 
82  int NodeId(int in)
83  {
84  return m_idmap[in];
85  }
86 
88  {
89  return m_scaledJac;
90  }
91 
93  {
94  return m_minJac;
95  }
96 
97 private:
98 
99  void MappingIdealToRef();
100 
102  int m_dim;
103  int m_mode;
104  int m_order;
105  std::map<int,int> m_idmap;
106 
109 
110  DerivUtilSharedPtr m_derivUtil;
111  ResidualSharedPtr m_res;
112 };
113 typedef std::shared_ptr<ElUtil> ElUtilSharedPtr;
114 
116 {
117 public:
118  ElUtilJob(ElUtil* e) : el(e) {}
119 
120  void Run()
121  {
122  el->Evaluate();
123  }
124 private:
126 };
127 
128 }
129 }
130 
131 #endif
std::shared_ptr< DerivUtil > DerivUtilSharedPtr
Definition: ElUtil.h:50
std::map< int, int > m_idmap
Definition: ElUtil.h:105
ElementSharedPtr m_el
Definition: ElUtil.h:101
std::vector< std::vector< NekDouble * > > nodes
Definition: ElUtil.h:71
std::shared_ptr< Residual > ResidualSharedPtr
Definition: ElUtil.h:53
int NodeId(int in)
Definition: ElUtil.h:82
ResidualSharedPtr m_res
Definition: ElUtil.h:111
std::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:49
double NekDouble
ElementSharedPtr GetEl()
Definition: ElUtil.h:77
NekDouble GetScaledJac()
Definition: ElUtil.h:87
std::vector< std::vector< NekDouble > > mapsStd
Definition: ElUtil.h:72
Base class for tasks to be sent to the ThreadManager to run.
Definition: Thread.h:97
NekDouble & GetMinJac()
Definition: ElUtil.h:92
std::shared_ptr< ElUtil > ElUtilSharedPtr
Definition: ElUtil.h:113
DNekMat MappingIdealToRef(SpatialDomains::GeometrySharedPtr geom)
DerivUtilSharedPtr m_derivUtil
Definition: ElUtil.h:110