Maybe typo on Step-40's webpage

20 views
Skip to first unread message

Zhidong Brian Zhang

unread,
Dec 11, 2019, 1:31:47 PM12/11/19
to deal.II User Group
Dear, Colleagues,

I tried to run the code from Step-40's webpage,
https://www.dealii.org/current/doxygen/deal.II/step_40.html

However, I encountered errors: error: ‘LinearAlgebraPETSc’ is not a namespace-name
   using namespace ::LinearAlgebraPETSc;

So I compared the code from the locally installed file of Step-40 and found there is a slight difference:

Webpage:
namespace LA
{
#if defined(DEAL_II_WITH_PETSC) && !defined(DEAL_II_PETSC_WITH_COMPLEX) && \
!(defined(DEAL_II_WITH_TRILINOS) && defined(FORCE_USE_OF_TRILINOS))
using namespace ::LinearAlgebraPETSc;
# define USE_PETSC_LA
#elif defined(DEAL_II_WITH_TRILINOS)
using namespace ::LinearAlgebraTrilinos;
#else
# error DEAL_II_WITH_PETSC or DEAL_II_WITH_TRILINOS required
#endif
} // namespace LA

Locally installed:
namespace LA
{
#if defined(DEAL_II_WITH_PETSC) && !defined(DEAL_II_PETSC_WITH_COMPLEX) && \
 
!(defined(DEAL_II_WITH_TRILINOS) && defined(FORCE_USE_OF_TRILINOS))
 
using namespace dealii::LinearAlgebraPETSc;
#  define USE_PETSC_LA
#elif defined(DEAL_II_WITH_TRILINOS)
 
using namespace dealii::LinearAlgebraTrilinos;
#else
#  error DEAL_II_WITH_PETSC or DEAL_II_WITH_TRILINOS required
#endif
} // namespace LAEnter code here...

I have highlighted the difference. After adding "dealii", the program can be run successfully.

I guess maybe these are typos. I am new to deal.ii, so I am not sure my guess is correct or not. I am just curious about this (no offence), because I may miss some important point here.

Thank you very much for your attention!

Zhidong Brian Zhang

David Wells

unread,
Dec 11, 2019, 1:52:45 PM12/11/19
to deal.II User Group
Dear Zhidong,

Thanks for finding and reporting this :)

When we compile the doxygen documentation we remove all occurrences of

dealii::

since, for a variety of reasons, it's easier to pretend in the manual
that all deal.II classes are in the global namespace. This is done
with, if I recall correctly, a simple text substitution - hence, the
webpage for step-40 has

using namespace ::LinearAlgebraPETSc

instead of what is actually in the source file:

using namespace dealii::LinearAlgebraPETSc

Put another way: this text substitution is wrong for this example and
needs to be fixed. Could you help us by opening a GitHub issue to
track this problem with the documentation?

Thanks,
David
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/6b06a25a-3812-4333-b2db-ee1cbcc9cf09%40googlegroups.com.

Zhidong Brian Zhang

unread,
Dec 11, 2019, 2:44:19 PM12/11/19
to deal.II User Group
Dear, David,

Thank you very much for your timely reply!

Now it is clear. It is so important to double check with experts of deal.ii.

I already opened a GitHub issue: https://github.com/dealii/dealii/issues/9163

Thanks

Best regards,

Zhidong Brian Zhang
> To unsubscribe from this group and stop receiving emails from it, send an email to dea...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages