waves
Basic FE playground
wFpeLSFunction.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 University of Liège
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef WFPELSFUNCTION_H
18 #define WFPELSFUNCTION_H
19 
20 #include "flow.h"
21 #include "wLinesearch.h"
22 #include "wNewton.h"
23 
24 #ifndef SWIG
25 
26 namespace flow
27 {
28 
33 class FLOW_API FpeLSFunction : public tbox::LSFunction
34 {
35 private:
37  std::vector<double> &u;
38  std::vector<double> u0;
39  Eigen::Map<Eigen::VectorXd> du;
40  Eigen::Map<Eigen::VectorXd> &fRes;
41 
42 public:
43  FpeLSFunction(flow::Newton &_solver, std::vector<double> &_u, std::vector<double> &_u0, Eigen::Map<Eigen::VectorXd> &_du, Eigen::Map<Eigen::VectorXd> &_fRes);
44  void update(std::vector<double> &_u0, Eigen::Map<Eigen::VectorXd> &_du);
45  virtual double eval(double alpha) override;
46 
47 #ifndef SWIG
48  virtual void write(std::ostream &out) const override;
49 #endif
50 };
51 
52 } // namespace flow
53 
54 #endif
55 
56 #endif //WFPELSFUNCTION_H
flow::FpeLSFunction::du
Eigen::Map< Eigen::VectorXd > du
change in solution
Definition: wFpeLSFunction.h:39
FLOW_API
#define FLOW_API
Definition: flow.h:29
flow
Namespace for flow module.
Definition: flow.h:37
flow::FpeLSFunction
Line search function for Full Potential Equation.
Definition: wFpeLSFunction.h:33
flow::FpeLSFunction::u
std::vector< double > & u
solution
Definition: wFpeLSFunction.h:37
flow::FpeLSFunction::fRes
Eigen::Map< Eigen::VectorXd > & fRes
residual vector
Definition: wFpeLSFunction.h:40
flow::FpeLSFunction::u0
std::vector< double > u0
initial solution
Definition: wFpeLSFunction.h:38
wNewton.h
flow.h
flow::Newton
Newton solver.
Definition: wNewton.h:35
flow::FpeLSFunction::solver
flow::Newton & solver
solver object (must be of Newton type)
Definition: wFpeLSFunction.h:36