Take 'dt' as user parameter, put pressure output first.

This commit is contained in:
Atgeirr Flø Rasmussen
2010-11-19 15:34:28 +01:00
parent 56bcd0c52c
commit cf3eaec4ff
2 changed files with 6 additions and 5 deletions

View File

@@ -1 +1 @@
335bb8e27ad82ccf4b60c2a0042041a704d50691 dune/porsol/opmpressure
21bc2a469f51c79031128235a9f696e9ca20d351 dune/porsol/opmpressure

View File

@@ -53,7 +53,7 @@
template<int dim, class GI, class RI>
void test_flowsolver(const GI& g, const RI& r)
void test_flowsolver(const GI& g, const RI& r, double dt)
{
typedef typename GI::CellIterator CI;
typedef typename CI::FaceIterator FI;
@@ -84,7 +84,6 @@ void test_flowsolver(const GI& g, const RI& r)
src.back() = -1.0;
}
std::vector<double> cell_pressure(g.numberOfCells(), 0.0);
double dt = 1;
solver.solve(r, cell_pressure, sat, flow_bc, src, dt, 1e-8, 3, 1);
@@ -100,8 +99,8 @@ void test_flowsolver(const GI& g, const RI& r)
getCellPressure(cell_pressure, g, soln);
Dune::VTKWriter<typename GI::GridType::LeafGridView> vtkwriter(g.grid().leafView());
vtkwriter.addCellData(cell_velocity_flat, "velocity", dim);
vtkwriter.addCellData(cell_pressure, "pressure");
vtkwriter.addCellData(cell_velocity_flat, "velocity", dim);
vtkwriter.write("testsolution-" + boost::lexical_cast<std::string>(0),
Dune::VTKOptions::ascii);
}
@@ -122,7 +121,9 @@ int main(int argc, char** argv)
// Make the grid interface.
Dune::GridInterfaceEuler<Dune::CpGrid> g(grid);
double dt = param.getDefault("dt", 1.0);
// Run test.
test_flowsolver<3>(g, res_prop);
test_flowsolver<3>(g, res_prop, dt);
}