Commit 22ee98a8 authored by Matthieu Constant's avatar Matthieu Constant
Browse files

reload new

parent 1632d7cf
......@@ -87,6 +87,9 @@ int fluid_problem_import_vtk(FluidProblem *problem, const char *filename)
if(!strcasecmp(a.name,"Porosity")) {
free(problem->porosity);
problem->porosity = mb_vtk_data_array_to_double(&a,m->n_nodes,1);
}else if(!strcasecmp(a.name,"OldPorosity")) {
free(problem->oldporosity);
problem->oldporosity = mb_vtk_data_array_to_double(&a,m->n_nodes,1);
}
else if(!strcasecmp(a.name,"Pressure")) {
double *p = mb_vtk_data_array_to_double(&a,m->n_nodes,1);
......@@ -207,12 +210,17 @@ int fluid_problem_export_vtk(const FluidProblem *problem, const char *output_dir
#endif
fprintf(f,"\n</DataArray>\n");
fprintf(f,"</Cells>\n");
fprintf(f,"<PointData Scalars=\"Porosity Pressure\" Vectors=\"Velocity\">\n");
fprintf(f,"<PointData Scalars=\"Porosity OldPorosity Pressure\" Vectors=\"Velocity\">\n");
fprintf(f,"<DataArray Name=\"Porosity\" NumberOfComponents = \"1\" type=\"Float64\" format=\"ascii\">\n");
for (int i = 0; i < mesh->n_nodes; ++i) {
fprintf(f, "%g ", problem->porosity[i]);
}
fprintf(f,"\n</DataArray>\n");
fprintf(f,"<DataArray Name=\"OldPorosity\" NumberOfComponents = \"1\" type=\"Float64\" format=\"ascii\">\n");
for (int i = 0; i < mesh->n_nodes; ++i) {
fprintf(f, "%g ", problem->oldporosity[i]);
}
fprintf(f,"\n</DataArray>\n");
fprintf(f,"<DataArray Name=\"Pressure\" NumberOfComponents = \"1\" type=\"Float64\" format=\"ascii\">\n");
for (int i = 0; i < mesh->n_nodes; ++i) {
fprintf(f, "%g ", problem->solution[i*n_fields+(DIMENSION)]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment