[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Matrix reuse
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: Matrix reuse
- From: "Lisandro Dalcin" <dalcinl@xxxxxxxxx>
- Date: Thu, 22 Nov 2007 15:22:24 -0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ThlvjcUNXrxGCFEfXsPpNUHHrkMwGB5WzXb1Oo5qEM0=; b=XGP2qdtS80Oi+jwOzARdbOJZgtR2q4pbB1kMEzxkRxZGI3Hq+rRqH6tASvZhp37+sg43pPotPGqSh02xOub2cCnv1PFLzgEwc0CI8d8iFKFyXCgXoPMaUNieQDLtEeUk7W3Xjt2+Zg8L08+3WwN8nkAVV3aC5SFe6vSFOizWMrs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZzwAVDKIh//dlKXol9kasiAjT65pROhfwHdL+dhc9zveSp/OSYQaGyj0Z/bvJj5blwGyWkOehGhrMKWe92N8xBMXVYaFU9QuPY38s8jhq+aVk4bi/qZLK8OV1td5nCDz++QP49+wtEQ2BGbh8g1cK3juBSBJ8wsAi696MRqXy1g=
- In-reply-to: <47459BCF.3070409@ewi.tudelft.nl>
- References: <47459BCF.3070409@ewi.tudelft.nl>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
On 11/22/07, Zhifeng Sheng <z.sheng@xxxxxxxxxxxxxx> wrote:
> In my application, I have small matrices that are created and destroied,
> those matrices are of the same nozero pattern.
> I wonder if there is a way to reuse that matrices instead of destroy
> them every time.
Just do not destroy them! Use the matrices, and then start again your
loop with MatSetValues(), calling MatAssemblyBegin() and
MatAssemblyEnd() after the loop.
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594