LifeV
DOFInterface.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 Base Class for interfacing dofs between two meshes
30 
31  @author M.A. Fernandez and V. Martin
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 #ifndef _DOFINTERFACEBASE_HH
42 #define _DOFINTERFACEBASE_HH
43 
44 #include <lifev/core/LifeV.hpp>
45 
46 #include <map>
47 
48 namespace LifeV
49 {
50 /*!
51  \class DOFInterface
52 
53  Base class which holds the connections of the dof in two matching meshes
54  The dof mapping (STL map) is set in the derived classes.
55  Each derived class depends on the type of interface you have.
56 
57  Method getInterfaceDof gives the connections.
58 
59  To be deleted:
60  buildInverse
61 */
63 {
64 public:
65 
66  //! @name Constructor & Destructor
67  //@{
68 
69  //! Default Constructor
70  DOFInterface();
71 
72  //! Virtual Destructor
73  virtual ~DOFInterface() {};
74 
75  //@}
76 
77 
78  //! @name Methods
79  //@{
80 
81  //! This method returns the corresponding dof number of the mesh2 at the interface
82  //! for a specific dof number at the interface in mesh1
83  /*!
84  \param i a dof number in mesh1
85  */
86  ID getInterfaceDof ( const ID& i ) const;
87 
88  //! This method says whether a specific dof number at the interface in mesh1 is on this processor
89  /*!
90  \param i a dof number in mesh1
91  */
92  bool isMyInterfaceDof ( const ID& i ) const;
93 
94  //! output
95  std::ostream& showMe ( bool verbose = false, std::ostream& out = std::cout ) const;
96 
97  //! Makes this DOFInterface to be the inverse map as the one defined by dofBase.
98  void buildInverse ( const DOFInterface& dofBase);
99 
100  //@}
101 
102  //! @name Set Methods
103  //@{
104 
105  //! Set value to be associated to key
106  void set (const ID& key, const ID& value);
107 
108  //@}
109 
110  //! @name Get Methods
111  //@{
112 
113  //! This method returns the number of dof that live on the interface
114  size_t nbInterfaceDof() const;
115 
116  //! Return the correspondance map
117  const std::map<ID, ID>& localDofMap()
118  {
119  return M_localDofMap;
120  }
121 
122  //@}
123 
124 protected:
125 
126  //! STL map container which holds the connections between DOF at the interface
128 
129 };
130 
131 }
132 #endif
const std::map< ID, ID > & localDofMap()
Return the correspondance map.
ID getInterfaceDof(const ID &i) const
This method returns the corresponding dof number of the mesh2 at the interface for a specific dof num...
void buildInverse(const DOFInterface &dofBase)
Makes this DOFInterface to be the inverse map as the one defined by dofBase.
DOFInterface()
Default Constructor.
bool isMyInterfaceDof(const ID &i) const
This method says whether a specific dof number at the interface in mesh1 is on this processor...
virtual ~DOFInterface()
Virtual Destructor.
void updateInverseJacobian(const UInt &iQuadPt)
void set(const ID &key, const ID &value)
Set value to be associated to key.
size_t nbInterfaceDof() const
This method returns the number of dof that live on the interface.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
std::map< ID, ID > M_localDofMap
STL map container which holds the connections between DOF at the interface.
std::ostream & showMe(bool verbose=false, std::ostream &out=std::cout) const
output