LifeV
BCIdentifier.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 Implementations for BCIdentifier.hpp
30 
31  @date 01-07-2002
32  @author M. A. Fernandez
33  @contributor Luca Bertagna <lbertag@emory.edu>
34  */
35 
36 #include <lifev/core/fem/BCIdentifier.hpp>
37 
38 namespace LifeV
39 {
40 
41 ////////////////////
42 // BCIdentifierBase //
43 ////////////////////
44 
45 // ============================================= //
46 // Constructors & Destructor //
47 // ============================================= //
48 
50 {
51  // Nothing to be done here
52 }
53 
54 // ============================= //
55 // Methods //
56 // ============================= //
57 
58 void BCIdentifierBase::showMe ( std::ostream& output) const
59 {
60  output << "\n Node id: " << M_id << '\n';
61 }
62 
63 /////////////////////////
64 // BCIdentifierEssential //
65 /////////////////////////
66 
67 // ============================================= //
68 // Constructors & Destructor //
69 // ============================================= //
70 
72  M_x ( id.M_x ),
73  M_y ( id.M_y ),
74  M_z ( id.M_z )
75 {
76  // Nothing to be done here
77 }
78 
79 // ============================= //
80 // Methods //
81 // ============================= //
82 
83 void BCIdentifierEssential::showMe ( std::ostream& output) const
84 {
85  output << "\nNode id:" << M_id << '\n';
86  output << "Node coordinates:\n";
87  output << " x = " << M_x;
88  output << " y = " << M_y;
89  output << " z = " << M_z;
90 }
91 
92 ///////////////////////
93 // BCIdentifierNatural //
94 ///////////////////////
95 
96 // ============================================= //
97 // Constructors & Destructor //
98 // ============================================= //
99 
100 BCIdentifierNatural::BCIdentifierNatural ( const ID& id, const std::vector<ID>& localToGlobal ) : BCIdentifierBase ( id )
101 {
102  M_localToGlobal.reserve ( localToGlobal.size() );
103  M_localToGlobal.insert ( M_localToGlobal.end(), localToGlobal.begin(), localToGlobal.end() );
104 }
105 
107 {
108  // Nothing to be done here
109 }
110 
113 {
114  // Nothing to be done here
115 }
116 
117 // ============================= //
118 // Methods //
119 // ============================= //
120 
121 void BCIdentifierNatural::showMe ( std::ostream& output) const
122 {
123  output << "\nNode id:" << M_id << '\n';
124  output << "Local-to-global map:\n";
125 
126  int i (0);
127  for ( std::vector<ID>::const_iterator it = M_localToGlobal.begin(); it != M_localToGlobal.end(); ++it, ++i )
128  {
129  output << "Local id: " << i << " --> Global id: " << *it << '\n';
130  }
131 }
132 
133 } // Namespace LifeV
BCIdentifierBase(BCIdentifierBase const &id)
Copy constructor.
BCIdentifierBase(ID const &i)
Constructor given the ID.
virtual void showMe(std::ostream &output=std::cout) const
Display method.
void updateInverseJacobian(const UInt &iQuadPt)
virtual void showMe(std::ostream &output=std::cout) const
Display method.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
BCIdentifierBase - Base class holding DOF identifiers for implementing BC.
BCIdentifierNatural(const ID &i, const std::vector< ID > &localToGlobal)
Constructor given ID and bdLocalToGlobal map.
BCIdentifierEssential(BCIdentifierEssential const &id)
Copy Constructor.
BCIdentifierNatural(const ID &id)
Constructor given the ID.
BCIdentifierEssential - BCIdentifier for implementing Essential Boundary Conditions.
BCIdentifierNatural(BCIdentifierNatural const &id)
Copy Constructor.
BCIdentifierNatural - Idenifier for Natural and Robin Boundary Condiions.
virtual void showMe(std::ostream &output=std::cout) const
Display method.