GRINS-0.6.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-2015 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] + fe->get_detadx()[qp],
52  fe->get_dxidy()[qp] + fe->get_detady()[qp] );
53 
54  if( c.get_dim() == 3 )
55  {
56  g(0) += fe->get_dzetadx()[qp];
57  g(1) += fe->get_dzetady()[qp];
58  g(2) = fe->get_dxidz()[qp] + fe->get_detadz()[qp] + fe->get_dzetadz()[qp];
59  }
60 
61  return g;
62  }
63 
64  libMesh::RealTensor StabilizationHelper::compute_G( libMesh::FEBase* fe,
65  AssemblyContext& c,
66  unsigned int qp ) const
67  {
68  libMesh::Real dxidx = fe->get_dxidx()[qp];
69  libMesh::Real dxidy = fe->get_dxidy()[qp];
70 
71  libMesh::Real detadx = fe->get_detadx()[qp];
72  libMesh::Real detady = fe->get_detady()[qp];
73 
74  libMesh::RealTensor G( dxidx*dxidx + detadx*detadx,
75  dxidx*dxidy + detadx*detady,
76  0.0,
77  dxidy*dxidx + detady*detadx,
78  dxidy*dxidy + detady*detady,
79  0.0 );
80 
81  if( c.get_dim() == 3 )
82  {
83  libMesh::Real dxidz = fe->get_dxidz()[qp];
84 
85  libMesh::Real detadz = fe->get_detadz()[qp];
86 
87  libMesh::Real dzetadx = fe->get_dzetadx()[qp];
88  libMesh::Real dzetady = fe->get_dzetady()[qp];
89  libMesh::Real dzetadz = fe->get_dzetadz()[qp];
90 
91  G(0,0) += dzetadx*dzetadx;
92  G(0,1) += dzetadx*dzetady;
93  G(0,2) = dxidx*dxidz + detadx*detadz + dzetadx*dzetadz;
94  G(1,0) += dzetady*dzetadx;
95  G(1,1) += dzetady*dzetady;
96  G(1,2) = dxidy*dxidz + detady*detadz + dzetady*dzetadz;
97  G(2,0) = dxidz*dxidx + detadz*detadx + dzetadz*dzetadx;
98  G(2,1) = dxidz*dxidy + detadz*detady + dzetadz*dzetady;
99  G(2,2) = dxidz*dxidz + detadz*detadz + dzetadz*dzetadz;
100  }
101 
102  return G;
103  }
104 
105 } // namespace GRINS
libMesh::RealTensor compute_G(libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
Definition: stab_helper.C:64
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 Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1