[Getdp] Can GetDP reuse a stiffness matrix?

John_V jvillar.john at gmail.com
Fri Jan 14 17:50:56 CET 2011


Thank you. I do not find SolveAgain in the documentation, so I am unsure of
the syntax. I am tempted at first to think the syntax is identical to Solve,
but SolveAgain implies that there is some continuity between the previous
solution and the new one--i.e., that GetDP knows about it somehow.

In my application GetDP runs the the n'th solution and terminates. A
different program reads the solution, performs some operations, and
determines a new charge density distribution. GetDP is then restarted to
perform the (n+1)st solution. It seems there should be much opportunity to
save time here, e.g., by reusing the preconditioner, the stiffness matrix,
maybe even the previous solution as starting guess for the new iteration,
but the (n+1)st instance of GetDP needs to import all these things from
output made by the n'th instance.

If GetDP can do this, I am willing to experiment, but not sure how yet.
Besides the syntax for SaveAgain, I will need to read about the Print
command. Then what is the corresponding command used to import that which
was exported by Print?

John

On Fri, Jan 14, 2011 at 9:49 AM, John_V <jvillar.john at gmail.com> wrote:

> Thank you. I do not find SolveAgain in the documentation, so I am unsure of
> the syntax. I am tempted at first to think the syntax is identical to Solve,
> but SolveAgain implies that there is some continuity between the previous
> solution and the new one--i.e., that GetDP knows about it somehow.
>
> In my application GetDP runs the the n'th solution and terminates. A
> different program reads the solution, performs some operations, and
> determines a new charge density distribution. GetDP is then restarted to
> perform the (n+1)st solution. It seems there should be much opportunity to
> save time here, e.g., by reusing the preconditioner, the stiffness matrix,
> maybe even the previous solution as starting guess for the new iteration,
> but the (n+1)st instance of GetDP needs to import all these things from
> output made by the n'th instance.
>
> If GetDP can do this, I am willing to experiment, but not sure how yet.
> Besides the syntax for SaveAgain, I will need to read about the Print
> command. Then what is the corresponding command used to import that which
> was exported by Print?
>
> John
>
>
>
> On Fri, Jan 14, 2011 at 7:58 AM, Christophe Geuzaine <cgeuzaine at ulg.ac.be>wrote:
>
>> On 13/01/11 15:20, John_V wrote:
>>
>>> I am using GetDP to repeatedly solve electrostatic problems on the same
>>> mesh. The only thing that changes from one solution to the next is the
>>> distribution of charges. That is, GetDP is solving K.V = S for V, where
>>> the stiffness matrix K is every time the same and only S changes. In
>>> this circumstance it is not in principle necessary to build K from the
>>> mesh every time. It could just be built the first time and then reused.
>>>
>>> I have two questions:
>>>
>>> 1. Does GetDP presently implement any mechanism to do this? For example,
>>> is there a way to export the matrix to a file after it is computed, and
>>> then import it for use the next time GetDP is used?
>>>
>>>
>> Yes (see the Print command), but I don't think it would help, as currently
>> the matrix and the right hand side are assembled during the same process.
>>
>>
>>  2. Is this likely to save any (or much) time? Each resolution is taking
>>> about 15 to 50 minutes on my computer, but I don't know what fraction of
>>> this is spent building the K matrix and what fraction is actually
>>> solving the system of equations. I know from watching the output that
>>> all of the [0% - 10% - ... 90% - Done] convergence messages appear in
>>> the last minute or so. If those coincide with the solution of the
>>> equations then it may be that a significant amount of the time is spent
>>> computing K, in which case this could lead to a big time savings.
>>>
>>>
>> For low order interpolation (1st order), solving the linear system should
>> take much longer than assembling the matrix (unless there are some really
>> complex expressions to be evaluated to build the operator).
>>
>> To keep the preconditionner from one solution to the other, you can use
>> "SolveAgain" instead of "Solve" in the operations.
>>
>> If this does not help, could you send a small example?
>>
>> Thanks,
>>
>> Christophe
>>
>>  John
>>>
>>>
>>> _______________________________________________
>>> getdp mailing list
>>> getdp at geuz.org
>>> http://www.geuz.org/mailman/listinfo/getdp
>>>
>>>
>>
>> --
>> Prof. Christophe Geuzaine
>> University of Liege, Electrical Engineering and Computer Science
>> http://www.montefiore.ulg.ac.be/~geuzaine<http://www.montefiore.ulg.ac.be/%7Egeuzaine>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/getdp/attachments/20110114/876280a0/attachment.html>