GRINS-0.7.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-2016 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 GRINS
43 {
44  // Forward declarations
45  class MultiphysicsSystem;
46  class AssemblyContext;
47 
48  class QoIBase : public ParameterUser
49  {
50  public:
51 
52  QoIBase( const std::string& qoi_name );
53 
54  virtual ~QoIBase();
55 
57 
61  virtual QoIBase* clone() const =0;
62 
64 
65  virtual bool assemble_on_interior() const =0;
66 
68 
69  virtual bool assemble_on_sides() const =0;
70 
75  virtual void init( const GetPot& input,
76  const MultiphysicsSystem& system,
77  unsigned int qoi_num );
78 
79  virtual void init_context( AssemblyContext& context );
80 
82 
83  virtual void element_qoi( AssemblyContext& context,
84  const unsigned int qoi_index );
85 
87 
88  virtual void element_qoi_derivative( AssemblyContext &context,
89  const unsigned int qoi_index );
90 
92 
93  virtual void side_qoi( AssemblyContext& context, const unsigned int qoi_index );
94 
96 
97  virtual void side_qoi_derivative( AssemblyContext& context,
98  const unsigned int qoi_index );
99 
101 
104  virtual void parallel_op( const libMesh::Parallel::Communicator& communicator,
105  libMesh::Number& sys_qoi,
106  libMesh::Number& local_qoi );
107 
109 
112  virtual void thread_join( libMesh::Number& qoi, const libMesh::Number& other_qoi );
113 
117  virtual void output_qoi( std::ostream& out ) const;
118 
120  libMesh::Number value() const;
121 
123  const std::string& name() const;
124 
125  protected:
126 
127  std::string _qoi_name;
128 
129  libMesh::Number _qoi_value;
130  };
131 
132  inline
133  libMesh::Number QoIBase::value() const
134  {
135  return _qoi_value;
136  }
137 
138  inline
139  const std::string& QoIBase::name() const
140  {
141  return _qoi_name;
142  }
143 
144 }
145 #endif // GRINS_QOI_BASE_H
std::string _qoi_name
Definition: qoi_base.h:127
const std::string & name() const
Returns the name of this QoI.
Definition: qoi_base.h:139
virtual ~QoIBase()
Definition: qoi_base.C:47
libMesh::Number _qoi_value
Definition: qoi_base.h:129
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:70
virtual bool assemble_on_sides() const =0
Does the QoI need a domain boundary assembly loop?
virtual void init(const GetPot &input, const MultiphysicsSystem &system, unsigned int qoi_num)
Method to allow QoI to cache any system information needed for QoI calculation, for example...
Definition: qoi_base.C:53
QoIBase(const std::string &qoi_name)
Definition: qoi_base.C:39
virtual void init_context(AssemblyContext &context)
Definition: qoi_base.C:59
GRINS namespace.
virtual QoIBase * clone() const =0
Clone this QoI.
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:82
ParameterUser base class. Utility methods for subclasses.
virtual bool assemble_on_interior() const =0
Does the QoI need an element interior assembly loop?
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:64
libMesh::Number value() const
Returns the current QoI value.
Definition: qoi_base.h:133
virtual void output_qoi(std::ostream &out) const
Basic output for computed QoI's.
Definition: qoi_base.C:108
virtual void side_qoi(AssemblyContext &context, const unsigned int qoi_index)
Compute the qoi value on the domain boundary.
Definition: qoi_base.C:76
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:101
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:88

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10