Hermes2D  2.0
localprojection.h
1 // This file is part of Hermes2D.
2 //
3 // Hermes2D is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // Hermes2D is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef __H2D_LOCALPROJECTION_H
17 #define __H2D_LOCALPROJECTION_H
18 
19 #include "../function/solution.h"
20 #include "../forms.h"
21 #include "../weakform/weakform.h"
22 #include "../views/scalar_view.h"
23 
24 namespace Hermes
25 {
26  namespace Hermes2D
27  {
29  template<typename Scalar>
30  class HERMES_API LocalProjection
31  {
32  public:
34 
35  // Main functionality.
36  static void project_local(const Space<Scalar>* space, MeshFunction<Scalar>* meshfn,
37  Scalar* target_vec, ProjNormType proj_norm = HERMES_UNSET_NORM);
38 
39  // Wrapper that delivers a Solution instead of coefficient vector.
40  static void project_local(const Space<Scalar>* space,
41  Solution<Scalar>* source_sln, Solution<Scalar>* target_sln, ProjNormType proj_norm = HERMES_UNSET_NORM);
42 
43  // Wrapper that takes multiple MeshFunctions.
44  static void project_local(Hermes::vector<const Space<Scalar>*> spaces, Hermes::vector<MeshFunction<Scalar>*> meshfns,
45  Scalar* target_vec, Hermes::vector<ProjNormType> proj_norms = Hermes::vector<ProjNormType>());
46 
47  // Wrapper that takes multiple Solutions.
48  static void project_local(Hermes::vector<const Space<Scalar>*> spaces, Hermes::vector<Solution<Scalar>*> slns,
49  Scalar* target_vec, Hermes::vector<ProjNormType> proj_norms = Hermes::vector<ProjNormType>());
50 
51  // Wrapper that delivers Solutions instead of a coefficient vector.
52  static void project_local(Hermes::vector<const Space<Scalar>*> spaces,
53  Hermes::vector<Solution<Scalar>*> source_slns, Hermes::vector<Solution<Scalar>*> target_slns,
54  Hermes::vector<ProjNormType> proj_norms = Hermes::vector<ProjNormType>(), bool delete_old_mesh = false);
55 
56  protected:
57  static int ndof;
58  };
59  }
60 }
61 #endif