hypre
hypre copied to clipboard
Structured Adaptive Mesh Refinement - example code and question
Dear Hypre team,
I am trying to understand the SStruct
interface and especially the way to reproduce the example is section 3.3 "Structured Adaptive Mesh Refinement".
Do you have a code to reproduces the example?
From a more conceptual point of view: I need 2 parts, one for each mesh level and both part will have an associated stencil (let's say the standard 5-point).
However, the following is not clear to me:
the function GraphAddEntries
need to be called as for part 0
and part 1
. For example the calls in part 1
would look like (with var = 0
):
// point {2,3}
HYPRE_SStructGraphAddEntries(graph, /* part 1 information */ 1, {6,6}, 0,
/* part 0 information */ 0, {2,3}, 0);
// point {3,2}
HYPRE_SStructGraphAddEntries(graph, /* part 1 information */ 1, {6,6}, 0,
/* part 0 information */ 0, {3,2}, 0);
But then I need to fill the matrix for the equation in {6,6}
, let's say using HYPRE_SStructMatrixSetValues
.
How do I set a value in my matrix? What value of entries
should I use in order to be able to access the graph entries I have just added?
Thanks for your help and your time!