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