GRINS-0.6.0
qoi_base.C
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 // This class
27 #include "grins/qoi_base.h"
28 
29 // libMesh
30 #include "libmesh/getpot.h"
31 #include "libmesh/fem_system.h"
32 #include "libmesh/quadrature.h"
33 
34 // GRINS
35 #include "grins/assembly_context.h"
36 
37 namespace GRINS
38 {
39  QoIBase::QoIBase( const std::string& qoi_name )
40  : ParameterUser(qoi_name),
41  _qoi_name(qoi_name),
42  _qoi_value(0.0)
43  {
44  return;
45  }
46 
48  {
49  return;
50  }
51 
52  void QoIBase::init( const GetPot& /*input*/,
53  const MultiphysicsSystem& /*system*/ )
54  {
55  return;
56  }
57 
59  {
60  return;
61  }
62 
64  const unsigned int /*qoi_index*/ )
65  {
66  return;
67  }
68 
70  const unsigned int /*qoi_index*/ )
71  {
72  return;
73  }
74 
75  void QoIBase::side_qoi( AssemblyContext& /*context*/,
76  const unsigned int /*qoi_index*/ )
77  {
78  return;
79  }
80 
82  const unsigned int /*qoi_index*/ )
83  {
84  return;
85  }
86 
87  void QoIBase::parallel_op( const libMesh::Parallel::Communicator& communicator,
88  libMesh::Number& sys_qoi,
89  libMesh::Number& local_qoi )
90  {
91  communicator.sum(local_qoi);
92 
93  sys_qoi = local_qoi;
94 
95  _qoi_value = sys_qoi;
96 
97  return;
98  }
99 
100  void QoIBase::thread_join( libMesh::Number& qoi, const libMesh::Number& other_qoi )
101  {
102  qoi += other_qoi;
103 
104  return;
105  }
106 
107  void QoIBase::output_qoi( std::ostream& out ) const
108  {
109  out << "==========================================================" << std::endl;
110 
111  out << _qoi_name+" = "
112  << std::setprecision(16)
113  << std::scientific
114  << _qoi_value << std::endl;
115 
116  out << "==========================================================" << std::endl;
117 
118  return;
119  }
120 
121 } // namespace GRINS
std::string _qoi_name
Definition: qoi_base.h:131
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
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
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

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