GRINS-0.8.0
integrated_function.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 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 #ifndef GRINS_INTEGRATED_FUNCTION_H
27 #define GRINS_INTEGRATED_FUNCTION_H
28 
29 // libMesh
30 #include "libmesh/quadrature.h"
31 #include "libmesh/exact_solution.h"
32 
33 // GRINS
34 #include "grins/qoi_base.h"
36 #include "grins/rayfire_mesh.h"
38 
39 namespace GRINS
40 {
41 
43 
52  template<typename Function>
53  class IntegratedFunction : public QoIBase
54  {
55  public:
57 
63  IntegratedFunction(unsigned int p_level, SharedPtr<Function> f, RayfireMesh * rayfire, const std::string & qoi_name);
64 
66 
69  IntegratedFunction(const GetPot & input, unsigned int p_level, SharedPtr<Function> f, const std::string & input_qoi_string, const std::string & qoi_name);
70 
72 
75  IntegratedFunction(const IntegratedFunction & original);
76 
78  virtual QoIBase* clone() const;
79 
80  virtual bool assemble_on_interior() const;
81 
82  virtual bool assemble_on_sides() const;
83 
85  virtual void element_qoi( AssemblyContext & context,
86  const unsigned int qoi_index );
87 
89 
92  virtual void element_qoi_derivative( AssemblyContext & context,
93  const unsigned int qoi_index );
94 
96  virtual void init( const GetPot & input,
97  const MultiphysicsSystem & system,
98  unsigned int qoi_num );
99 
101  virtual void reinit(MultiphysicsSystem & system);
102 
104  {
105  return *(_rayfire.get());
106  }
107 
108  private:
110  unsigned int _p_level;
111 
113  SharedPtr<Function> _f;
114 
116  libMesh::UniquePtr<RayfireMesh> _rayfire;
117 
119  libMesh::Real qoi_value(Function & f, AssemblyContext & context, const libMesh::Point & xyz);
120 
122  void qoi_derivative(Function & f, AssemblyContext & context, const libMesh::Point & qp_xyz,
123  const libMesh::Real JxW, const unsigned int qoi_index);
124 
127 
128  };
129 
130  template<typename Function>
131  inline
133  {
134  return true;
135  }
136 
137  template<typename Function>
138  inline
140  {
141  return false;
142  }
143 }
144 #endif //GRINS_INTEGRATED_FUNCTION_H
virtual void reinit(MultiphysicsSystem &system)
Reinitialize the rayfire.
virtual QoIBase * clone() const
Required to provide clone (deep-copy) for adding QoI object to libMesh objects.
libMesh::UniquePtr< RayfireMesh > _rayfire
Pointer to RayfireMesh object.
RayfireMesh.
Definition: rayfire_mesh.h:65
libMesh::Real qoi_value(Function &f, AssemblyContext &context, const libMesh::Point &xyz)
Compute the value of a QoI at a QP.
unsigned int _p_level
Quadrature order.
virtual bool assemble_on_sides() const
Does the QoI need a domain boundary assembly loop?
virtual void element_qoi(AssemblyContext &context, const unsigned int qoi_index)
Compute the qoi value.
GRINS namespace.
void qoi_derivative(Function &f, AssemblyContext &context, const libMesh::Point &qp_xyz, const libMesh::Real JxW, const unsigned int qoi_index)
Compute derivatiuves at QP.
virtual void init(const GetPot &input, const MultiphysicsSystem &system, unsigned int qoi_num)
Initializes the rayfire with the mesh from system.
Interface with libMesh for solving Multiphysics problems.
virtual bool assemble_on_interior() const
Does the QoI need an element interior assembly loop?
const RayfireMesh & get_rayfire()
virtual void element_qoi_derivative(AssemblyContext &context, const unsigned int qoi_index)
Compute the qoi derivative with respect to the solution.
SharedPtr< Function > _f
Pointer to the template class used for function evaluation.
IntegratedFunction()
User cannot call empty constructor.

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1