ZeroDimensionalBCHandler.hpp 3.02 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//@HEADER
/*
*******************************************************************************

    Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
    Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University

    This file is part of LifeV.

    LifeV is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    LifeV is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with LifeV.  If not, see <http://www.gnu.org/licenses/>.

*******************************************************************************
*/
//@HEADER

/*!
 *  @file
 *  @brief File containing the zero dimensional BCHandler
 *
 *  @date 30-03-2011
 *  @author Cristiano Malossi <cristiano.malossi@epfl.ch>
 *
 *  @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
 */

#ifndef ZeroDimensionalBCHandler_H
#define ZeroDimensionalBCHandler_H 1

40
#include <lifev/zero_dimensional/fem/ZeroDimensionalBC.hpp>
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

namespace LifeV
{

//! ZeroDimensionalBCHandler - A boundary conditions handler for zero-dimensional models.
/*!
 *  @author Cristiano Malossi
 *
 *  This simple class handles the boundary conditions for zero-dimensional models.
 */
class ZeroDimensionalBCHandler
{
public:

    //! @name Type definitions
    //@{

    typedef ZeroDimensionalBC                                             bc_Type;
    typedef bc_Type::bcType_Type                                          bcType_Type;
    typedef bc_Type::function_Type                                        function_Type;

62
    typedef markerID_Type                                                 bcFlag_Type;
63
    typedef std::map< bcFlag_Type, bc_Type >                              bcContainer_Type;
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

    //@}


    //! @name Constructors & Destructor
    //@{

    //! Constructor
    explicit ZeroDimensionalBCHandler() : M_bc() {}

    explicit ZeroDimensionalBCHandler( const ZeroDimensionalBCHandler& handler ) : M_bc( handler.M_bc ) {}

    //! Destructor
    virtual ~ZeroDimensionalBCHandler() {}

    //@}


    //! @name Set Methods
    //@{

    //! Set the type
    /*!
      @param bcType the bc type
    */
89
    void setBC( const bcFlag_Type& flag, const bcType_Type& bcType, const function_Type& function ) { M_bc[flag].setBC( bcType, function ); }
90
91
92
93
94
95
96
97
98
99
100
101

    //@}


    //! @name Get Methods
    //@{

    //! Get the boundary condition
    /*!
     *  @param side the boundary condition side
     *  @return boundary condition
     */
102
    const bc_Type& bc( const bcFlag_Type& flag ) const { return M_bc.find( flag )->second; }
103
104
105
106
107
108
109
110
111
112
113

    //@}

private:

    bcContainer_Type            M_bc;
};

} // Namespace LifeV

#endif /* ZeroDimensionalBCHandler_H */