LifeV
DOFInterface3Dto3D.cpp
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 Class for interfacing dofs between two 3D meshes, implementation
30 
31  @author M.A. Fernandez
32  @date 00-11-2002
33 
34  @contributor Samuel Quinodoz <samuel.quinodoz@epfl.ch>
35  @mantainer Samuel Quinodoz <samuel.quinodoz@epfl.ch>
36 
37  This file contains the class which may be used to update and hold the connections between the dof
38  on two matching meshes.
39  */
40 
41 #include <lifev/core/fem/DOFInterface3Dto3D.hpp>
42 
43 namespace LifeV
44 {
45 
46 // ===================================================
47 // Constructors & Destructor
48 // ===================================================
49 
50 DOFInterface3Dto3D::DOFInterface3Dto3D ( const ReferenceFE& refFE, const DOF& dof1,
51  const DOF& dof2 )
52  :
53  M_refFE1 ( &refFE ),
54  M_dof1 ( &dof1 ),
55  M_refFE2 ( &refFE ),
56  M_dof2 ( &dof2 ),
57  M_dof ( new DOF ( refFE ) )
58 {}
59 
60 DOFInterface3Dto3D::DOFInterface3Dto3D ( const ReferenceFE& refFE1, const DOF& dof1, const ReferenceFE& refFE2,
61  const DOF& dof2 )
62  :
63  M_refFE1 ( &refFE1 ),
64  M_dof1 ( &dof1 ),
65  M_refFE2 ( &refFE2 ),
66  M_dof2 ( &dof2 ),
67  M_dof ( new DOF ( refFE1 ) )
68 {}
69 
70 DOFInterface3Dto3D::DOFInterface3Dto3D ( const ReferenceFE& refFE, const DOF& dof )
71  :
72  M_refFE1 ( & refFE ),
73  M_dof1 ( &dof ),
74  M_refFE2 ( & refFE ),
75  M_dof2 ( &dof )
76 {}
77 
78 // ===================================================
79 // Methods
80 // ===================================================
81 
82 void
83 DOFInterface3Dto3D::setup ( const ReferenceFE& refFE, const DOF& dof1, const DOF& dof2 )
84 {
85  M_refFE1 = &refFE;
86  M_dof1 = &dof1;
87  M_refFE2 = &refFE;
88  M_dof2 = &dof2;
89  M_dof = std::shared_ptr<DOF> ( new DOF ( refFE ) );
90 }
91 
92 void
93 DOFInterface3Dto3D::setup ( const ReferenceFE& refFE1, const DOF& dof1, const ReferenceFE& refFE2, const DOF& dof2 )
94 {
95  M_refFE1 = &refFE1;
96  M_dof1 = &dof1;
97  M_refFE2 = &refFE2;
98  M_dof2 = &dof2;
99  M_dof = std::shared_ptr<DOF> ( new DOF ( refFE1 ) );
100 }
101 
102 // ===================================================
103 // Helpers
104 // ===================================================
105 
106 bool
107 coincide ( const std::vector<Real>& p1, const std::vector<Real>& p2, const Real& tol )
108 {
109  Real normDiff = fabs ( p1[ 0 ] - p2[ 0 ]) + fabs ( p1[ 1 ] - p2[ 1 ]) + fabs ( p1[ 2 ] - p2[ 2 ]);
110 
111  return ( normDiff <= tol );
112 }
113 
114 }
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
Definition: LifeV.hpp:175
The class for a reference Lagrangian finite element.