LifeV
Interpolation.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief A short description of the file content
30 
31  @author Davide Forti <forti@mathicsepc48.epfl.ch>
32  @date 14 Mar 2013
33 
34  A more detailed description of the file (if necessary)
35  */
36 
37 #ifndef INTERPOLATION_H
38 #define INTERPOLATION_H 1
39 
40 #include <lifev/core/mesh/RegionMesh.hpp>
41 #include <lifev/core/fem/FESpace.hpp>
42 #include <lifev/core/array/MatrixEpetra.hpp>
43 #include <lifev/core/algorithm/PreconditionerIfpack.hpp>
44 #include <lifev/core/algorithm/LinearSolver.hpp>
45 #include <Teuchos_ParameterList.hpp>
46 #include <Teuchos_XMLParameterListHelpers.hpp>
47 #include <Teuchos_RCP.hpp>
48 
49 #include <lifev/core/fem/CurrentFEManifold.hpp>
50 
51 namespace LifeV
52 {
53 
55 {
56 public:
57 
71  typedef FESpace<mesh_Type, MapEpetra> FESpace_Type;
73 
74  Interpolation();
75 
76  ~Interpolation();
77 
78  void setup( const GetPot& datafile, parameterList_Type belosList );
79 
80  void setFlag( const UInt& flag ) { M_flag = flag; }
81 
82  void buildTableDofs_known ( const FESpacePtr_Type& fespace );
83 
84  void buildTableDofs_unknown ( const FESpacePtr_Type& fespace );
85 
86  void identifyNodes_known ( );
87 
88  void identifyNodes_unknown ( );
89 
90  void setVectors (const vectorPtr_Type& KnownField, const vectorPtr_Type& UnknownField );
91 
93 
95 
96  void buildOperators();
97 
98  void interpolationOperator();
99 
100  void projectionOperator();
101 
102  void expandGammaToOmega_Known(const vectorPtr_Type& vectorOnGamma, vectorPtr_Type& vectorOnOmega);
103 
104  void restrictOmegaToGamma_Known(const vectorPtr_Type& vectorOnOmega, vectorPtr_Type& vectorOnGamma);
105 
106  void interpolate();
107 
108  void solution (vectorPtr_Type& Solution);
109 
110  void getSolutionOnGamma (vectorPtr_Type& GammaSolution) { GammaSolution.reset(new vector_Type ( *M_solutionOnGamma ) ); };
111 
112  void updateRhs(const vectorPtr_Type& newRhs);
113 
114  void getInterpolationOperatorMap ( mapPtr_Type& map ) { map.reset(new map_Type(*M_interpolationOperatorMap) ); };
115 
116  void getprojectionOperatorMap (mapPtr_Type& map) { map.reset(new map_Type(*M_projectionOperatorMap)); };
117 
118  void getKnownInterfaceMap(mapPtr_Type& map){ map.reset ( new map_Type(*M_knownInterfaceMap) ); };
119 
120  void getNumerationInterfaceKnown(vectorPtr_Type& vector){ vector.reset ( new vector_Type ( *M_numerationInterfaceKnown ) ); };
121 
122  void getVectorialInterpolationMap ( mapPtr_Type& map ) { map.reset ( new map_Type(*M_interpolationOperatorMapVectorial) ); };
123 
124  void free_space ();
125 
126  void setMeshSize(const Real& mesh_size ) { M_links = (1.5*mesh_size); };
127 
128 private:
129 
131 
133 
134  void buildRhs();
135 
137 
138  double computeRBFradius_known ( const ID& index, std::vector<int> indexes );
139 
140  double computeRBFradius_unknown ( const ID& index, std::vector<int> indexes );
141 
142  double rbf (double x1, double y1, double z1, double x2, double y2, double z2, double radius);
143 
150 
153 
155 
158 
161 
164 
167 
171  int M_pid;
172 
175 
176  std::vector< std::vector<int> > M_dof_connectivity_known; // per ogni dof i suoi vicini
178 
180 
183 
185 
191 
194 
196 
198 
200 
202 };
203 
204 } // Namespace LifeV
205 
206 #endif /* INTERPOLATION_H */
std::vector< std::vector< int > > M_dof_connectivity_unknown
VectorEpetra - The Epetra Vector format Wrapper.
mapPtr_Type M_interpolationOperatorMapVectorial
mapPtr_Type M_knownInterfaceMap
std::shared_ptr< vector_Type > vectorPtr_Type
std::shared_ptr< prec_Type > precPtr_Type
void solution(vectorPtr_Type &Solution)
vectorPtr_Type M_numerationInterfaceKnown
double computeRBFradius_unknown(const ID &index, std::vector< int > indexes)
vectorPtr_Type M_RhsF3
void getNumerationInterfaceKnown(vectorPtr_Type &vector)
std::set< ID > M_GIdsUnknownMesh_common
vectorPtr_Type M_solutionOnGamma
std::vector< Real > M_zcoord_known
std::vector< UInt > M_marker_known
void buildInterpolationOperatorMap()
Teuchos::RCP< Teuchos::ParameterList > parameterList_Type
void importFromHDF5(std::string const &fileName, std::string const &matrixName="matrix")
Read a matrix from a HDF5 (.h5) file.
void getSolutionOnGamma(vectorPtr_Type &GammaSolution)
matrixPtr_Type M_projectionOperator
void getKnownInterfaceMap(mapPtr_Type &map)
std::vector< Real > M_ycoord_unknown
void setFlag(const UInt &flag)
MatrixEpetra< Real > matrix_Type
std::vector< vectorPtr_Type > M_numerationInterfaceKnownColumns
void buildTableDofs_unknown(const FESpacePtr_Type &fespace)
std::set< ID > M_GIdsKnownMesh
void updateInverseJacobian(const UInt &iQuadPt)
VectorEpetra vector_Type
FESpace< mesh_Type, MapEpetra > FESpace_Type
std::shared_ptr< mesh_Type > meshPtr_Type
vectorPtr_Type M_RhsF1
PreconditionerIfpack(std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
Empty constructor.
Epetra_Import const & importer()
Getter for the Epetra_Import.
Definition: MapEpetra.cpp:394
void getInterpolationOperatorMap(mapPtr_Type &map)
vectorPtr_Type M_unknownField
uint32_type ID
IDs.
Definition: LifeV.hpp:194
void getprojectionOperatorMap(mapPtr_Type &map)
std::vector< Real > M_zcoord_unknown
mapPtr_Type M_unknownInterfaceMap
void setVectors(const vectorPtr_Type &KnownField, const vectorPtr_Type &UnknownField)
matrixPtr_Type M_interpolationOperator
mapPtr_Type M_projectionOperatorMapVectorial
void setMeshSize(const Real &mesh_size)
vectorPtr_Type M_RhsOne
std::shared_ptr< MapEpetra > mapPtr_Type
std::vector< UInt > M_marker_unknown
LifeV::PreconditionerIfpack prec_Type
vectorPtr_Type M_RhsF2
vectorPtr_Type M_numerationInterfaceUnknown
std::shared_ptr< basePrec_Type > basePrecPtr_Type
RegionMesh< LinearTetra > mesh_Type
parameterList_Type M_belosList
double Real
Generic real data.
Definition: LifeV.hpp:175
std::vector< Real > M_xcoord_known
double computeRBFradius_known(const ID &index, std::vector< int > indexes)
vectorPtr_Type M_rbf_one
void setup(const GetPot &datafile, parameterList_Type belosList)
Preconditioner - Abstract preconditioner class.
void buildTableDofs_known(const FESpacePtr_Type &fespace)
std::shared_ptr< FESpace_Type > FESpacePtr_Type
void updateRhs(const vectorPtr_Type &newRhs)
std::shared_ptr< matrix_Type > matrixPtr_Type
std::vector< Real > M_ycoord_known
std::set< ID > M_GIdsUnknownMesh
double rbf(double x1, double y1, double z1, double x2, double y2, double z2, double radius)
std::set< ID > M_GIdsKnownMesh_common
std::vector< std::vector< int > > M_dof_connectivity_known
void getVectorialInterpolationMap(mapPtr_Type &map)
vectorPtr_Type M_knownField
void expandGammaToOmega_Known(const vectorPtr_Type &vectorOnGamma, vectorPtr_Type &vectorOnOmega)
LifeV::Preconditioner basePrec_Type
mapPtr_Type M_projectionOperatorMap
std::vector< Real > M_xcoord_unknown
basePrecPtr_Type M_precPtr
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
mapPtr_Type M_interpolationOperatorMap
void restrictOmegaToGamma_Known(const vectorPtr_Type &vectorOnOmega, vectorPtr_Type &vectorOnGamma)