LifeV
BCInterfaceFunctionParserSolverFluid3D.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/BCInterfaceFunctionParserSolverFluid3D.hpp>
39 
40 namespace LifeV
41 {
42 
43 // ===================================================
44 // Methods
45 // ===================================================
46 template< >
47 void
49 {
50 
51 #ifdef HAVE_LIFEV_DEBUG
52  debugStream ( 5023 ) << "BCInterfaceFunctionSolver<BCHandler, OseenSolver>::updatePhysicalSolverVariables" << "\n";
53 #endif
54 
55  // Create/Update variables
56  for ( std::set< physicalSolverList >::iterator j = M_list.begin(); j != M_list.end(); ++j )
57  switch ( *j )
58  {
59  // f_ -> FLUID
60  case f_timeStep:
61 
62 #ifdef HAVE_LIFEV_DEBUG
63  debugStream ( 5023 ) << " f_timeStep(): " << M_physicalSolver->data()->dataTime()->timeStep() << "\n";
64 #endif
65  setVariable ( "f_timeStep", M_physicalSolver->data()->dataTime()->timeStep() );
66 
67  break;
68 
69  case f_area:
70 
71 #ifdef HAVE_LIFEV_DEBUG
72  debugStream ( 5023 ) << " f_area(" << static_cast<Real> (M_boundaryID) << "): " << M_physicalSolver->area ( M_boundaryID ) << "\n";
73 #endif
74  setVariable ( "f_area", M_physicalSolver->area ( M_boundaryID ) );
75 
76  break;
77 
78  case f_density:
79 
80 #ifdef HAVE_LIFEV_DEBUG
81  debugStream ( 5023 ) << " f_density: " << M_physicalSolver->density() << "\n";
82 #endif
83  setVariable ( "f_density", M_physicalSolver->density() );
84 
85  break;
86 
87  case f_flux:
88 
89 #ifdef HAVE_LIFEV_DEBUG
90  debugStream ( 5023 ) << " f_flux(" << static_cast<Real> (M_boundaryID) << "): " << M_physicalSolver->flux ( M_boundaryID ) << "\n";
91 #endif
92 
93  setVariable ( "f_flux", M_physicalSolver->flux ( M_boundaryID ) );
94 
95  break;
96 
97  case f_pressure:
98 
99 #ifdef HAVE_LIFEV_DEBUG
100  debugStream ( 5023 ) << " f_pressure(" << static_cast<Real> (M_boundaryID) << "): " << M_physicalSolver->pressure ( M_boundaryID ) << "\n";
101 #endif
102 
103  setVariable ( "f_pressure", M_physicalSolver->pressure ( M_boundaryID ) );
104 
105  break;
106 
107  case f_viscosity:
108 
109 #ifdef HAVE_LIFEV_DEBUG
110  debugStream ( 5023 ) << " f_viscosity: " << M_physicalSolver->viscosity() << "\n";
111 #endif
112  setVariable ( "f_viscosity", M_physicalSolver->viscosity() );
113 
114  break;
115 
116  default:
117 
118  switchErrorMessage ( "OSEEN" );
119 
120  break;
121  }
122 }
123 
124 template< >
125 void
127 {
128 
129 #ifdef HAVE_LIFEV_DEBUG
130  debugStream ( 5023 ) << "BCInterfaceFunctionSolver<BCHandler, OseenSolverShapeDerivative>::updatePhysicalSolverVariables" << "\n";
131 #endif
132 
133  // Create/Update variables
134  for ( std::set< physicalSolverList >::iterator j = M_list.begin(); j != M_list.end(); ++j )
135  switch ( *j )
136  {
137  // f_ -> FLUID
138  case f_timeStep:
139 
140 #ifdef HAVE_LIFEV_DEBUG
141  debugStream ( 5023 ) << " f_timeStep(): " << M_physicalSolver->data()->dataTime()->timeStep() << "\n";
142 #endif
143  setVariable ( "f_timeStep", M_physicalSolver->data()->dataTime()->timeStep() );
144 
145  break;
146 
147  case f_area:
148 
149 #ifdef HAVE_LIFEV_DEBUG
150  debugStream ( 5023 ) << " f_area(" << static_cast<Real> (M_boundaryID) << "): " << M_physicalSolver->area ( M_boundaryID ) << "\n";
151 #endif
152  setVariable ( "f_area", M_physicalSolver->area ( M_boundaryID ) );
153 
154  break;
155 
156  case f_density:
157 
158 #ifdef HAVE_LIFEV_DEBUG
159  debugStream ( 5023 ) << " f_density(): " << M_physicalSolver->density() << "\n";
160 #endif
161  setVariable ( "f_density", M_physicalSolver->density() );
162 
163  break;
164 
165  case f_flux:
166 
167 #ifdef HAVE_LIFEV_DEBUG
168  debugStream ( 5023 ) << " f_flux(" << static_cast<Real> (M_boundaryID) << "): " << M_physicalSolver->flux ( M_boundaryID ) << "\n";
169 #endif
170 
171  setVariable ( "f_flux", M_physicalSolver->flux ( M_boundaryID ) );
172 
173  break;
174 
175  case f_pressure:
176 
177 #ifdef HAVE_LIFEV_DEBUG
178  debugStream ( 5023 ) << " f_pressure(" << static_cast<Real> (M_boundaryID) << "): " << M_physicalSolver->pressure ( M_boundaryID ) << "\n";
179 #endif
180 
181  setVariable ( "f_pressure", M_physicalSolver->pressure ( M_boundaryID ) );
182 
183  break;
184 
185  case f_viscosity:
186 
187 #ifdef HAVE_LIFEV_DEBUG
188  debugStream ( 5023 ) << " f_viscosity(): " << M_physicalSolver->viscosity() << "\n";
189 #endif
190  setVariable ( "f_viscosity", M_physicalSolver->viscosity() );
191 
192  break;
193 
194  default:
195 
196  switchErrorMessage ( "OSEENSHAPEDERIVATIVE" );
197 
198  break;
199  }
200 }
201 
202 
203 
204 // ===================================================
205 // Protected Methods
206 // ===================================================
207 template< >
208 void
210 {
211 
212 #ifdef HAVE_LIFEV_DEBUG
213  debugStream ( 5023 ) << "BCInterfaceFunctionSolver<BCHandler, OseenSolver>::createAccessList( data )" << "\n";
214 #endif
215 
216  std::map< std::string, physicalSolverList > mapList;
217 
218  createFluidMap ( mapList );
219  createList ( mapList, data );
220 
221  if ( M_physicalSolver.get() )
222  {
223  updatePhysicalSolverVariables();
224  }
225 }
226 
227 template< >
228 void
230 {
231 
232 #ifdef HAVE_LIFEV_DEBUG
233  debugStream ( 5023 ) << "BCInterfaceFunctionSolver<BCHandler, OseenSolverShapeDerivative>::createAccessList( data )" << "\n";
234 #endif
235 
236  std::map< std::string, physicalSolverList > mapList;
237 
238  createFluidMap ( mapList );
239  createList ( mapList, data );
240 
241  if ( M_physicalSolver.get() )
242  {
243  updatePhysicalSolverVariables();
244  }
245 }
246 
247 } // Namespace LifeV
void updateInverseJacobian(const UInt &iQuadPt)
void createAccessList(const std::shared_ptr< BCInterfaceData > &data)