GRINS-0.7.0
parsed_velocity_source_base.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 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
28 
29 // GRINS
31 
32 // libMesh
33 #include "libmesh/parsed_fem_function.h"
34 
35 namespace GRINS
36 {
37 
38  template<class Mu>
39  ParsedVelocitySourceBase<Mu>::ParsedVelocitySourceBase( const std::string& physics_name, const GetPot& input )
40  : IncompressibleNavierStokesBase<Mu>(physics_name,
41  PhysicsNaming::incompressible_navier_stokes(), /* "core" Physics name */
42  input),
43  _input(input)
44  {
45  }
46 
47  template<class Mu>
49  {
50  return;
51  }
52 
53  template<class Mu>
54  void ParsedVelocitySourceBase<Mu>::set_time_evolving_vars ( libMesh::FEMSystem* system)
55  {
56  std::string base_physics_name = "ParsedVelocitySource";
57 
60  this->velocity_source_function.reset(vsf);
61 
62  this->set_parameter(*vsf, _input,
63  "Physics/"+base_physics_name+"/source_function",
64  "DIE!");
65  }
66 
67  template<class Mu>
69  ( const libMesh::Point& point,
70  const libMesh::Real time,
71  const AssemblyContext &c,
72  libMesh::NumberVectorValue& F,
73  libMesh::NumberTensorValue *dFdU)
74  {
75  libmesh_assert(velocity_source_function.get());
76 
77  libMesh::DenseVector<libMesh::Number> output_vec(3);
78 
79  (*velocity_source_function)(c, point, time,
80  output_vec);
81 
82  F(0) = output_vec(0);
83  F(1) = output_vec(1);
84  F(2) = output_vec(2);
85 
86  if (dFdU)
87  for (unsigned int i=0; i != 3; ++i)
88  for (unsigned int j=0; j != 3; ++j)
89  (*dFdU)(i,j) = 0; // FIXME
90 
91  if (F(0) || F(1) || F(2))
92  return true;
93 
94  return false;
95  }
96 
97 } // namespace GRINS
98 
99 // Instantiate
100 INSTANTIATE_INC_NS_SUBCLASS(ParsedVelocitySourceBase);
Physics class for Incompressible Navier-Stokes.
void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
bool compute_force(const libMesh::Point &point, const libMesh::Real time, const AssemblyContext &c, libMesh::NumberVectorValue &F, libMesh::NumberTensorValue *dFdU=NULL)
GRINS namespace.
INSTANTIATE_INC_NS_SUBCLASS(ParsedVelocitySourceBase)

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10