40 #include <lifev/navier_stokes/solver/OseenData.hpp> 41 #include <lifev/core/LifeV.hpp> 52 OseenData::OseenData( ) :
65 M_semiImplicit (
false ),
66 M_shapeDerivatives (
false ),
67 M_domainVelImplicit (
false ),
68 M_convectiveImplicit (
false ),
69 M_computeMeanValuesPerSection ( ),
71 M_ToleranceSection ( ),
72 M_XSectionFrontier ( ),
76 M_stabilizationList (
"fluid/space_discretization/stabilization" ),
77 M_conservativeFormulation (
true)
82 OseenData::OseenData (
const OseenData& oseenData ) :
83 M_time ( oseenData.M_time ),
84 M_timeAdvance ( oseenData.M_timeAdvance ),
85 M_fluidNumber ( oseenData.M_fluidNumber ),
86 M_density ( oseenData.M_density ),
87 M_viscosity ( oseenData.M_viscosity ),
88 M_uOrder ( oseenData.M_uOrder ),
89 M_pOrder ( oseenData.M_pOrder ),
90 M_verbose ( oseenData.M_verbose ),
91 M_dumpInit ( oseenData.M_dumpInit ),
92 M_dumpPeriod ( oseenData.M_dumpPeriod ),
93 M_factor ( oseenData.M_factor ),
94 M_stokes ( oseenData.M_stokes ),
95 M_stabMethod ( oseenData.M_stabMethod ),
96 M_semiImplicit (
false ),
97 M_shapeDerivatives (
false ),
98 M_domainVelImplicit (
false ),
99 M_convectiveImplicit (
false ),
100 M_computeMeanValuesPerSection ( oseenData.M_computeMeanValuesPerSection ),
101 M_NbZSections ( oseenData.M_NbZSections ),
102 M_ToleranceSection ( oseenData.M_ToleranceSection ),
103 M_XSectionFrontier ( oseenData.M_XSectionFrontier ),
104 M_ZSectionInit ( oseenData.M_ZSectionInit ),
105 M_ZSectionFinal ( oseenData.M_ZSectionFinal ),
106 M_NbPolygonEdges ( oseenData.M_NbPolygonEdges ),
107 M_stabilizationList ( oseenData.M_stabilizationList ),
108 M_conservativeFormulation (
false )
122 OseenData::operator= (
const OseenData& oseenData )
124 if (
this != &oseenData )
126 M_time = oseenData.M_time;
127 M_timeAdvance = oseenData.M_timeAdvance;
128 M_fluidNumber = oseenData.M_fluidNumber;
129 M_density = oseenData.M_density;
130 M_viscosity = oseenData.M_viscosity;
131 M_uOrder = oseenData.M_uOrder;
132 M_pOrder = oseenData.M_pOrder;
133 M_verbose = oseenData.M_verbose;
134 M_dumpInit = oseenData.M_dumpInit;
135 M_dumpPeriod = oseenData.M_dumpPeriod;
136 M_factor = oseenData.M_factor;
137 M_stokes = oseenData.M_stokes;
138 M_stabMethod = oseenData.M_stabMethod;
139 M_semiImplicit = oseenData.M_semiImplicit;
140 M_shapeDerivatives = oseenData.M_shapeDerivatives;
141 M_domainVelImplicit = oseenData.M_domainVelImplicit;
142 M_convectiveImplicit = oseenData.M_convectiveImplicit;
143 M_computeMeanValuesPerSection = oseenData.M_computeMeanValuesPerSection;
144 M_NbZSections = oseenData.M_NbZSections;
145 M_ToleranceSection = oseenData.M_ToleranceSection;
146 M_XSectionFrontier = oseenData.M_XSectionFrontier;
147 M_ZSectionInit = oseenData.M_ZSectionInit;
148 M_ZSectionFinal = oseenData.M_ZSectionFinal;
149 M_NbPolygonEdges = oseenData.M_NbPolygonEdges;
150 M_stabilizationList = oseenData.M_stabilizationList;
151 M_conservativeFormulation = oseenData.M_conservativeFormulation;
159 OseenData::setup (
const GetPot& dataFile,
const std::string& section )
164 M_time.reset (
new time_Type ( dataFile, section +
"/time_discretization" ) );
167 if ( !M_timeAdvance.get() )
169 M_timeAdvance.reset (
new timeAdvance_Type ( dataFile, section +
"/time_discretization" ) );
172 M_stabilizationList.add (
"ip", IP_STABILIZATION,
"interior penalty " );
173 M_stabilizationList.add (
"sd", SD_STABILIZATION,
"stream-line diffusion" );
174 M_stabilizationList.add (
"none", NO_STABILIZATION,
"none (default)" );
177 UInt temp = dataFile ( (section +
"/physics/fluid_number" ).data(), 0 );
182 M_density.push_back ( dataFile ( ( section +
"/physics/density" ).data(), 1. ) );
183 M_viscosity.push_back ( dataFile ( ( section +
"/physics/viscosity" ).data(), 1. ) );
187 M_fluidNumber = temp;
188 M_density = std::vector<Real> (temp, 0);
189 M_viscosity = std::vector<Real> (temp, 0);
191 for (
UInt iter_fluid (0); iter_fluid < temp; ++iter_fluid)
194 std::string iter_fluid_section ( section +
"/physics/fluid_");
195 iter_fluid_section += number2string (iter_fluid);
198 M_density[iter_fluid] = dataFile ( (iter_fluid_section +
"/density").c_str() , 1.0);
199 M_viscosity[iter_fluid] = dataFile ( (iter_fluid_section +
"/viscosity").c_str() , 1.0);
204 M_uOrder = dataFile ( ( section +
"/space_discretization/vel_order" ).data(),
"P1");
205 M_pOrder = dataFile ( ( section +
"/space_discretization/press_order" ).data(),
"P1");
208 M_verbose = dataFile ( ( section +
"/miscellaneous/verbose" ).data(), 1 );
209 M_dumpInit = dataFile ( ( section +
"/miscellaneous/dump_init" ).data(), M_time->initialTime() );
210 M_dumpPeriod = dataFile ( ( section +
"/miscellaneous/dump_period" ).data(), 1 );
211 M_factor = dataFile ( ( section +
"/miscellaneous/factor" ).data(), 0. );
212 M_stokes = dataFile ( ( section +
"/miscellaneous/Stokes" ).data(),
false );
214 M_stabMethod = NSStabilization ( M_stabilizationList.value (
215 dataFile ( ( section +
"/space_discretization/stabilization" ).data(),
"none") ) );
218 M_shapeDerivatives = dataFile ( ( section +
"/useShapeDerivatives" ).data(),
false ) ;
219 setSemiImplicit ( dataFile ( ( section +
"/semiImplicit" ).data(),
false ) );
220 M_domainVelImplicit = dataFile ( (section +
"/domainVelImplicit").data(),
false );
221 M_convectiveImplicit = dataFile ( (section +
"/convectiveImplicit").data(),
false );
222 M_conservativeFormulation = dataFile ( ( section +
"/conservativeFormulation" ).data(),
true );
225 M_computeMeanValuesPerSection = dataFile ( ( section +
"/valuespersection/computeMeanValuesPerSection" ).data(), 0 );
226 M_NbZSections = dataFile ( ( section +
"/valuespersection/nb_z_section" ).data(), 2 );
227 M_ToleranceSection = dataFile ( ( section +
"/valuespersection/tol_section" ).data(), 2e-2 );
228 M_XSectionFrontier = dataFile ( ( section +
"/valuespersection/x_section_frontier" ).data(), 0. );
229 M_ZSectionInit = dataFile ( ( section +
"/valuespersection/z_section_init" ).data(), -1. );
230 M_ZSectionFinal = dataFile ( ( section +
"/valuespersection/z_section_final" ).data(), 0. );
231 M_NbPolygonEdges = dataFile ( ( section +
"/valuespersection/nb_polygon_edges" ).data(), 10 );
236 OseenData::showMe ( std::ostream& output )
const 238 if (M_fluidNumber == 1)
240 output <<
"\n*** Values for data [fluid/physics]\n\n";
241 output <<
"density = " << M_density[0] << std::endl;
242 output <<
"viscosity = " << M_viscosity[0] << std::endl;
246 output <<
"\n*** Values for data [fluid/physics]\n\n";
247 for (
UInt iter_fluid (0); iter_fluid < M_fluidNumber; ++iter_fluid)
249 output <<
"fluid " << iter_fluid << std::endl;
250 output <<
"density = " << M_density[iter_fluid] << std::endl;
251 output <<
"viscosity = " << M_viscosity[iter_fluid] << std::endl;
254 output <<
"\n*** Values for data [fluid/miscellaneous]\n\n";
255 output <<
"verbose = " << M_verbose << std::endl;
256 output <<
"initial time for writing solution = " << M_dumpInit << std::endl;
257 output <<
"number of time steps between two consecutive dumps of the solution = " << M_dumpPeriod << std::endl;
258 output <<
"amplification factor = " << M_factor << std::endl;
259 output <<
"Stokes simulation = " << M_stokes << std::endl;
262 output <<
"\n*** Values for data [fluid/time_discretization]\n\n";
263 M_time->showMe ( output );
264 M_timeAdvance->showMe ( output );
266 output <<
"stabilization = ";
267 switch ( M_stabMethod )
269 case NO_STABILIZATION:
272 case IP_STABILIZATION:
275 case SD_STABILIZATION:
281 output <<
"\n*** Values for data [fluid/valuespersection]\n\n";
282 output <<
"computeMeanValuesPerSection (switch 0: don't compute, 1: compute) = " 283 << M_computeMeanValuesPerSection << std::endl;
284 output <<
"nb_z_section = " << M_NbZSections << std::endl;
285 output <<
"tol_section = " << M_ToleranceSection << std::endl;
286 output <<
"x_section_frontier = " << M_XSectionFrontier << std::endl;
287 output <<
"z_section_init = " << M_ZSectionInit << std::endl;
288 output <<
"z_section_final = " << M_ZSectionFinal << std::endl;
289 output <<
"nb_polygon_edges = " << M_NbPolygonEdges << std::endl;
void updateInverseJacobian(const UInt &iQuadPt)
uint32_type UInt
generic unsigned integer (used mainly for addressing)