diff_qoi.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_DIFF_QOI_H
21 #define LIBMESH_DIFF_QOI_H
22 
23 // Local Includes
24 #include "libmesh/auto_ptr.h" // deprecated
25 #include "libmesh/parallel.h"
26 #include "libmesh/diff_context.h"
27 
28 // C++ includes
29 #include <memory>
30 
31 namespace libMesh
32 {
33 
34 // Forward declarations
35 class DiffContext;
36 class QoISet;
37 
51 {
52 public:
53 
59 
63  virtual ~DifferentiableQoI () {}
64 
69  virtual void init_qoi( std::vector<Number> & /*sys_qoi*/){}
70 
75  virtual void clear_qoi () {}
76 
84 
92 
100 
108  virtual void element_qoi (DiffContext &,
109  const QoISet &)
110  {}
111 
121  const QoISet &)
122  {}
123 
131  virtual void side_qoi (DiffContext &,
132  const QoISet &)
133  {}
134 
144  const QoISet &)
145  {}
146 
153  virtual void init_context(DiffContext &) {}
154 
158  virtual std::unique_ptr<DifferentiableQoI> clone() =0;
159 
163  virtual void thread_join(std::vector<Number> & qoi,
164  const std::vector<Number> & other_qoi,
165  const QoISet & qoi_indices);
166 
171  virtual void parallel_op(const Parallel::Communicator & communicator,
172  std::vector<Number> & sys_qoi,
173  std::vector<Number> & local_qoi,
174  const QoISet & qoi_indices);
175 
180  virtual void finalize_derivative(NumericVector<Number> & derivatives, std::size_t qoi_index);
181 };
182 
183 } // namespace libMesh
184 
185 
186 #endif // LIBMESH_DIFF_QOI_H
virtual void finalize_derivative(NumericVector< Number > &derivatives, std::size_t qoi_index)
Used to specify quantities of interest in a simulation.
Definition: qoi_set.h:45
virtual void init_context(DiffContext &)
Definition: diff_qoi.h:153
MPI_Comm communicator
Definition: communicator.h:57
virtual void element_qoi(DiffContext &, const QoISet &)
Definition: diff_qoi.h:108
virtual void thread_join(std::vector< Number > &qoi, const std::vector< Number > &other_qoi, const QoISet &qoi_indices)
virtual void parallel_op(const Parallel::Communicator &communicator, std::vector< Number > &sys_qoi, std::vector< Number > &local_qoi, const QoISet &qoi_indices)
virtual void clear_qoi()
Definition: diff_qoi.h:75
virtual void side_qoi(DiffContext &, const QoISet &)
Definition: diff_qoi.h:131
virtual std::unique_ptr< DifferentiableQoI > clone()=0
virtual void side_qoi_derivative(DiffContext &, const QoISet &)
Definition: diff_qoi.h:143
virtual ~DifferentiableQoI()
Definition: diff_qoi.h:63
virtual void element_qoi_derivative(DiffContext &, const QoISet &)
Definition: diff_qoi.h:120
virtual void init_qoi(std::vector< Number > &)
Definition: diff_qoi.h:69