libMesh
adjoint_initial.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 #include "adjoint_initial.h"
21 
22 using namespace libMesh;
23 
25 {
26 }
27 
29 {
30 }
31 
32 
33 
34 // Initial conditions
36  const Parameters &,
37  const std::string &,
38  const std::string &)
39 {
40  Real x = p(0), y = p(1);
41 
42  return (sin(M_PI * x) * sin(M_PI * y));
43 }
44 
45 
46 
48  const Parameters &,
49  const std::string &,
50  const std::string &)
51 {
52  Real x = p(0), y = p(1);
53 
54  return Gradient(Number(M_PI*cos(M_PI * x) * sin(M_PI * y)),
55  Number(M_PI*sin(M_PI * x) * cos(M_PI * y)));
56 }
This class provides the ability to map between arbitrary, user-defined strings and several data types...
Definition: parameters.h:63
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
The libMesh namespace provides an interface to certain functionality in the library.
void adjoint_read_initial_parameters()
void adjoint_finish_initialization()
Number adjoint_initial_value(const Point &p, const Parameters &, const std::string &, const std::string &)
PetscErrorCode Vec x
NumberVectorValue Gradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
Gradient adjoint_initial_grad(const Point &p, const Parameters &, const std::string &, const std::string &)