LifeV
BCInterfaceFunctionParserFluid3D.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 File containing the BCInterfaceFunctionParserSolver class
30  *
31  * @date 24-08-2009
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
35  */
36 
37 // BCInterface includes
38 #include <lifev/bc_interface/3D/function/fluid/BCInterfaceFunctionParserFluid3D.hpp>
39 
40 namespace LifeV
41 {
42 
43 // ===================================================
44 // Methods
45 // ===================================================
46 template< >
47 void
49 {
50  base.setFunction ( functionSelectorTimeSpaceID() );
51 }
52 
53 template< >
54 void
56 {
57  base.setFunction ( functionSelectorTimeSpaceID() );
58 }
59 
60 // ===================================================
61 // Set Methods
62 // ===================================================
63 template< >
64 void
66 {
67 
68 #ifdef HAVE_LIFEV_DEBUG
69  debugStream ( 5022 ) << "BCInterfaceFunction::setData" << "\n";
70 #endif
71 
72  setupParser ( data );
73 
74  std::shared_ptr< BCInterfaceData3D > castedData = std::dynamic_pointer_cast< BCInterfaceData3D > ( data );
75 
76  if ( castedData != 0 )
77  {
78 
79  /*
80  * MODE COMPONENT FUNCTION | COMV.SIZE ARGUMENTS INTERFACEFUNCTION
81  * ------------------------------------------|---------------------------------------------------
82  * |
83  * COMPONENT 2 x*y*z | 1 1 function
84  * FULL 3 x*y*z | 1 1 function
85  * FULL 1 x*y*z | 1 1 function
86  * FULL 3 (y*z,x*z,x*y) | 1 3 functionID
87  * FULL 2 (x,y) | 1 2 functionID
88  * COMPONENT '1 3' (x,y) | 2 2 functionID
89  */
90 
91 #ifdef HAVE_LIFEV_DEBUG
92  debugStream ( 5021 ) << "BCInterfaceFunction::setData arguments: " << M_parser->countSubstring ( "," ) << "\n";
93 #endif
94 
95  // Note: the map ID is used only for 3D handler.
96  if ( M_parser->countSubstring ( "," ) )
97  {
98  //Create the ID map
99  if ( castedData->componentsVector().size() > 1 ) // Component
100  for ( ID i ( 0 ); i < static_cast< ID > ( castedData->componentsVector().size() ); ++i )
101  {
102  M_mapID[castedData->componentsVector() [i]] = i + 1;
103  }
104  else
105  // if ( castedData->componentsVector().front() == arguments ) Full
106  for ( ID i ( 0 ); i < castedData->componentsVector().front(); ++i )
107  {
108  M_mapID[i + 1] = i + 1;
109  }
110  }
111  }
112  else
113  {
114  std::cerr << "!!! ERROR: BCInterface wrong data cast !!!" << std::endl;
115  }
116 }
117 
118 template< >
119 void
121 {
122 
123 #ifdef HAVE_LIFEV_DEBUG
124  debugStream ( 5022 ) << "BCInterfaceFunction::setData" << "\n";
125 #endif
126 
127  setupParser ( data );
128 
129  std::shared_ptr< BCInterfaceData3D > castedData = std::dynamic_pointer_cast< BCInterfaceData3D > ( data );
130 
131  if ( castedData != 0 )
132  {
133 
134  /*
135  * MODE COMPONENT FUNCTION | COMV.SIZE ARGUMENTS INTERFACEFUNCTION
136  * ------------------------------------------|---------------------------------------------------
137  * |
138  * COMPONENT 2 x*y*z | 1 1 function
139  * FULL 3 x*y*z | 1 1 function
140  * FULL 1 x*y*z | 1 1 function
141  * FULL 3 (y*z,x*z,x*y) | 1 3 functionID
142  * FULL 2 (x,y) | 1 2 functionID
143  * COMPONENT '1 3' (x,y) | 2 2 functionID
144  */
145 
146 #ifdef HAVE_LIFEV_DEBUG
147  debugStream ( 5021 ) << "BCInterfaceFunction::setData arguments: " << M_parser->countSubstring ( "," ) << "\n";
148 #endif
149 
150  // Note: the map ID is used only for 3D handler.
151  if ( M_parser->countSubstring ( "," ) )
152  {
153  //Create the ID map
154  if ( castedData->componentsVector().size() > 1 ) // Component
155  for ( ID i ( 0 ); i < static_cast< ID > ( castedData->componentsVector().size() ); ++i )
156  {
157  M_mapID[castedData->componentsVector() [i]] = i + 1;
158  }
159  else
160  // if ( castedData->componentsVector().front() == arguments ) Full
161  for ( ID i ( 0 ); i < castedData->componentsVector().front(); ++i )
162  {
163  M_mapID[i + 1] = i + 1;
164  }
165  }
166  }
167  else
168  {
169  std::cerr << "!!! ERROR: BCInterface wrong data cast !!!" << std::endl;
170  }
171 }
172 
173 } // Namespace LifeV
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
void setData(const std::shared_ptr< BCInterfaceData > &data)
void updateInverseJacobian(const UInt &iQuadPt)