MAST
frequency_domain_pressure_function.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 
21 #ifndef __mast__frequency_domain_pressure_function_h__
22 #define __mast__frequency_domain_pressure_function_h__
23 
24 
25 // MAST includes
27 
28 
29 // libMesh includes
30 #include "libmesh/system.h"
31 #include "libmesh/mesh_function.h"
32 
33 
34 namespace MAST {
35 
36  // Forward declerations
37  class FrequencyFunction;
38  class SystemInitialization;
39  class FlightCondition;
40 
41 
43  public MAST::FieldFunction<Complex> {
44 
45  public:
46 
49 
50 
52 
53 
57  void set_calculate_cp(bool if_cp) {
58 
59  _if_cp = if_cp;
60  }
61 
62 
66  void init(const libMesh::NumericVector<Real>& steady_sol,
67  const libMesh::NumericVector<Real>& small_dist_sol_real,
68  const libMesh::NumericVector<Real>& small_dist_sol_imag);
69 
70 
74  virtual void
75  operator() (const libMesh::Point& p,
76  const Real t,
77  Complex& dp) const;
78 
79 
80  protected:
81 
86  bool _if_cp;
87 
92 
93 
98 
99 
103  std::unique_ptr<libMesh::MeshFunction>
107 
111  std::unique_ptr<libMesh::NumericVector<Real> > _sol;
112 
116  std::unique_ptr<libMesh::NumericVector<Real> > _dsol_real;
117 
121  std::unique_ptr<libMesh::NumericVector<Real> > _dsol_imag;
122 
123  };
124 }
125 
126 
127 #endif // __mast__frequency_domain_pressure_function_h__
virtual void operator()(const libMesh::Point &p, const Real t, Complex &dp) const
provides the complex pressure perturbation
MAST::SystemInitialization & _system
system associated with the mesh and solution vector
std::unique_ptr< libMesh::MeshFunction > _dsol_im_function
libMesh::Real Real
libMesh::Complex Complex
std::unique_ptr< libMesh::NumericVector< Real > > _sol
steady part of solution
std::unique_ptr< libMesh::MeshFunction > _sol_function
mesh function that interpolates the solution
void set_calculate_cp(bool if_cp)
sets the mode of the pressure value return
FrequencyDomainPressureFunction(MAST::SystemInitialization &sys, MAST::FlightCondition &flt)
This creates the base class for functions that have a saptial and temporal dependence, and provide sensitivity operations with respect to the functions and parameters.
std::unique_ptr< libMesh::NumericVector< Real > > _dsol_imag
imag part of small-disturbance solution
void init(const libMesh::NumericVector< Real > &steady_sol, const libMesh::NumericVector< Real > &small_dist_sol_real, const libMesh::NumericVector< Real > &small_dist_sol_imag)
initiate the mesh function for this solution
std::unique_ptr< libMesh::MeshFunction > _dsol_re_function
bool _if_cp
the function will return cp instead of pressure if this option is true.
std::unique_ptr< libMesh::NumericVector< Real > > _dsol_real
real part of small-disturbance solution
MAST::FlightCondition & _flt_cond
flight condition