template <int dim>
Base<dim>::Base (Triangulation<dim> &coarse_grid)
:
- triangulation (&coarse_grid)
+ triangulation (&coarse_grid),
+ refinement_cycle (numbers::invalid_unsigned_int)
{}
fe (FE_Q<dim>(1), dim),
dof_handler (triangulation),
quadrature_formula (2),
+ present_time (0.0),
+ present_timestep (1.0),
+ end_time (10.0),
+ timestep_no (0),
mpi_communicator (MPI_COMM_WORLD),
n_mpi_processes (Utilities::MPI::n_mpi_processes(mpi_communicator)),
this_mpi_process (Utilities::MPI::this_mpi_process(mpi_communicator)),
- pcout (std::cout, this_mpi_process == 0)
+ pcout (std::cout, this_mpi_process == 0),
+ n_local_cells (numbers::invalid_unsigned_int)
{}
template <int dim>
void TopLevel<dim>::run ()
{
- present_time = 0;
- present_timestep = 1;
- end_time = 10;
- timestep_no = 0;
-
do_initial_timestep ();
while (present_time < end_time)
dof_handler (triangulation),
n_refinement_steps (5),
time_step (0),
+ timestep_number (1),
viscosity (0.2)
{}
old_solution);
}
- timestep_number = 1;
double time = 0;
do
Vector<double> old_solution_u, old_solution_v;
Vector<double> system_rhs;
- double time, time_step;
+ double time_step, time;
unsigned int timestep_number;
const double theta;
};
fe (1),
dof_handler (triangulation),
time_step (1./64),
+ time (time_step),
+ timestep_number (1),
theta (0.5)
{}
Vector<double> tmp (solution_u.size());
Vector<double> forcing_terms (solution_u.size());
- for (timestep_number=1, time=time_step;
- time<=5;
- time+=time_step, ++timestep_number)
+ for (; time<=5; time+=time_step, ++timestep_number)
{
std::cout << "Time step " << timestep_number
<< " at t=" << time
Vector<double> old_solution_p, old_solution_v;
Vector<double> system_rhs_p, system_rhs_v;
- double time, time_step;
+ double time_step, time;
unsigned int timestep_number;
const double theta;
// imaging) since this is where many of the experiments we want to compare
// the output with are made in. The Crank-Nicolson scheme is used again,
// i.e. theta is set to 0.5. The time step is later selected to satisfy $k =
- // \frac hc$
+ // \frac hc$: here we initialize it to an invalid number.
template <int dim>
TATForwardProblem<dim>::TATForwardProblem ()
:
fe (1),
dof_handler (triangulation),
+ time_step (std::numeric_limits<double>::quiet_NaN()),
+ time (time_step),
+ timestep_number (1),
theta (0.5),
wave_speed (1.437)
{
Vector<double> G2 (solution_v.size());
const double end_time = 0.7;
- for (timestep_number=1, time=time_step;
- time<=end_time;
- time+=time_step, ++timestep_number)
+ for (time=time_step; time<=end_time; time+=time_step, ++timestep_number)
{
std::cout << std::endl;
std::cout<< "time_step " << timestep_number << " @ t=" << time << std::endl;
:
fe(1),
dof_handler(triangulation),
+ time (0.0),
time_step(1. / 500),
+ timestep_number (0),
theta(0.5)
{}
old_solution);
solution = old_solution;
- timestep_number = 0;
- time = 0;
-
output_results();
// Then we start the main loop until the computed time exceeds our
:
parameters (parameters),
material_data (parameters.n_groups),
- fe (parameters.fe_degree)
+ fe (parameters.fe_degree),
+ k_eff (std::numeric_limits<double>::quiet_NaN())
{}
BoussinesqFlowProblem<dim>::BoussinesqFlowProblem ()
:
triangulation (Triangulation<dim>::maximum_smoothing),
-
+ global_Omega_diameter (std::numeric_limits<double>::quiet_NaN()),
stokes_degree (1),
stokes_fe (FE_Q<dim>(stokes_degree+1), dim,
FE_Q<dim>(stokes_degree), 1),
// In the constructor of this class we declare all the parameters. The
// details of how this works have been discussed elsewhere, for example in
// step-19 and step-29.
- Data_Storage::Data_Storage()
+ Data_Storage::Data_Storage() :
+ form (METHOD_ROTATIONAL),
+ initial_time (0.),
+ final_time (1.),
+ Reynolds (1.),
+ dt (5e-4),
+ n_global_refines (0),
+ pressure_degree (1),
+ vel_max_iterations (1000),
+ vel_Krylov_size (30),
+ vel_off_diagonals (60),
+ vel_update_prec (15),
+ vel_eps (1e-12),
+ vel_diag_strength (0.01),
+ verbose (true),
+ output_interval (15)
{
prm.declare_entry ("Method_Form", "rotational",
Patterns::Selection ("rotational|standard"),
(new EquationData::SphereObstacle<dim>(base_mesh == "box" ? 1.0 : 0.5))),
transfer_solution (prm.get_bool("transfer solution")),
- n_refinement_cycles (prm.get_integer("number of cycles"))
+ n_refinement_cycles (prm.get_integer("number of cycles")),
+ current_refinement_cycle (0)
+
{
std::string strat = prm.get("refinement strategy");
if (strat == "global")
PlasticityContactProblem<dim>::run ()
{
computing_timer.reset();
- for (current_refinement_cycle = 0;
- current_refinement_cycle < n_refinement_cycles;
+ for (; current_refinement_cycle < n_refinement_cycles;
++current_refinement_cycle)
{
{
TwoPhaseFlowProblem<dim>::TwoPhaseFlowProblem (const unsigned int degree)
:
triangulation (Triangulation<dim>::maximum_smoothing),
-
+ global_Omega_diameter (std::numeric_limits<double>::quiet_NaN()),
degree (degree),
darcy_degree (degree),
darcy_fe (FE_Q<dim>(darcy_degree+1), dim,
time_step (0),
old_time_step (0),
+ timestep_number (0),
viscosity (0.2),
porosity (1.0),
AOS_threshold (3.0),
SaturationInitialValues<dim>(),
old_saturation_solution);
- timestep_number = 0;
time_step = old_time_step = 0;
current_macro_time_step = old_macro_time_step = 0;