getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-users] Assembling question : possibility of using a vector of co


From: Véronique Pham
Subject: [Getfem-users] Assembling question : possibility of using a vector of complex
Date: Thu, 23 Jul 2009 09:58:18 +0200

Hi everyone,

I would like to ask a question about the assembling using the getfem generic_assembly procedure.
In the getfem_assembling.h file, on the Helmholtz equation case,
the real and the complex case are dissociate, there are:

-
For the complex case:

template<typename MATr, typename MATi, typename VECTr, typename VECTi> 
void asm_Helmholtz_cplx(const MATr &Mr, const MATi &Mi, const mesh_im &mim,
     const mesh_fem &mf_u, const mesh_fem &mf_data,
     const VECTr &K_squaredr, const VECTi &K_squaredi,
     const mesh_region &rg=mesh_region::all_convexes()) {
   generic_assembly assem("Kr=data$1(#2); Ki=data$2(#2);"
               "m = comp(Base(#1).Base(#1).Base(#2)); "
               "M$1(#1,#1)+=sym(m(:,:,i).Kr(i) - "
               "comp(Grad(#1).Grad(#1))(:,i,:,i));"
               "M$2(#1,#1)+=sym(m(:,:,i).Ki(i));");
   assem.push_mi(mim);
   assem.push_mf(mf_u);
   assem.push_mf(mf_data);
   assem.push_data(K_squaredr);
   assem.push_data(K_squaredi);
   assem.push_mat(const_cast<MATr&>(Mr));
   assem.push_mat(const_cast<MATi&>(Mi));
   assem.assembly(rg);
}

- For the real case:

template<typename MAT, typename VECT> 
void asm_Helmholtz_real(const MAT &M, const mesh_im &mim,
     const mesh_fem &mf_u, const mesh_fem &mf_data,
     const VECT &K_squared,
     const mesh_region &rg=mesh_region::all_convexes()) {
  generic_assembly assem("K=data$1(#2);"
               "m = comp(Base(#1).Base(#1).Base(#2)); "
               "M$1(#1,#1)+=sym(m(:,:,i).K(i) - "
               "comp(Grad(#1).Grad(#1))(:,i,:,i));");
  assem.push_mi(mim);
  assem.push_mf(mf_u);
  assem.push_mf(mf_data);
  assem.push_data(K_squared);
  assem.push_mat(const_cast<MAT&>(M));
  assem.assembly(rg);
}

Does that mean that we cannot use directly a vector of complex (interleaved real and imaginary part) and that we have to split it in 
two vectors of real?
Thanks for your help.

Veronique.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]