Dear Gerris developers,
There is an issue with initialization of the Hypre module in that the
Hypre solvers (hypre_diffusion_solve and hypre_poisson_solve) are
(almost) never activated for GfsVariableTracer and GfsVariablePoisson.
The only case when they are activated is when "GModule hypre" line comes
after GfsVariableTracer/GfsVariablePoisson declaration in the parameter
file. This is almost never the case (especially for restart files when
"GModule hypre" are written at the header of the output files).
To fix this issue, the following block from hypre.c/gfs_module_read has
to be repeated at the end of simulation_read:
{//this takes care of HYPRE module initialization
GSList * i = GFS_DOMAIN (sim)->variables;
while (i) {
if (GFS_IS_VARIABLE_TRACER (i->data)) {
GfsAdvectionParams * par = &sim->advection_params;
if (par->diffusion_solve != gfs_diffusion) {
fprintf (stderr, "setting HYPRE solver for var = %s \n",
GFS_VARIABLE (i->data)->name);
GFS_VARIABLE_TRACER (i->data)->advection.diffusion_solve =
par->diffusion_solve;
}
}
else if (GFS_IS_VARIABLE_POISSON (i->data)) {
GfsMultilevelParams * par = &sim->approx_projection_params;
if (par->poisson_solve != gfs_poisson_solve) {
fprintf (stderr, "setting HYPRE solver for var = %s \n",
GFS_VARIABLE (i->data)->name);
GFS_VARIABLE_POISSON (i->data)->par.poisson_solve =
par->poisson_solve;
}
}
i = i->next;
}
}//end HYPRE module initialization
Because gfs_module_read typically comes before GtsObject reads
(including GfsVariable reads), the variables are not yet set and hypre
solvers are not properly initialized.
(Similarly, the solvers for SourceViscosity and SourceDiffusion need to
be treated).
Hope it's useful for those using the Hypre module.
Regards,
Vladimir
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now.
http://goparallel.sourceforge.net
_______________________________________________
Gfs-devel mailing list
Gfs-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gfs-devel