GRINS-0.8.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-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_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  virtual void reinit(MultiphysicsSystem & /*system*/) {}
83 
85 
86  virtual void element_qoi( AssemblyContext& /*context*/,
87  const unsigned int /*qoi_index*/ ){}
88 
90 
91  virtual void element_qoi_derivative( AssemblyContext & /*context*/,
92  const unsigned int /*qoi_index*/ ){}
93 
95 
96  virtual void side_qoi( AssemblyContext & /*context*/, const unsigned int /*qoi_index*/ ){}
97 
99 
100  virtual void side_qoi_derivative( AssemblyContext & /*context*/,
101  const unsigned int /*qoi_index*/ ){}
102 
104 
107  virtual void parallel_op( const libMesh::Parallel::Communicator& communicator,
108  libMesh::Number& sys_qoi,
109  libMesh::Number& local_qoi );
110 
112 
115  virtual void thread_join( libMesh::Number& qoi, const libMesh::Number& other_qoi );
116 
120  virtual void output_qoi( std::ostream& out ) const;
121 
123  libMesh::Number value() const;
124 
126  const std::string& name() const;
127 
128  protected:
129 
130  std::string _qoi_name;
131 
132  libMesh::Number _qoi_value;
133  };
134 
135  inline
136  libMesh::Number QoIBase::value() const
137  {
138  return _qoi_value;
139  }
140 
141  inline
142  const std::string& QoIBase::name() const
143  {
144  return _qoi_name;
145  }
146 
147 }
148 #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:130
const std::string & name() const
Returns the name of this QoI.
Definition: qoi_base.h:142
virtual void side_qoi_derivative(AssemblyContext &, const unsigned int)
Compute the qoi derivative with respect to the solution on the domain boundary.
Definition: qoi_base.h:100
virtual void side_qoi(AssemblyContext &, const unsigned int)
Compute the qoi value on the domain boundary.
Definition: qoi_base.h:96
virtual void element_qoi_derivative(AssemblyContext &, const unsigned int)
Compute the qoi derivative with respect to the solution on element interiors.
Definition: qoi_base.h:91
libMesh::Number _qoi_value
Definition: qoi_base.h:132
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 reinit(MultiphysicsSystem &)
Reinitialize QoI.
Definition: qoi_base.h:82
GRINS namespace.
virtual void init(const GetPot &, const MultiphysicsSystem &, unsigned int)
Method to allow QoI to cache any system information needed for QoI calculation, for example...
Definition: qoi_base.h:75
virtual void init_context(AssemblyContext &)
Definition: qoi_base.h:79
ParameterUser base class. Utility methods for subclasses.
virtual ~QoIBase()
Definition: qoi_base.h:54
Interface with libMesh for solving Multiphysics problems.
libMesh::Number value() const
Returns the current QoI value.
Definition: qoi_base.h:136
virtual void output_qoi(std::ostream &out) const
Basic output for computed QoI's.
Definition: qoi_base.C:61
virtual void element_qoi(AssemblyContext &, const unsigned int)
Compute the qoi value for element interiors.
Definition: qoi_base.h:86
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:56
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:45
virtual QoIBase * clone() const =0
Clone this QoI.

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