GRINS-0.6.0
gaussian_xy_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 
35  GRINS::GaussianXYProfile::GaussianXYProfile( const double a, const double mu, const double sigma,
36  const double b )
37  : GaussianProfile(a,mu,sigma,b)
38  {
39  _initialized = true;
40  return;
41  }
42 
44  {
45  return;
46  }
47 
48  libMesh::AutoPtr< libMesh::FunctionBase<libMesh::Number> > GRINS::GaussianXYProfile::clone() const
49  {
50  return libMesh::AutoPtr< libMesh::FunctionBase<libMesh::Number> >( new GaussianXYProfile( _a, _mu, std::sqrt(_variance), _b ) );
51  }
52 
53  libMesh::Number GRINS::GaussianXYProfile::operator()( const libMesh::Point &p,
54  const libMesh::Real )
55  {
56  const double r = std::sqrt( p(0)*p(0) + p(1)*p(1) );
57 
58  return this->eval( r );
59  }
60 
61  void GRINS::GaussianXYProfile::operator()( const libMesh::Point &p,
62  const libMesh::Real time,
63  libMesh::DenseVector<libMesh::Number> &output )
64  {
65  for( unsigned int i = 0; i < output.size(); i++ )
66  {
67  output(i) = (*this)(p, time);
68  }
69  return;
70  }
71 
72  libMesh::Number GRINS::GaussianXYProfile::component( unsigned int /*i*/,
73  const libMesh::Point &p,
74  const libMesh::Real time )
75  {
76  return (*this)(p, time);
77  }
78 
79 } // namespace GRINS
virtual libMesh::Number operator()(const libMesh::Point &p, const libMesh::Real time)
Gaussian profile.
GRINS namespace.
virtual libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > clone() const
virtual libMesh::Number component(unsigned int i, const libMesh::Point &p, const libMesh::Real time)

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