LILAC
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
example_integrator.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2014, Sam Schetterer, Nathan Kutz, University of Washington
3 Authors: Sam Schetterer
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9 
10 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11 
12 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 
16 */
17 #ifndef EXAMPLE_INTEGRATOR_H
18 #define EXAMPLE_INTEGRATOR_H
19 //example_rhs should be studied before this class
20 #include "engine/item.h"
21 #include "integrator.h"
23  //This holds a pointer to what will be the actual implementation
24  //We do this since the actual implementation is a template, so that it can integrate generic
25  //types without the performance problems of dynamic polymorphism
27  std::shared_ptr<example_integrator> actual_int;
28  public:
29  //This is the definition of the integrate function
30  //Nothing too interesting here, but \sa example_integrator_tmpl::integrate
32  int integrate(ptr_passer u, double t0, double tf);
33 
34  //Returns the type of the current class
35 
36  //This is the name that one would write in the input file to initialize this class
38  std::string type() const;
39 
41 
48  std::vector<std::string> dependencies() const;
49 
50  //This function processes the input data after being read from the file
51  //This is only called once, at the beginning of the program
52  //Updates from variables must be done in the update function
54  void postprocess(input& inval);
55 
56  //This returns the variable type of the integrator
57  //This is actually going to be done by the integrator
59  const std::type_info& vtype() const;
60 
61 };
62 #endif