getfem-users
[Top][All Lists]
Advanced

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

Re: [Getfem-users] generic_as​​​sembly of complex_ty​​​pe


From: Yves Renard
Subject: Re: [Getfem-users] generic_as​​​sembly of complex_ty​​​pe
Date: Tue, 3 Jan 2012 09:10:38 +0100
User-agent: KMail/1.13.5 (Linux/2.6.32-37-server; KDE/4.4.5; x86_64; ; )



Dear wan rong Joung,

Unfortunately, the generic assembly of Getfem++ do not accept directly a 
complex type vector or matrix. You have to push both the real and imaginary 
part as follows :

assem3.push_data(gmm::real_part(CCGik));
assem3.push_data(gmm::real_part(Ui));
assem3.push_data(gmm::imag_part(CCGik));
assem3.push_data(gmm::imag_part(Ui));

and take it into account in your assembly formula of course.

Yves.


On mardi 3 janvier 2012, wan rong Joung wrote:
> Dear all,
> 
> I have used “GetFem++” for several month and I appreciate it very much.
> 
> I have some problem about <complex_type>. I set some parameters for
> complex_type(without brick). However I get some error from -------
> 
> ------------------à getfem::generic_assembly
> 
> 
> 
> The code following:
> 
> std::vector<scalar_type> H,CCG,CCGK2;
> 
> std::vector<complex_type> CCGik,CCGikUi,Ui;
> 
> 
> 
>  getfem::generic_assembly assem3;
> 
>  assem3.push_mi(mim);
> 
>  assem3.push_mf(mf_u);
> 
>  assem3.push_mf(mf_data);
> 
>  assem3.push_data(CCGik); // bug
> 
>  assem3.push_data(Ui); // bug
> 
>  assem3.push_vec(B);
> 
>  assem3.set("a=data$1(#2);"
> 
>             "b=data$2(#2);"
> 
>             "V(#1)+=2*comp(Base(#1).Base(#2))(:,k).a(k).b(k);");
> 
>  assem3.assembly(INCIDENT_BOUNDARY);
> 
> 
> 
> This caused the following error:
> 
> gmm::strongest_value_type<gmm::cs_vector_ref<const double*, const unsigned
> int*, 0>, std::vector<std::complex<double> > >::value_type' to
> 'bgeot::scalar_type' in assignment|
> 
> const std::complex<double>' to 'bgeot::scalar_type' in assignment|
> 
> 
> 
> I don’t understand this error information. Any comment for you will be
> highly appreciated.


-- 

  Yves Renard (address@hidden)       tel : (33) 04.72.43.87.08
  Pole de Mathematiques, INSA-Lyon             fax : (33) 04.72.43.85.29
  20, rue Albert Einstein
  69621 Villeurbanne Cedex, FRANCE
  http://math.univ-lyon1.fr/~renard

---------



reply via email to

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