|
From: edgar <edg...@cr...> - 2021-08-23 03:54:25
|
Hi! Is there a flag which I can add to my compilation process (Make.common) to disable complex arithmetic (or another way to achieve that goal)? Thanks! |
|
From: Hubert W. <hub...@gm...> - 2021-08-23 08:33:35
|
Good morning Edgar, using ``--enable-complex=no`` should do you that trick. In the output of `configure --help` is a statement Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] which is a bit hidden if one seeks for a particular option. I hope, this help you. All the best Hubert On 8/23/21 5:54 AM, edgar wrote: > Hi! > > Is there a flag which I can add to my compilation process > (Make.common) to disable complex arithmetic (or another way to achieve > that goal)? Thanks! > > > _______________________________________________ > Libmesh-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-users |
|
From: edgar <edg...@cr...> - 2021-08-23 12:53:33
|
Hi Hubert! Thanks. It seems that the option which you are sending is for the overall libMesh compilation (correct me if I'm wrong). I am interested in having my libMesh with the ability to process complex numbers, and just compiling a specific program (not the whole libMesh) without complex numbers. Do you know if there is a way for that? Thank you again. On 2021-08-23 08:33, Hubert Weissmann wrote: > Good morning Edgar, > > using ``--enable-complex=no`` should do you that trick. > In the output of `configure --help` is a statement > > > Optional Features: > --disable-option-checking ignore unrecognized --enable/--with > options > --disable-FEATURE do not include FEATURE (same as > --enable-FEATURE=no) > --enable-FEATURE[=ARG] include FEATURE [ARG=yes] > > which is a bit hidden if one seeks for a particular option. > > I hope, this help you. > > All the best > Hubert |
|
From: Paul T. B. <ptb...@gm...> - 2021-08-23 12:58:33
|
Hi Edgar, The way I think you'll want to handle this is using libMesh's built-in numeric types. libMesh::Number will be a complex-valued quantity when libMesh is compiled with complex numbers and a standard float when not. libMesh::Real will always be a standard float, regardless of the complex mode that libMesh is configured with. So the part of your program that you wish to be real-valued, use libMesh::Real. HTH, Paul On Mon, Aug 23, 2021 at 7:53 AM edgar <edg...@cr...> wrote: > Hi Hubert! > > Thanks. It seems that the option which you are sending is for the > overall libMesh compilation (correct me if I'm wrong). I am interested > in having my libMesh with the ability to process complex numbers, and > just compiling a specific program (not the whole libMesh) without > complex numbers. Do you know if there is a way for that? Thank you > again. > > > On 2021-08-23 08:33, Hubert Weissmann wrote: > > Good morning Edgar, > > > > using ``--enable-complex=no`` should do you that trick. > > In the output of `configure --help` is a statement > > > > > > Optional Features: > > --disable-option-checking ignore unrecognized --enable/--with > > options > > --disable-FEATURE do not include FEATURE (same as > > --enable-FEATURE=no) > > --enable-FEATURE[=ARG] include FEATURE [ARG=yes] > > > > which is a bit hidden if one seeks for a particular option. > > > > I hope, this help you. > > > > All the best > > Hubert > > > _______________________________________________ > Libmesh-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > |
|
From: Hubert W. <hub...@gm...> - 2021-08-23 13:02:56
|
Hi Edgar, yes you are right. Sorry; than I misinterpreted your question. Than I agree with Paul below; but AFAIK the `Systems` matrix/rhs (and thus solution) allways are of `Number` type!? At least for the `Linear` systems, I am not aware of a builtin way to change this. Best regards On 8/23/21 2:58 PM, Paul T. Bauman wrote: > Hi Edgar, > > The way I think you'll want to handle this is using libMesh's built-in > numeric types. libMesh::Number will be a complex-valued quantity when > libMesh is compiled with complex numbers and a standard float when not. > libMesh::Real will always be a standard float, regardless of the complex > mode that libMesh is configured with. So the part of your program that you > wish to be real-valued, use libMesh::Real. > > HTH, > > Paul > > On Mon, Aug 23, 2021 at 7:53 AM edgar <edg...@cr...> wrote: > >> Hi Hubert! >> >> Thanks. It seems that the option which you are sending is for the >> overall libMesh compilation (correct me if I'm wrong). I am interested >> in having my libMesh with the ability to process complex numbers, and >> just compiling a specific program (not the whole libMesh) without >> complex numbers. Do you know if there is a way for that? Thank you >> again. >> >> >> On 2021-08-23 08:33, Hubert Weissmann wrote: >>> Good morning Edgar, >>> >>> using ``--enable-complex=no`` should do you that trick. >>> In the output of `configure --help` is a statement >>> >>> >>> Optional Features: >>> --disable-option-checking ignore unrecognized --enable/--with >>> options >>> --disable-FEATURE do not include FEATURE (same as >>> --enable-FEATURE=no) >>> --enable-FEATURE[=ARG] include FEATURE [ARG=yes] >>> >>> which is a bit hidden if one seeks for a particular option. >>> >>> I hope, this help you. >>> >>> All the best >>> Hubert >> >> _______________________________________________ >> Libmesh-users mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libmesh-users >> > _______________________________________________ > Libmesh-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > |
|
From: edgar <edg...@cr...> - 2021-08-23 13:14:36
|
Dear Paul and Hubert,
Thank you very much. I had tried by changing libMesh::Number to
libMesh::Real, and I was getting an error. I thought that it was related
to PETSc, but now that Hubert mentions about the solvers, I guess that
he is right. I am getting this:
error: no matching function for call to
'libMesh::DirichletBoundary::DirichletBoundary(std::set<short int>&,
std::vector<unsigned int>&, libMesh::ConstFunction<double>,
libMesh::VariableIndexing)'
66 | libMesh::LOCAL_VARIABLE_ORDER);
... --- 8< snip ----
error: cannot convert 'libMesh::DenseMatrix<double>' to
'libMesh::DenseMatrix<std::complex<double> >&'
150 |
dof_map.heterogenously_constrain_element_matrix_and_vector (Ke, Fe,
dof_indices);
Thank you both. I will live with my complex numbers :D .
On 2021-08-23 13:02, Hubert Weissmann wrote:
> Hi Edgar,
>
> yes you are right. Sorry; than I misinterpreted your question.
> Than I agree with Paul below; but AFAIK the `Systems` matrix/rhs (and
> thus solution) allways are of `Number` type!?
>
> At least for the `Linear` systems, I am not aware of a builtin way to
> change this.
>
> Best regards
>
>
> On 8/23/21 2:58 PM, Paul T. Bauman wrote:
>> Hi Edgar,
>>
>> The way I think you'll want to handle this is using libMesh's built-in
>> numeric types. libMesh::Number will be a complex-valued quantity when
>> libMesh is compiled with complex numbers and a standard float when
>> not.
>> libMesh::Real will always be a standard float, regardless of the
>> complex
>> mode that libMesh is configured with. So the part of your program that
>> you
>> wish to be real-valued, use libMesh::Real.
>>
>> HTH,
>>
>> Paul
>
>
> _______________________________________________
> Libmesh-users mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
|
|
From: John P. <jwp...@gm...> - 2021-08-23 13:03:04
|
On Mon, Aug 23, 2021 at 7:53 AM edgar <edg...@cr...> wrote: > Hi Hubert! > > Thanks. It seems that the option which you are sending is for the > overall libMesh compilation (correct me if I'm wrong). I am interested > in having my libMesh with the ability to process complex numbers, and > just compiling a specific program (not the whole libMesh) without > complex numbers. Do you know if there is a way for that? Thank you > again. > The decision to use complex numbers is a compile-time one. If your program links against a libmesh with complex numbers enabled, then the Number type is #defined to be std::complex<double>. Furthermore certain libmesh templates, in particular the NumericVector and SparseMatrix classes are only instantiated for type Number, so these will all use std::complex<double> internally in such builds. -- John |
|
From: edgar <edg...@cr...> - 2021-08-23 13:18:52
|
On 2021-08-23 13:02, John Peterson wrote: > On Mon, Aug 23, 2021 at 7:53 AM edgar <edg...@cr...> wrote: > >> Hi Hubert! >> >> Thanks. It seems that the option which you are sending is for the >> overall libMesh compilation (correct me if I'm wrong). I am interested >> in having my libMesh with the ability to process complex numbers, and >> just compiling a specific program (not the whole libMesh) without >> complex numbers. Do you know if there is a way for that? Thank you >> again. >> > > The decision to use complex numbers is a compile-time one. If your > program > links against a libmesh with complex numbers enabled, then the Number > type > is #defined to be std::complex<double>. Furthermore certain libmesh > templates, in particular the NumericVector and SparseMatrix classes are > only instantiated for type Number, so these will all use > std::complex<double> internally in such builds. Thank you very much, John. Indeed, my suspicion was in the right track (see previous e-mail where I answer to Hubert and Paul). If I may add to your comment in a joyous way: ...and if you try to modify the LIBMESH_USE_COMPLEX_NUMBERS=0, it will die a terrible death :P . |
|
From: Hubert W. <hub...@gm...> - 2021-08-23 14:52:02
|
Just to add on this out of curiosity: Due to the missing instantiation of NumericVector<Real> etc. it will be even not possible to setup some custom `System`-type with double-variables, I guess? Best regards Hubert On 8/23/21 3:02 PM, John Peterson wrote: > On Mon, Aug 23, 2021 at 7:53 AM edgar <edg...@cr...> wrote: > >> Hi Hubert! >> >> Thanks. It seems that the option which you are sending is for the >> overall libMesh compilation (correct me if I'm wrong). I am interested >> in having my libMesh with the ability to process complex numbers, and >> just compiling a specific program (not the whole libMesh) without >> complex numbers. Do you know if there is a way for that? Thank you >> again. >> > The decision to use complex numbers is a compile-time one. If your program > links against a libmesh with complex numbers enabled, then the Number type > is #defined to be std::complex<double>. Furthermore certain libmesh > templates, in particular the NumericVector and SparseMatrix classes are > only instantiated for type Number, so these will all use > std::complex<double> internally in such builds. > |