GRINS-0.6.0
parabolic_profile.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
28 
29 // libMesh
30 #include "libmesh/point.h"
31 
32 namespace GRINS
33 {
34 
36  : libMesh::FunctionBase<libMesh::Number>(),
37  _a(0.0), _b(0.0), _c(-4.0), _d(0.0), _e(4.0), _f(0.0)
38  {
39  _initialized=true;
40  return;
41  }
42 
43  ParabolicProfile::ParabolicProfile( const double a, const double b, const double c,
44  const double d, const double e, const double f )
45  : libMesh::FunctionBase<libMesh::Number>(),
46  _a(a), _b(b), _c(c), _d(d), _e(e), _f(f)
47  {
48  _initialized=true;
49  return;
50  }
51 
53  {
54  return;
55  }
56 
57  libMesh::AutoPtr< libMesh::FunctionBase<libMesh::Number> > ParabolicProfile::clone() const
58  {
59  return libMesh::AutoPtr< libMesh::FunctionBase<libMesh::Number> >( new ParabolicProfile( _a, _b, _c, _d, _e, _f ) );
60  }
61 
62  libMesh::Number ParabolicProfile::operator()( const libMesh::Point &p,
63  const libMesh::Real )
64  {
65  const double x = p(0);
66  const double y = p(1);
67 
68  return this->eval( _a, _b, _c, _d, _e, _f, x, y );
69  }
70 
71  void ParabolicProfile::operator()( const libMesh::Point &p,
72  const libMesh::Real time,
73  libMesh::DenseVector<libMesh::Number> &output )
74  {
75  for( unsigned int i = 0; i < output.size(); i++ )
76  {
77  output(i) = (*this)(p, time);
78  }
79  return;
80  }
81 
82  libMesh::Number ParabolicProfile::component( unsigned int /*i*/,
83  const libMesh::Point &p,
84  const libMesh::Real time )
85  {
86  return (*this)(p, time);
87  }
88 
89 } // namespace GRINS
virtual libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > clone() const
double eval(const double a, const double b, const double c, const double d, const double e, const double f, const double x, const double y)
virtual libMesh::Number operator()(const libMesh::Point &p, const libMesh::Real time)
virtual libMesh::Number component(unsigned int i, const libMesh::Point &p, const libMesh::Real time)
GRINS namespace.
ParabolicProfile()
Default constructor.
double _a
Coefficients defining parabola.

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1