GRINS-0.8.0
stab_helper.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 // This class
27 #include "grins/stab_helper.h"
28 
29 // GRINS
30 #include "grins/assembly_context.h"
31 
32 namespace GRINS
33 {
34 
36  ( const std::string & helper_name ) :
37  ParameterUser(helper_name)
38  {
39  return;
40  }
41 
43  {
44  return;
45  }
46 
47  libMesh::RealGradient StabilizationHelper::compute_g( libMesh::FEBase* fe,
48  AssemblyContext& c,
49  unsigned int qp ) const
50  {
51  libMesh::RealGradient g( fe->get_dxidx()[qp] );
52 
53  if( c.get_dim() > 1 )
54  {
55  g(0) += fe->get_detadx()[qp];
56  g(1) = fe->get_dxidy()[qp] + fe->get_detady()[qp];
57  }
58 
59  if( c.get_dim() == 3 )
60  {
61  g(0) += fe->get_dzetadx()[qp];
62  g(1) += fe->get_dzetady()[qp];
63  g(2) = fe->get_dxidz()[qp] + fe->get_detadz()[qp] + fe->get_dzetadz()[qp];
64  }
65 
66  return g;
67  }
68 
69  libMesh::RealTensor StabilizationHelper::compute_G( libMesh::FEBase* fe,
70  AssemblyContext& c,
71  unsigned int qp ) const
72  {
73  libMesh::Real dxidx = fe->get_dxidx()[qp];
74 
75  libMesh::RealTensor G( dxidx*dxidx );
76 
77  if( c.get_dim() > 1 )
78  {
79  libMesh::Real dxidy = fe->get_dxidy()[qp];
80 
81  libMesh::Real detadx = fe->get_detadx()[qp];
82  libMesh::Real detady = fe->get_detady()[qp];
83 
84  G(0,0) += detadx*detadx;
85  G(0,1) = G(1,0) = dxidx*dxidy + detadx*detady;
86  G(1,1) = dxidy*dxidy + detady*detady;
87 
88  if( c.get_dim() == 3 )
89  {
90  libMesh::Real dxidz = fe->get_dxidz()[qp];
91 
92  libMesh::Real detadz = fe->get_detadz()[qp];
93 
94  libMesh::Real dzetadx = fe->get_dzetadx()[qp];
95  libMesh::Real dzetady = fe->get_dzetady()[qp];
96  libMesh::Real dzetadz = fe->get_dzetadz()[qp];
97 
98  G(0,0) += dzetadx*dzetadx;
99  G(0,1) += dzetadx*dzetady;
100  G(0,2) = dxidx*dxidz + detadx*detadz + dzetadx*dzetadz;
101  G(1,0) += dzetady*dzetadx;
102  G(1,1) += dzetady*dzetady;
103  G(1,2) = dxidy*dxidz + detady*detadz + dzetady*dzetadz;
104  G(2,0) = dxidz*dxidx + detadz*detadx + dzetadz*dzetadx;
105  G(2,1) = dxidz*dxidy + detadz*detady + dzetadz*dzetady;
106  G(2,2) = dxidz*dxidz + detadz*detadz + dzetadz*dzetadz;
107  }
108  }
109 
110  return G;
111  }
112 
113 } // namespace GRINS
libMesh::RealTensor compute_G(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:69
GRINS namespace.
libMesh::RealGradient compute_g(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:47
ParameterUser base class. Utility methods for subclasses.
StabilizationHelper(const std::string &helper_name)
Definition: stab_helper.C:36

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1