Sorry,
I hit "reply" rather than "reply all".
Bård
-------- Forwarded Message --------
Subject: Re: [OPM] Porsol: IncompFlowSolverHybrid - decrypting the procedure
Date: Mon, 16 Mar 2015 16:43:23 +0100
From: Bård Skaflestad <[email protected]>
To: Jørgen Kvalsvik <[email protected]>
On 16/03/15 16:11, Jørgen Kvalsvik wrote:
in the periodic case, it uses plain assignment S_[i][j] = x,
whereas in all the other cases it uses +=.
Do you mean *Dirichlet* case rather than periodic in the above statement?
I ported it to use += in all
cases, and it still gives the same result.
Yes it does because Dirichlet and Periodic are only encountered on
boundaries meaning update (+=) has the same effect as assignment (=).
The reason is that each boundary connection is encountered exactly once
during system assembly and the matrix is explicitly initialised to all
zero elements at the beginning of assembleDynamic().
That said, I did write assignment on purpose because Dirichlet
conditions are essential boundary conditions and those statements
implement a variant of the technique sometimes referred to as explicit
elimination and the assignment expresses explicit value overriding a bit
more clearly than update.
As for the overall construction approach, it basically boils down to
which is more expensive:
* Having two copies of the matrix in memory and re-forming
the (unchanging) sparsity structure on each call to solve()
* Forming the sparsity structure once and doing per-coefficient
updates
The latter has an O(log (number of non-zeros per row)) time complexity
for each coefficient and the former consumes more memory. On the other
hand, if done correctly, the former approach has an essentially optimal
overall time complexity of
O(total number of non-zero elements)
so that's an attractive property.
Sincerely,
--
Bård Skaflestad <[email protected]>
SINTEF ICT, Applied Mathematics
_______________________________________________
Opm mailing list
[email protected]
http://www.opm-project.org/mailman/listinfo/opm