GRINS-0.6.0
qoi_base.h
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 #ifndef GRINS_QOI_BASE_H
27 #define GRINS_QOI_BASE_H
28 
29 // C++
30 #include <iomanip>
31 
32 // libMesh
33 #include "libmesh/diff_qoi.h"
34 
35 // GRINS
36 #include "grins/parameter_user.h"
37 #include "grins/var_typedefs.h"
38 
39 // libMesh forward declarations
40 class GetPot;
41 
42 namespace libMesh
43 {
44  template <typename Scalar>
45  class ParameterMultiPointer;
46 }
47 
48 namespace GRINS
49 {
50  // Forward declarations
51  class MultiphysicsSystem;
52  class AssemblyContext;
53 
54  class QoIBase : public ParameterUser
55  {
56  public:
57 
58  QoIBase( const std::string& qoi_name );
59 
60  virtual ~QoIBase();
61 
63 
67  virtual QoIBase* clone() const =0;
68 
70 
71  virtual bool assemble_on_interior() const =0;
72 
74 
75  virtual bool assemble_on_sides() const =0;
76 
81  virtual void init( const GetPot& input, const MultiphysicsSystem& system );
82 
83  virtual void init_context( AssemblyContext& context );
84 
86 
87  virtual void element_qoi( AssemblyContext& context,
88  const unsigned int qoi_index );
89 
91 
92  virtual void element_qoi_derivative( AssemblyContext &context,
93  const unsigned int qoi_index );
94 
96 
97  virtual void side_qoi( AssemblyContext& context, const unsigned int qoi_index );
98 
100 
101  virtual void side_qoi_derivative( AssemblyContext& context,
102  const unsigned int qoi_index );
103 
105 
108  virtual void parallel_op( const libMesh::Parallel::Communicator& communicator,
109  libMesh::Number& sys_qoi,
110  libMesh::Number& local_qoi );
111 
113 
116  virtual void thread_join( libMesh::Number& qoi, const libMesh::Number& other_qoi );
117 
121  virtual void output_qoi( std::ostream& out ) const;
122 
124  libMesh::Number value() const;
125 
127  const std::string& name() const;
128 
129  protected:
130 
131  std::string _qoi_name;
132 
133  libMesh::Number _qoi_value;
134  };
135 
136  inline
137  libMesh::Number QoIBase::value() const
138  {
139  return _qoi_value;
140  }
141 
142  inline
143  const std::string& QoIBase::name() const
144  {
145  return _qoi_name;
146  }
147 
148 }
149 #endif // GRINS_QOI_BASE_H
virtual bool assemble_on_interior() const =0
Does the QoI need an element interior assembly loop?
std::string _qoi_name
Definition: qoi_base.h:131
const std::string & name() const
Returns the name of this QoI.
Definition: qoi_base.h:143
virtual ~QoIBase()
Definition: qoi_base.C:47
libMesh::Number _qoi_value
Definition: qoi_base.h:133
virtual void element_qoi_derivative(AssemblyContext &context, const unsigned int qoi_index)
Compute the qoi derivative with respect to the solution on element interiors.
Definition: qoi_base.C:69
virtual void init(const GetPot &input, const MultiphysicsSystem &system)
Method to allow QoI to cache any system information needed for QoI calculation, for example...
Definition: qoi_base.C:52
virtual bool assemble_on_sides() const =0
Does the QoI need a domain boundary assembly loop?
QoIBase(const std::string &qoi_name)
Definition: qoi_base.C:39
virtual void init_context(AssemblyContext &context)
Definition: qoi_base.C:58
GRINS namespace.
virtual void side_qoi_derivative(AssemblyContext &context, const unsigned int qoi_index)
Compute the qoi derivative with respect to the solution on the domain boundary.
Definition: qoi_base.C:81
ParameterUser base class. Utility methods for subclasses.
Interface with libMesh for solving Multiphysics problems.
virtual void element_qoi(AssemblyContext &context, const unsigned int qoi_index)
Compute the qoi value for element interiors.
Definition: qoi_base.C:63
libMesh::Number value() const
Returns the current QoI value.
Definition: qoi_base.h:137
virtual void output_qoi(std::ostream &out) const
Basic output for computed QoI's.
Definition: qoi_base.C:107
virtual void side_qoi(AssemblyContext &context, const unsigned int qoi_index)
Compute the qoi value on the domain boundary.
Definition: qoi_base.C:75
virtual void thread_join(libMesh::Number &qoi, const libMesh::Number &other_qoi)
Call the operation to accumulate this QoI from multiple threads.
Definition: qoi_base.C:100
virtual void parallel_op(const libMesh::Parallel::Communicator &communicator, libMesh::Number &sys_qoi, libMesh::Number &local_qoi)
Call the parallel operation for this QoI and cache the value.
Definition: qoi_base.C:87
virtual QoIBase * clone() const =0
Clone this QoI.

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