[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Getfem-users] Introduction of a constant into the assembly process
From: |
Renard Yves |
Subject: |
Re: [Getfem-users] Introduction of a constant into the assembly process |
Date: |
Thu, 23 Jul 2009 21:58:11 +0200 |
User-agent: |
Dynamic Internet Messaging Program (DIMP) H3 (1.1.2) |
Véronique Pham <address@hidden> a écrit :
Hi everyone,
I would like to ask an other question about the assembling using the getfem
generic_assembly procedure.
I'm trying to solve that kind of equation : eta*u ? \delta u = f, where eta
is a real type constant.
What is the best way to introduce this constant into the assembly process?
I?m thinking of using the ?generic mass matrix assembly with an additional
parameter? of the library. The code should be :
{
getfem::generic_assembly assem;
assem.push_mi(mim);
assem.push_mf(mf_u);
assem.push_data(std::vector<T>(mf_u.nb_dof(),eta));
assem.push_mat(A);
assem.set("F=data(#1);"
"M(#1,#1)+=sym(comp(Base(#1).Base(#1).Base(#1))(:,:,i).F(i));");
assem.assembly();
}
You can either push a vector with only one component
getfem::generic_assembly assem;
assem.push_mi(mim);
assem.push_mf(mf_u);
assem.push_data(std::vector<T>(1,eta));
assem.push_mat(A);
assem.set("F=data(1);"
"M(#1,#1)+=sym(comp(Base(#1).Base(#1))(:,:).F(p));");
assem.assembly();
either simply multiply the resulting matrix by eta with
gmm::scale(A, eta);
Yves.
Instead of using ?assem.push_data(std::vector<T>(mf_u.nb_dof(),eta))? part,
which is ineficient, should I create a mesh with a big quad element and a P0
shape function?
Thanks for your help.
Veronique.