本文整理汇总了C++中Orderizer::save_mesh_vtk方法的典型用法代码示例。如果您正苦于以下问题:C++ Orderizer::save_mesh_vtk方法的具体用法?C++ Orderizer::save_mesh_vtk怎么用?C++ Orderizer::save_mesh_vtk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orderizer
的用法示例。
在下文中一共展示了Orderizer::save_mesh_vtk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
highOrd.assemble_High_Order(conv_matrix,mass_matrix);
mass_matrix->multiply_with_Scalar(time_step); // massmatrix = M_C
lumped_matrix->multiply_with_Scalar(time_step); // M_L
//--------- Project the previous timestep solution on the FE space (FCT is applied )----------------
// coeff_vec : FCT -Projection, coeff_vec_2: L2 Projection (ogProjection)
if(ts==1)
fluxCorrection.project_FCT(&initial_condition, coeff_vec, coeff_vec_2,mass_matrix,lumped_matrix,time_step,&ogProjection,&lumpedProjection, ®Est);
else
fluxCorrection.project_FCT(&u_prev_time, coeff_vec, coeff_vec_2,mass_matrix,lumped_matrix,time_step,&ogProjection,&lumpedProjection, ®Est);
//------------------------- lower order solution------------
u_L = lowOrder.solve_Low_Order(lumped_matrix, coeff_vec,time_step);
//-------------high order solution (standard galerkin) ------
u_H = highOrd.solve_High_Order(coeff_vec);
//------------------------------Assemble antidiffusive fluxes and limit these-----------------------------------
fluxCorrection.antidiffusiveFlux(mass_matrix,lumped_matrix,conv_matrix,diffusion,u_H, u_L,coeff_vec, limited_flux,time_step,®Est);
//-------------Compute final solution ---------------
ref_sln_double = lowOrder.explicit_Correction(limited_flux);
Solution<double> ::vector_to_solution(ref_sln_double, ref_space, &ref_sln);
// Project the fine mesh solution onto the coarse mesh.
ogProjection.project_global(&space, &ref_sln, &sln, HERMES_L2_NORM);
// Calculate element errors and total error estimate.
err_est_rel_total = adaptivity.calc_err_est(&sln, &ref_sln) * 100;
// Report results.
Hermes::Mixins::Loggable::Static::info("ndof_coarse: %d, ndof_fine: %d, err_est_rel: %g%%", ndof,ref_ndof, err_est_rel_total);
// If err_est_rel too large, adapt the mesh.
if((err_est_rel_total < ERR_STOP)||(as>=ADAPSTEP_MAX)) done = true;
else
{
done = adaptivity.adapt(&selector, THRESHOLD, STRATEGY, MESH_REGULARITY);
// Increase the counter of performed adaptivity steps.
if(done == false) as++;
}
if(space.get_num_dofs() >= NDOF_STOP)
done = true;
if(done)
{
u_prev_time.copy(&ref_sln);
u_prev_time.set_own_mesh(ref_mesh); //ref_mesh can be deleted
}
// Visualize the solution and mesh.
if(HERMES_VISUALIZATION)
{
sprintf(title, "Ref-Loesung: Time %3.2f,timestep %i,as=%i,", current_time,ts,as);
sview.set_title(title);
sview.show(&ref_sln);
sprintf(title, "Mesh: Time %3.2f,timestep %i,as=%i,", current_time,ts,as);
mview.set_title(title);
mview.show(&space);
}
if((VTK_VISUALIZATION) &&((done==true)&&(ts % VTK_FREQ == 0)))
{
// Output solution in VTK format.
char filename[40];
sprintf(filename, "solution-%i.vtk", ts );
lin.save_solution_vtk(&u_prev_time, filename, "solution", mode_3D);
sprintf(filename, "ref_space_order-%i.vtk", ts);
ord.save_orders_vtk(ref_space, filename);
sprintf(filename, "ref_mesh-%i.vtk", ts );
ord.save_mesh_vtk(ref_space, filename);
}
// Clean up.
delete lumped_matrix;
delete diffusion;
delete [] coeff_vec_2;
delete [] coeff_vec;
delete [] limited_flux;
delete ref_mesh;
delete ref_space;
}
while (done == false);
// Update global time.
current_time += time_step;
// Increase time step counter
ts++;
}
while (current_time < T_FINAL);
// Visualize the solution.
if(VTK_VISUALIZATION) {
lin.save_solution_vtk(&u_prev_time, "end_solution.vtk", "solution", mode_3D);
ord.save_mesh_vtk(&space, "end_mesh");
ord.save_orders_vtk(&space, "end_order.vtk");
}
delete mass_matrix;
delete conv_matrix;
// Wait for the view to be closed.
View::wait();
return 0;
}