Hermes2D  3.0
ogprojection.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_OGPROJECTION_H
17 #define __H2D_OGPROJECTION_H
18 
19 #include "../function/solution.h"
20 #include "../forms.h"
21 #include "../weakform/weakform.h"
22 
23 namespace Hermes
24 {
25  namespace Hermes2D
26  {
28  template<typename Scalar>
29  class HERMES_API OGProjection : public Hermes::Mixins::Loggable
30  {
31  public:
33  static void project_global(SpaceSharedPtr<Scalar> space,
34  MatrixFormVol<Scalar>* custom_projection_jacobian,
35  VectorFormVol<Scalar>* custom_projection_residual,
36  Scalar* target_vec);
37 
39  static void project_global(SpaceSharedPtr<Scalar> space,
40  MatrixFormVol<Scalar>* custom_projection_jacobian,
41  VectorFormVol<Scalar>* custom_projection_residual,
43 
45  static void project_global(const std::vector<SpaceSharedPtr<Scalar> > spaces,
46  const std::vector<MatrixFormVol<Scalar>*>& custom_projection_jacobian,
47  const std::vector<VectorFormVol<Scalar>*>& custom_projection_residual,
48  Scalar* target_vec);
49 
51  static void project_global(const std::vector<SpaceSharedPtr<Scalar> > spaces,
52  const std::vector<MatrixFormVol<Scalar>*>& custom_projection_jacobian,
53  const std::vector<VectorFormVol<Scalar>*>& custom_projection_residual,
54  const std::vector<MeshFunctionSharedPtr<Scalar> >& target_slns);
55 
72  static void project_global(SpaceSharedPtr<Scalar> space, MeshFunctionSharedPtr<Scalar> source_meshfn,
73  Scalar* target_vec, NormType proj_norm = HERMES_UNSET_NORM);
74 
75  static void project_global(SpaceSharedPtr<Scalar> space, MeshFunctionSharedPtr<Scalar> source_meshfn,
76  Hermes::Algebra::Vector<Scalar>* target_vec, NormType proj_norm = HERMES_UNSET_NORM);
77 
79  static void project_global(SpaceSharedPtr<Scalar> space,
81  NormType proj_norm = HERMES_UNSET_NORM);
82 
84  static void project_global(std::vector<SpaceSharedPtr<Scalar> > spaces, std::vector<MeshFunctionSharedPtr<Scalar> > source_meshfns,
85  Scalar* target_vec, std::vector<NormType> proj_norms = std::vector<NormType>());
86 
87  static void project_global(std::vector<SpaceSharedPtr<Scalar> > spaces, std::vector<MeshFunctionSharedPtr<Scalar> > source_meshfns,
88  Hermes::Algebra::Vector<Scalar>* target_vec, std::vector<NormType> proj_norms = std::vector<NormType>());
89 
90  static void project_global(std::vector<SpaceSharedPtr<Scalar> > spaces,
91  std::vector<MeshFunctionSharedPtr<Scalar> > source_slns, std::vector<MeshFunctionSharedPtr<Scalar> > target_slns,
92  std::vector<NormType> proj_norms = std::vector<NormType>(), bool delete_old_mesh = false);
93 
94  protected:
100  static void project_internal(SpaceSharedPtr<Scalar> space, WeakFormSharedPtr<Scalar> proj_wf, Scalar* target_vec);
101  };
102  }
103 }
104 #endif
Definition: adapt.h:24
Class for (global) orthogonal projecting. If the projection is not necessary (if a solution belongs t...
Definition: ogprojection.h:29
Used to pass the instances of Space around.
Definition: space.h:34
Used to pass the instances of WeakForm around.
Definition: weakform.h:55
Abstract, base class for matrix Volumetric form - i.e. MatrixForm, where the integration is with resp...
Definition: weakform.h:45
Abstract, base class for vector Volumetric form - i.e. VectorForm, where the integration is with resp...
Definition: weakform.h:46