[deal.II] What do the AffineConstraints::distribute_local_to_global(...) functions do on a matrix/vector level?

2023-07-20 Thread Kyle Schwiebert
Hello all,

Thank you for taking the time to look at my question. First, I'll ask a 
couple of basic questions about the built-in functions, and then I'll give 
a few details of why I ask.

Does the inhomogeneity-handling call distribute_local_to_global(...,false) 
do the following:

Say that we have a constraint x_i = a. I would guess that the function 
takes the following steps: (matrix is M, RHS is right hand side)
1) Set M(i,i) = L and set RHS(i) = 0, where L is somehow "nice" for the 
matrix's spectrum.
2) Set the rest of the entries of the ith row and column of M = 0. Perhaps 
technically we don't bother to zero the column since we plan to call 
AffineConstraints::set_zero.
3) For each DoF j which is coupled to DoF i and is not itself constrained, 
we do RHS(j) -= a*M(j,i).

Now considering the same constraint with instead a call to 
distribute_local_to_global(local_rhs,dof_inds,global_rhs) I would guess 
that we just set RHS(i) = 0 and do nothing else special.

Most importantly, is the above correct?

If so, I am having trouble understanding where I might be going wrong. I'm 
solving a time dependent coupled problem with a decoupled solver. By 
decoupled solver I mean that information from the second domain only 
appears in the right hand side. To make matters one step more complex, one 
term in my matrix is time-dependent and so I do not recompute the whole 
matrix. My procedure is this:

1) Assemble the static part of the matrix with a zero right hand side. This 
matrix will never be touched again. The vector, RHS_bc, which will also 
never be touched again contains no nonzero entries except for those created 
by the call to distribute_local_to_global(...,false).

2) I then assemble the time-dependent terms into a separate matrix and 
vector, RHS_td, using distribute_local_to_global(...,false) and add the 
RHS_bc to RHS_td.

3) I then assemble the coupled terms from the other solver into RHS_c with 
distribute_local_to_global(local_rhs,dof_inds,RHS_c).

4) I then add RHS_c to RHS_td and solve (being careful to call 
constraints.set_zero(solution) before the solve and 
constraints.distribute(solution) after the solve). I am of course using a 
custom class similar to the linear operator classes to bundle the vmult() 
outputs of the static and time-dependent matrices.

However, I am seeing blowup in my solution and I'm seeing some indication 
that the inhomogeneous boundary conditions are to blame. Note that I also 
tried calling constraints.set_zero(RHS_c) in step 4 above and as I expected 
that had no change (since presumably constrained entries are already zero).

Thank you again for taking the time to engage with my question and in 
advance for any tips you are able to offer.

-Kyle

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/0589f784-e1ed-4699-bf30-a7358b3acee1n%40googlegroups.com.


Re: [deal.II] Re: Compilation deal.II 9.5

2023-07-20 Thread Bruno Turcksin
You are using Cray that explains a lot. Cray does its own thing with MPI.
If it's possible, you can use a "regular" MPI compiler instead of CC.
Otherwise, you should be able to compile Kokkos using the cray compiler
directly, i.e., you don't use `nvcc_wrapper`.

Bruno

Le jeu. 20 juil. 2023 à 11:53, Giuseppe Orlando  a
écrit :

> Yes, I’m inside a clean directory. The output of mpicxx is
> “/opt/cray/pe/craype/2.7.10/bin/CC”, which is the same that I used to
> install all the other versions. The cmake version is 3.17.0.
>
>
>
> Best
>
>
>
> Giuseppe Orlando
>
>
>
> *Da: *Bruno Turcksin 
> *Inviato: *giovedì 20 luglio 2023 17:47
> *A: *dealii@googlegroups.com
> *Oggetto: *Re: [deal.II] Re: Compilation deal.II 9.5
>
>
>
> A few questions: are you configuring inside a clean directory? What's the
> output of mpicxx? Which version of cmake are you using?
>
>
>
> Le jeu. 20 juil. 2023 à 11:11, giuseppe orlando  a
> écrit :
>
> I agree. I had tried to set -DMPI_CXX_COMPILER flag, but it seems to be
> ineffective. It keeps using nvcc_wrapper for MPI.
>
>
>
> Best
>
> Il giorno giovedì 20 luglio 2023 alle 16:41:09 UTC+2 bruno.t...@gmail.com
> ha scritto:
>
> What's strange is that when deal.II tries to compile an MPI code, it is
> using `nvcc_wrapper` as the compiler instead of `mpicxx`. Can you try to
> set `-DMPI_CXX_COMPILER=mpicxx`?
>
>
>
> Bruno
>
>
>
> Le jeu. 20 juil. 2023 à 10:21, giuseppe orlando  a
> écrit :
>
> Here, you can find both 'CMakeError.log' and 'CMakeOutput.log'
>
> Best,
>
>
>
> Giuseppe
>
>
>
> Il giorno giovedì 20 luglio 2023 alle 14:32:34 UTC+2 bruno.t...@gmail.com
> ha scritto:
>
> Giuseppe,
>
>
>
> CMake should create an error log. Can you post it?
>
>
>
> Best,
>
>
>
> Bruno
>
>
>
> Le jeu. 20 juil. 2023 à 04:51, giuseppe orlando  a
> écrit :
>
> Dear Bruno,
>
> I tried to reinstall Kokkos removing the -DCMAKE_CXX_FLAGS option, but I
> get the same error during the creation of the Makefile for deal.II. I will
> try to figure out which might be the problem in the follwing days.
>
>
>
> Best,
>
>
>
> Giuseppe
>
> Il giorno mercoledì 19 luglio 2023 alle 19:36:53 UTC+2
> bruno.t...@gmail.com ha scritto:
>
> Giuseppe,
>
>
>
> I think the issue is because you set -DCMAKE_CXX_FLAGS=-arch=sm_60 when
> compiling Kokkos. This is not necessary because Kokkos takes care of that
> when you use -DKokkos_ARCH_PASCAL60=ON. Since you set that as a CXX flags
> it might be passed to MPI when it shouldn't. The rest looks good.
>
>
>
> Best,
>
>
>
> Bruno
>
>
>
>
>
> Le mer. 19 juil. 2023 à 13:29, giuseppe orlando  a
> écrit :
>
> Dear Bruno,
>
> thanks for the suggestion. I tried to follow it, but I still the get same
> error during the creation of the Makefile. Just to sum up I typed
>
> "export OMPI_CXX=/project/sm77/bin/kokkos/bin/nvcc_wrapper"
>
> "cmake -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/dealII/9.5.1/
> -DCMAKE_CXX_COMPILER=/project/sm77/bin/kokkos/bin/nvcc_wrapper
> -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=/project/sm77/bin/p4est/
> -DDEAL_II_WITH_MPI=ON -DDEAL_II_WITH_CUDA=ON
> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON -DKOKKOS_DIR=/project/sm77/bin/kokkos
> ../."
>
>
>
> At this point, I'm wondering if the problem could be related to how I
> installed Kokkos. This is the command to generate the Makefile for Kokkos
> and the installation went good, but at this point, I really don't know.
>
>
>
> "cmake -DCMAKE_CXX_COMPILER=/project/sm77/kokkos/bin/nvcc_wrapper
> -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/kokkos
> -DCMAKE_CXX_FLAGS=-arch=sm_60 -DKokkos_ENABLE_CUDA_LAMBDA=ON
> -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL60=ON ../."
>
>
>
> Best,
>
>
>
> Giuseppe
>
> Il giorno mercoledì 19 luglio 2023 alle 15:09:28 UTC+2
> bruno.t...@gmail.com ha scritto:
>
> Giuseppe,
>
>
>
> Your configuration line looks good. I use the same but I also export
> OMPI_CXX=/path/kokkos/bin/nvcc_wrapper
>
>
>
> Best,
>
>
>
> Bruno
>
>
>
> On Wednesday, July 19, 2023 at 4:38:07 AM UTC-4 gius...@gmail.com wrote:
>
> Hello everyone,
>
> I'm writing this post because I'm having some issues to compile the latest
> release. I would need a version which supports CUDA and MPI being
> CUDA-aware. Hence, I installed Kokkos using the flags
> -DKokkos_ENABLE_CUDA=ON and -DKokkos_ENABLE_CUDA_LAMBDA=ON. Then, I tried
> to build the Makefile specifying as CXX compiler the 'nvcc_wrapper' in
> Kokkos, namely using -DCMAKE_CXX_COMPILER=/path/kokkos/bin/nvcc_wrapper and
> using the flags -DDEAL_II_WITH_MPI=ON, -DDEAL_II_WITH_CUDA=ON,
> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON, -DKOKKOS_DIR=${Kokkos_dir}, but I get
> an error in finding MPI
>
>
>
>
>
> I also tried to specify the compiler I have always used with the previous
> version via -DMPI_CXX_COMPILER flag, but I get the same error. Did someone
> encounter the same issue? Am I supposed to use 'nvcc_wrapper' also for MPI?
>
>
>
> Thanks in advance.
>
>
>
> Best,
>
>
>
> Giuseppe
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> 

R: [deal.II] Re: Compilation deal.II 9.5

2023-07-20 Thread Giuseppe Orlando
Yes, I’m inside a clean directory. The output of mpicxx is “/opt/cray/pe/craype/2.7.10/bin/CC”, which is the same that I used to install all the other versions. The cmake version is 3.17.0. Best Giuseppe Orlando Da: Bruno TurcksinInviato: giovedì 20 luglio 2023 17:47A: dealii@googlegroups.comOggetto: Re: [deal.II] Re: Compilation deal.II 9.5 A few questions: are you configuring inside a clean directory? What's the output of mpicxx? Which version of cmake are you using? Le jeu. 20 juil. 2023 à 11:11, giuseppe orlando  a écrit :I agree. I had tried to set -DMPI_CXX_COMPILER flag, but it seems to be ineffective. It keeps using nvcc_wrapper for MPI. BestIl giorno giovedì 20 luglio 2023 alle 16:41:09 UTC+2 bruno.t...@gmail.com ha scritto:What's strange is that when deal.II tries to compile an MPI code, it is using `nvcc_wrapper` as the compiler instead of `mpicxx`. Can you try to set `-DMPI_CXX_COMPILER=mpicxx`? Bruno Le jeu. 20 juil. 2023 à 10:21, giuseppe orlando  a écrit :Here, you can find both 'CMakeError.log' and 'CMakeOutput.log'Best, Giuseppe Il giorno giovedì 20 luglio 2023 alle 14:32:34 UTC+2 bruno.t...@gmail.com ha scritto:Giuseppe, CMake should create an error log. Can you post it? Best, Bruno Le jeu. 20 juil. 2023 à 04:51, giuseppe orlando  a écrit :Dear Bruno,I tried to reinstall Kokkos removing the -DCMAKE_CXX_FLAGS option, but I get the same error during the creation of the Makefile for deal.II. I will try to figure out which might be the problem in the follwing days. Best, Giuseppe Il giorno mercoledì 19 luglio 2023 alle 19:36:53 UTC+2 bruno.t...@gmail.com ha scritto:Giuseppe,  I think the issue is because you set -DCMAKE_CXX_FLAGS=-arch=sm_60 when compiling Kokkos. This is not necessary because Kokkos takes care of that when you use -DKokkos_ARCH_PASCAL60=ON. Since you set that as a CXX flags it might be passed to MPI when it shouldn't. The rest looks good. Best, Bruno  Le mer. 19 juil. 2023 à 13:29, giuseppe orlando  a écrit :Dear Bruno,thanks for the suggestion. I tried to follow it, but I still the get same error during the creation of the Makefile. Just to sum up I typed"export OMPI_CXX=/project/sm77/bin/kokkos/bin/nvcc_wrapper""cmake -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/dealII/9.5.1/ -DCMAKE_CXX_COMPILER=/project/sm77/bin/kokkos/bin/nvcc_wrapper -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=/project/sm77/bin/p4est/ -DDEAL_II_WITH_MPI=ON -DDEAL_II_WITH_CUDA=ON -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON -DKOKKOS_DIR=/project/sm77/bin/kokkos ../." At this point, I'm wondering if the problem could be related to how I installed Kokkos. This is the command to generate the Makefile for Kokkos and the installation went good, but at this point, I really don't know.  "cmake -DCMAKE_CXX_COMPILER=/project/sm77/kokkos/bin/nvcc_wrapper -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/kokkos -DCMAKE_CXX_FLAGS=-arch=sm_60 -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL60=ON ../."  Best, GiuseppeIl giorno mercoledì 19 luglio 2023 alle 15:09:28 UTC+2 bruno.t...@gmail.com ha scritto:Giuseppe, Your configuration line looks good. I use the same but I also export OMPI_CXX=/path/kokkos/bin/nvcc_wrapper Best, Bruno On Wednesday, July 19, 2023 at 4:38:07 AM UTC-4 gius...@gmail.com wrote:Hello everyone,I'm writing this post because I'm having some issues to compile the latest release. I would need a version which supports CUDA and MPI being CUDA-aware. Hence, I installed Kokkos using the flags -DKokkos_ENABLE_CUDA=ON and -DKokkos_ENABLE_CUDA_LAMBDA=ON. Then, I tried to build the Makefile specifying as CXX compiler the 'nvcc_wrapper' in Kokkos, namely using -DCMAKE_CXX_COMPILER=/path/kokkos/bin/nvcc_wrapper and using the flags -DDEAL_II_WITH_MPI=ON, -DDEAL_II_WITH_CUDA=ON, -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON, -DKOKKOS_DIR=${Kokkos_dir}, but I get an error in finding MPI  I also tried to specify the compiler I have always used with the previous version via -DMPI_CXX_COMPILER flag, but I get the same error. Did someone encounter the same issue? Am I supposed to use 'nvcc_wrapper' also for MPI? Thanks in advance. Best, Giuseppe-- 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 a topic in the Google Groups "deal.II User Group" group.To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/7VthT7AeI4Q/unsubscribe.To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/d4717449-8c4a-48d2-b0eb-c56a4381f631n%40googlegroups.com.-- 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 a topic in the Google Groups "deal.II User Group" group.To unsubscribe from 

Re: [deal.II] Re: Compilation deal.II 9.5

2023-07-20 Thread Bruno Turcksin
A few questions: are you configuring inside a clean directory? What's the
output of mpicxx? Which version of cmake are you using?

Le jeu. 20 juil. 2023 à 11:11, giuseppe orlando  a
écrit :

> I agree. I had tried to set -DMPI_CXX_COMPILER flag, but it seems to be
> ineffective. It keeps using nvcc_wrapper for MPI.
>
> Best
>
> Il giorno giovedì 20 luglio 2023 alle 16:41:09 UTC+2 bruno.t...@gmail.com
> ha scritto:
>
>> What's strange is that when deal.II tries to compile an MPI code, it is
>> using `nvcc_wrapper` as the compiler instead of `mpicxx`. Can you try to
>> set `-DMPI_CXX_COMPILER=mpicxx`?
>>
>> Bruno
>>
>> Le jeu. 20 juil. 2023 à 10:21, giuseppe orlando  a
>> écrit :
>>
>>> Here, you can find both 'CMakeError.log' and 'CMakeOutput.log'
>>>
>>> Best,
>>>
>>> Giuseppe
>>>
>>> Il giorno giovedì 20 luglio 2023 alle 14:32:34 UTC+2
>>> bruno.t...@gmail.com ha scritto:
>>>
 Giuseppe,

 CMake should create an error log. Can you post it?

 Best,

 Bruno

 Le jeu. 20 juil. 2023 à 04:51, giuseppe orlando  a
 écrit :

> Dear Bruno,
> I tried to reinstall Kokkos removing the -DCMAKE_CXX_FLAGS option, but
> I get the same error during the creation of the Makefile for deal.II. I
> will try to figure out which might be the problem in the follwing days.
>
> Best,
>
> Giuseppe
>
> Il giorno mercoledì 19 luglio 2023 alle 19:36:53 UTC+2
> bruno.t...@gmail.com ha scritto:
>
>> Giuseppe,
>>
>> I think the issue is because you set -DCMAKE_CXX_FLAGS=-arch=sm_60
>> when compiling Kokkos. This is not necessary because Kokkos takes care of
>> that when you use -DKokkos_ARCH_PASCAL60=ON. Since you set that as a CXX
>> flags it might be passed to MPI when it shouldn't. The rest looks good.
>>
>> Best,
>>
>> Bruno
>>
>>
>> Le mer. 19 juil. 2023 à 13:29, giuseppe orlando 
>> a écrit :
>>
>>> Dear Bruno,
>>> thanks for the suggestion. I tried to follow it, but I still the get
>>> same error during the creation of the Makefile. Just to sum up I typed
>>> "export OMPI_CXX=/project/sm77/bin/kokkos/bin/nvcc_wrapper"
>>> "cmake -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/dealII/9.5.1/
>>> -DCMAKE_CXX_COMPILER=/project/sm77/bin/kokkos/bin/nvcc_wrapper
>>> -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=/project/sm77/bin/p4est/
>>> -DDEAL_II_WITH_MPI=ON -DDEAL_II_WITH_CUDA=ON
>>> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON 
>>> -DKOKKOS_DIR=/project/sm77/bin/kokkos
>>> ../."
>>>
>>> At this point, I'm wondering if the problem could be related to how
>>> I installed Kokkos. This is the command to generate the Makefile for 
>>> Kokkos
>>> and the installation went good, but at this point, I really don't know.
>>>
>>> "cmake -DCMAKE_CXX_COMPILER=/project/sm77/kokkos/bin/nvcc_wrapper
>>> -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/kokkos
>>> -DCMAKE_CXX_FLAGS=-arch=sm_60 -DKokkos_ENABLE_CUDA_LAMBDA=ON
>>> -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL60=ON ../."
>>>
>>> Best,
>>>
>>> Giuseppe
>>>
>>> Il giorno mercoledì 19 luglio 2023 alle 15:09:28 UTC+2
>>> bruno.t...@gmail.com ha scritto:
>>>
 Giuseppe,

 Your configuration line looks good. I use the same but I also
 export OMPI_CXX=/path/kokkos/bin/nvcc_wrapper

 Best,

 Bruno

 On Wednesday, July 19, 2023 at 4:38:07 AM UTC-4 gius...@gmail.com
 wrote:

 Hello everyone,
 I'm writing this post because I'm having some issues to compile the
 latest release. I would need a version which supports CUDA and MPI 
 being
 CUDA-aware. Hence, I installed Kokkos using the flags
 -DKokkos_ENABLE_CUDA=ON and -DKokkos_ENABLE_CUDA_LAMBDA=ON. Then, I 
 tried
 to build the Makefile specifying as CXX compiler the 'nvcc_wrapper' in
 Kokkos, namely using 
 -DCMAKE_CXX_COMPILER=/path/kokkos/bin/nvcc_wrapper and
 using the flags -DDEAL_II_WITH_MPI=ON, -DDEAL_II_WITH_CUDA=ON,
 -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON, -DKOKKOS_DIR=${Kokkos_dir}, but 
 I get
 an error in finding MPI

 [image: error_compilation_9_5.png]
 I also tried to specify the compiler I have always used with the
 previous version via -DMPI_CXX_COMPILER flag, but I get the same 
 error. Did
 someone encounter the same issue? Am I supposed to use 'nvcc_wrapper' 
 also
 for MPI?

 Thanks in advance.

 Best,

 Giuseppe

 --
>>> 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 a topic in
>>> 

Re: [deal.II] Re: Compilation deal.II 9.5

2023-07-20 Thread Bruno Turcksin
What's strange is that when deal.II tries to compile an MPI code, it is
using `nvcc_wrapper` as the compiler instead of `mpicxx`. Can you try to
set `-DMPI_CXX_COMPILER=mpicxx`?

Bruno

Le jeu. 20 juil. 2023 à 10:21, giuseppe orlando  a
écrit :

> Here, you can find both 'CMakeError.log' and 'CMakeOutput.log'
>
> Best,
>
> Giuseppe
>
> Il giorno giovedì 20 luglio 2023 alle 14:32:34 UTC+2 bruno.t...@gmail.com
> ha scritto:
>
>> Giuseppe,
>>
>> CMake should create an error log. Can you post it?
>>
>> Best,
>>
>> Bruno
>>
>> Le jeu. 20 juil. 2023 à 04:51, giuseppe orlando  a
>> écrit :
>>
>>> Dear Bruno,
>>> I tried to reinstall Kokkos removing the -DCMAKE_CXX_FLAGS option, but I
>>> get the same error during the creation of the Makefile for deal.II. I will
>>> try to figure out which might be the problem in the follwing days.
>>>
>>> Best,
>>>
>>> Giuseppe
>>>
>>> Il giorno mercoledì 19 luglio 2023 alle 19:36:53 UTC+2
>>> bruno.t...@gmail.com ha scritto:
>>>
 Giuseppe,

 I think the issue is because you set -DCMAKE_CXX_FLAGS=-arch=sm_60 when
 compiling Kokkos. This is not necessary because Kokkos takes care of that
 when you use -DKokkos_ARCH_PASCAL60=ON. Since you set that as a CXX flags
 it might be passed to MPI when it shouldn't. The rest looks good.

 Best,

 Bruno


 Le mer. 19 juil. 2023 à 13:29, giuseppe orlando  a
 écrit :

> Dear Bruno,
> thanks for the suggestion. I tried to follow it, but I still the get
> same error during the creation of the Makefile. Just to sum up I typed
> "export OMPI_CXX=/project/sm77/bin/kokkos/bin/nvcc_wrapper"
> "cmake -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/dealII/9.5.1/
> -DCMAKE_CXX_COMPILER=/project/sm77/bin/kokkos/bin/nvcc_wrapper
> -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=/project/sm77/bin/p4est/
> -DDEAL_II_WITH_MPI=ON -DDEAL_II_WITH_CUDA=ON
> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON -DKOKKOS_DIR=/project/sm77/bin/kokkos
> ../."
>
> At this point, I'm wondering if the problem could be related to how I
> installed Kokkos. This is the command to generate the Makefile for Kokkos
> and the installation went good, but at this point, I really don't know.
>
> "cmake -DCMAKE_CXX_COMPILER=/project/sm77/kokkos/bin/nvcc_wrapper
> -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/kokkos
> -DCMAKE_CXX_FLAGS=-arch=sm_60 -DKokkos_ENABLE_CUDA_LAMBDA=ON
> -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL60=ON ../."
>
> Best,
>
> Giuseppe
>
> Il giorno mercoledì 19 luglio 2023 alle 15:09:28 UTC+2
> bruno.t...@gmail.com ha scritto:
>
>> Giuseppe,
>>
>> Your configuration line looks good. I use the same but I also export
>> OMPI_CXX=/path/kokkos/bin/nvcc_wrapper
>>
>> Best,
>>
>> Bruno
>>
>> On Wednesday, July 19, 2023 at 4:38:07 AM UTC-4 gius...@gmail.com
>> wrote:
>>
>> Hello everyone,
>> I'm writing this post because I'm having some issues to compile the
>> latest release. I would need a version which supports CUDA and MPI being
>> CUDA-aware. Hence, I installed Kokkos using the flags
>> -DKokkos_ENABLE_CUDA=ON and -DKokkos_ENABLE_CUDA_LAMBDA=ON. Then, I tried
>> to build the Makefile specifying as CXX compiler the 'nvcc_wrapper' in
>> Kokkos, namely using -DCMAKE_CXX_COMPILER=/path/kokkos/bin/nvcc_wrapper 
>> and
>> using the flags -DDEAL_II_WITH_MPI=ON, -DDEAL_II_WITH_CUDA=ON,
>> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON, -DKOKKOS_DIR=${Kokkos_dir}, but I 
>> get
>> an error in finding MPI
>>
>> [image: error_compilation_9_5.png]
>> I also tried to specify the compiler I have always used with the
>> previous version via -DMPI_CXX_COMPILER flag, but I get the same error. 
>> Did
>> someone encounter the same issue? Am I supposed to use 'nvcc_wrapper' 
>> also
>> for MPI?
>>
>> Thanks in advance.
>>
>> Best,
>>
>> Giuseppe
>>
>> --
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/7VthT7AeI4Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/d4717449-8c4a-48d2-b0eb-c56a4381f631n%40googlegroups.com
> 
> .
>
 --
>>> The deal.II project is located at http://www.dealii.org/
>>> For mailing list/forum options, see
>>> 

Re: [deal.II] Q: Question about extracting part of a vector

2023-07-20 Thread Daniel Arndt
Najwa,

the relevant code reads something like

  const unsigned int n_components = dof.get_fe(0).n_components();
  AssertDimension(exact_solution.n_components, n_components);
  if (weight != nullptr)
{
  Assert((weight->n_components == 1) ||
   (weight->n_components == n_components),
 ExcDimensionMismatch(weight->n_components, n_components));
}

which means that your exact solution still needs to have as many components
as the FiniteElement object used (and the number of components for
ComponentSelectFunction must also match that).
ComponentSelectFunction then makes sure that all other components are
ignored when computing the error.

Best,
Daniel

On Thu, Jul 20, 2023 at 6:15 AM Najwa Alshehri 
wrote:

> Hello again,
>
> I have a follow-up question. Does this ComponentSelectFunction work also
> with vectors that are not written as blocked vectors? I have applied it
> before when I was dealing with blocked vectors and it worked perfectly.
>
> So, I did this,
> const ComponentSelectFunction primal_mask(0,2);
> Later,
> VectorTools::integrate_difference(omega2_dh,
> u_omega2,
> ExactSolution2(),
> cellwise_errors2,
> quadrature,
> VectorTools::L2_norm
> ,_mask);
> const double u2_l2_error =
> VectorTools::compute_global_error(triangulation_omega2,
> cellwise_errors2,
> VectorTools::L2_norm);
>
> And I got the following error!!
> An error occurred in line <455> of file
> <../include/deal.II/numerics/vector_tools_integrate_difference.templates.h>
> in function
> void dealii::VectorTools::internal::do_integrate_difference(const
> dealii::hp::MappingCollection&, const
> dealii::DoFHandler&, const InVector&, const
> dealii::Function&, OutVector&,
> const dealii::hp::QCollection&, const dealii::VectorTools::NormType&,
> const dealii::Function*, double) [with int dim = 2; int spacedim
> = 2; InVector = dealii::Vector; OutVector = dealii::Vector;
> typename InVector::value_type = double]
> The violated condition was:
>
> ::dealii::deal_II_exceptions::internals::compare_for_equality(exact_solution.n_components,
> n_components)
> Additional information:
> Dimension 1 not equal to 2.
>
>  Obviously, we have dimensionality mismatching between u_omega2 and the
> exact solution. which means that the mask is not really picking up the
> first component of the solution u_omega2.  Do you have any suggestions to
> fix this issue?
>
> Appreciate your help,
> Najwa
> On Thursday, July 20, 2023 at 11:48:04 AM UTC+3 Najwa Alshehri wrote:
>
>> Thank you Daniel for the clear quick answer. I will follow it.
>>
>> Best,
>> Najwa
>>
>> On Wednesday, July 19, 2023 at 5:16:14 PM UTC+3 d.arnd...@gmail.com
>> wrote:
>>
>>> Najwa,
>>>
>>> The documentation of VectorTools::integrate_difference(
>>> https://www.dealii.org/current/doxygen/deal.II/namespaceVectorTools.html#a676190d2c897ac5da68a9c460fa95832)
>>> says
>>>
>>>
>>> The additional argument weight allows to evaluate weighted norms. The
>>> weight function may be scalar, establishing a spatially variable weight in
>>> the domain for all components equally. This may be used, for instance, to
>>> only integrate over parts of the domain. The weight function may also be
>>> vector-valued, with as many components as the finite element: Then,
>>> different components get different weights. A typical application is when
>>> the error with respect to only one or a subset of the solution variables is
>>> to be computed, in which case the other components would have weight values
>>> equal to zero. The ComponentSelectFunction
>>> 
>>> class is particularly useful for this purpose as it provides such a "mask"
>>> weight. The weight function is expected to be positive, but negative values
>>> are not filtered. The default value of this function, a null pointer, is
>>> interpreted as "no weighting function", i.e., weight=1 in the whole domain
>>> for all vector components uniformly.
>>>
>>> Best,
>>> Daniel
>>>
>>> On Wed, Jul 19, 2023 at 8:01 AM Najwa Alshehri 
>>> wrote:
>>>
 Dear group members,

 I have one question,

 I am trying to calculate the L2 norm of the error of a solution. In
 particular, I have a *vector of the solution* u_omega and a *FeSystem*
 with two fes.

 I am interested in computing the L2 norm of the error related to the
 first fe using *integrate_difference * function. (Note here u_omega is *not
 a blocked vector*, however, it has two solutions stacked together in
 one vector). Can I extract the solution of the first part from u_omega?



 Thank you in advance for your help.

 Best,

 Najwa

 --
 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

Re: [deal.II] Re: Compilation deal.II 9.5

2023-07-20 Thread Bruno Turcksin
Giuseppe,

CMake should create an error log. Can you post it?

Best,

Bruno

Le jeu. 20 juil. 2023 à 04:51, giuseppe orlando  a
écrit :

> Dear Bruno,
> I tried to reinstall Kokkos removing the -DCMAKE_CXX_FLAGS option, but I
> get the same error during the creation of the Makefile for deal.II. I will
> try to figure out which might be the problem in the follwing days.
>
> Best,
>
> Giuseppe
>
> Il giorno mercoledì 19 luglio 2023 alle 19:36:53 UTC+2
> bruno.t...@gmail.com ha scritto:
>
>> Giuseppe,
>>
>> I think the issue is because you set -DCMAKE_CXX_FLAGS=-arch=sm_60 when
>> compiling Kokkos. This is not necessary because Kokkos takes care of that
>> when you use -DKokkos_ARCH_PASCAL60=ON. Since you set that as a CXX flags
>> it might be passed to MPI when it shouldn't. The rest looks good.
>>
>> Best,
>>
>> Bruno
>>
>>
>> Le mer. 19 juil. 2023 à 13:29, giuseppe orlando  a
>> écrit :
>>
>>> Dear Bruno,
>>> thanks for the suggestion. I tried to follow it, but I still the get
>>> same error during the creation of the Makefile. Just to sum up I typed
>>> "export OMPI_CXX=/project/sm77/bin/kokkos/bin/nvcc_wrapper"
>>> "cmake -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/dealII/9.5.1/
>>> -DCMAKE_CXX_COMPILER=/project/sm77/bin/kokkos/bin/nvcc_wrapper
>>> -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=/project/sm77/bin/p4est/
>>> -DDEAL_II_WITH_MPI=ON -DDEAL_II_WITH_CUDA=ON
>>> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON -DKOKKOS_DIR=/project/sm77/bin/kokkos
>>> ../."
>>>
>>> At this point, I'm wondering if the problem could be related to how I
>>> installed Kokkos. This is the command to generate the Makefile for Kokkos
>>> and the installation went good, but at this point, I really don't know.
>>>
>>> "cmake -DCMAKE_CXX_COMPILER=/project/sm77/kokkos/bin/nvcc_wrapper
>>> -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/kokkos
>>> -DCMAKE_CXX_FLAGS=-arch=sm_60 -DKokkos_ENABLE_CUDA_LAMBDA=ON
>>> -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL60=ON ../."
>>>
>>> Best,
>>>
>>> Giuseppe
>>>
>>> Il giorno mercoledì 19 luglio 2023 alle 15:09:28 UTC+2
>>> bruno.t...@gmail.com ha scritto:
>>>
 Giuseppe,

 Your configuration line looks good. I use the same but I also export
 OMPI_CXX=/path/kokkos/bin/nvcc_wrapper

 Best,

 Bruno

 On Wednesday, July 19, 2023 at 4:38:07 AM UTC-4 gius...@gmail.com
 wrote:

 Hello everyone,
 I'm writing this post because I'm having some issues to compile the
 latest release. I would need a version which supports CUDA and MPI being
 CUDA-aware. Hence, I installed Kokkos using the flags
 -DKokkos_ENABLE_CUDA=ON and -DKokkos_ENABLE_CUDA_LAMBDA=ON. Then, I tried
 to build the Makefile specifying as CXX compiler the 'nvcc_wrapper' in
 Kokkos, namely using -DCMAKE_CXX_COMPILER=/path/kokkos/bin/nvcc_wrapper and
 using the flags -DDEAL_II_WITH_MPI=ON, -DDEAL_II_WITH_CUDA=ON,
 -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON, -DKOKKOS_DIR=${Kokkos_dir}, but I get
 an error in finding MPI

 [image: error_compilation_9_5.png]
 I also tried to specify the compiler I have always used with the
 previous version via -DMPI_CXX_COMPILER flag, but I get the same error. Did
 someone encounter the same issue? Am I supposed to use 'nvcc_wrapper' also
 for MPI?

 Thanks in advance.

 Best,

 Giuseppe

 --
>>> 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 a topic in the
>>> Google Groups "deal.II User Group" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/dealii/7VthT7AeI4Q/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> dealii+un...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/dealii/d4717449-8c4a-48d2-b0eb-c56a4381f631n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/7VthT7AeI4Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/eb8caa99-28b8-455b-ad67-eac3e348931en%40googlegroups.com
> 
> .
>

-- 
The deal.II project is located at http://www.dealii.org/
For 

Re: [deal.II] point_value for a vector-valued Problem / FESystem

2023-07-20 Thread Simon Sticko

Hi.

There are several point_value functions. Right now, you are calling one that 
only works for scalar elements:

https://www.dealii.org/current/doxygen/deal.II/namespaceVectorTools.html#a7be5c7eed52308898dfaad91c4cff204

You need to call the more general function:

https://www.dealii.org/current/doxygen/deal.II/namespaceVectorTools.html#acd358e9b110ccbf4a7f76796d206b9c7

by passing a vector with each components value as the last argument to the 
function:

Vector value(n_solution_components);
VectorTools::point_value(dof_handler,
 solution,
 point,
 value);

Best,
Simon

On 20/07/2023 12:54, 'Jost Arndt' via deal.II User Group wrote:

Dear everyone,

I have trouble understanding in how to evaluate a solution at a given point 
correctly.
Described in Step-3 for example the function point_value is used to evaluate 
the solution at (0.3, 0.3), and I want to do something quite similar.
However, my solution is vector valued (i.e. I use FESystem ), and I get the 
following error message

 >>An error occurred in line <181> of file 
<./include/deal.II/numerics/vector_tools_point_value.templates.h> in function
     typename VectorType::value_type dealii::VectorTools::point_value(const dealii::Mapping&, const dealii::DoFHandler&, const VectorType&, const 
dealii::Point&) [with int dim =
2; VectorType = dealii::Vector; int spacedim = 2; typename 
VectorType::value_type = double]
The violated condition was:
     dof.get_fe(0).n_components() == 1
Additional information:
     Finite element is not scalar as is necessary for this function


However in the documentation it says "Evaluate a possibly vector-valued finite element 
function defined by the given DoFHandler 
 and nodal vector 
fe_function at the given point point". So I am curious how to evaluate my solution at a 
few fixed points? Did I miss something?

Performance-wise it does not have to be perfect at all, as I want to evaluate 
only ~400 points on a few hundered solutions (time-steps).

Best,

Jost

--
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+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/7e2a3e13-aef1-4a0e-a357-8dafc3bdf958n%40googlegroups.com
 
.


--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/229072fe-6f09-1470-35b6-ee34ddc308fd%40gmail.com.


[deal.II] point_value for a vector-valued Problem / FESystem

2023-07-20 Thread 'Jost Arndt' via deal.II User Group
Dear everyone,

I have trouble understanding in how to evaluate a solution at a given point 
correctly.
Described in Step-3 for example the function point_value is used to 
evaluate the solution at (0.3, 0.3), and I want to do something quite 
similar.
However, my solution is vector valued (i.e. I use FESystem ), and I get the 
following error message

>>An error occurred in line <181> of file 
<./include/deal.II/numerics/vector_tools_point_value.templates.h> in 
function   
 
typename VectorType::value_type dealii::VectorTools::point_value(const 
dealii::Mapping&, const dealii::DoFHandler&, 
const VectorType&, const dealii::Point&) [with int dim = 
2; VectorType = dealii::Vector; int spacedim = 2; typename 
VectorType::value_type = double]   
   
The violated condition was: 

 
dof.get_fe(0).n_components() == 1   

 
Additional information: 

 
Finite element is not scalar as is necessary for this function


However in the documentation it says "Evaluate a possibly vector-valued 
finite element function defined by the given DoFHandler 
 and 
nodal vector fe_function at the given point point". So I am curious how to 
evaluate my solution at a few fixed points? Did I miss something? 

Performance-wise it does not have to be perfect at all, as I want to 
evaluate only ~400 points on a few hundered solutions (time-steps). 

Best,

Jost

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/7e2a3e13-aef1-4a0e-a357-8dafc3bdf958n%40googlegroups.com.


[deal.II] Re: Error evaluating derivative of abs() function using symbolic differentiation

2023-07-20 Thread Vinayak Vijay
Thanks, I'll implement the function in a different way then.

Regards
Vinayak

On Monday, July 17, 2023 at 6:26:17 PM UTC+5:30 bruno.t...@gmail.com wrote:

> Vinayak,
>
> The error is pretty explicit, the function is not implemented in 
> SymEngine. Maybe it is fixed in a newer version of SymEngine. If it is not, 
> you will need to change the formulation of your equation.
>
> Best,
>
> Bruno
>
> On Monday, July 17, 2023 at 3:51:24 AM UTC-4 vinay...@gmail.com wrote:
>
>> Hello,
>>
>> I am trying to differentiate and then evaluate a function with abs(). As 
>> a simple example, consider the function to be f(x) = abs(x). I use the 
>> following code to first define the symbolic function and then try to 
>> evaluate its derivative:
>>
>>double x = -2;
>> Differentiation::SD::Expression x_sd("x");
>> const Differentiation::SD::types::substitution_map substitution_map =
>> Differentiation::SD::make_substitution_map(
>> std::pair{x_sd, x});
>> std::cout << "Evaluate f(x) at x = " << x << std::endl;
>> Differentiation::SD::Expression f = abs(x_sd);
>> std::cout << "Function f(x)= " << f << std::endl;
>> const double computed_f =
>> f.substitute_and_evaluate(substitution_map);
>> std::cout << "Computed Function f(x)= " << computed_f << std::endl;
>>
>> Differentiation::SD::Expression df_dx_sd = f.differentiate(x_sd);
>> std::cout << "Derivative of f: " << df_dx_sd << std::endl;
>> const double computed_df_dx =
>> df_dx_sd.substitute_and_evaluate(substitution_map);
>>
>> std::cout << "Computed df_dx: " << computed_df_dx << std::endl;
>>
>> However, I get the output as below with an error:
>>
>> [ 91%] Built target main
>> [100%] Run main with Debug configuration
>> Evaluate f(x) at x = -2
>> Function f(x)=  abs(x)
>> Computed Function f(x)=  2
>> Derivative of f:  Derivative(abs(x), x)
>> terminate called after throwing an instance of 
>> 'SymEngine::NotImplementedError'
>>   what():  Not Implemented
>> make[3]: *** [CMakeFiles/run.dir/build.make:71: CMakeFiles/run] Aborted 
>> (core dumped)
>> make[2]: *** [CMakeFiles/Makefile2:116: CMakeFiles/run.dir/all] Error 2
>> make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/run.dir/rule] Error 2
>> make: *** [Makefile:137: run] Error 2
>>
>> Can someone help me with the issue here?
>>
>> Thanks
>> Vinayak
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6b179669-a315-47bb-9886-bdb4cea25709n%40googlegroups.com.


Re: [deal.II] Q: Question about extracting part of a vector

2023-07-20 Thread Najwa Alshehri
Hello again,

I have a follow-up question. Does this ComponentSelectFunction work also 
with vectors that are not written as blocked vectors? I have applied it 
before when I was dealing with blocked vectors and it worked perfectly. 

So, I did this, 
const ComponentSelectFunction primal_mask(0,2);
Later,
VectorTools::integrate_difference(omega2_dh,
u_omega2,
ExactSolution2(),
cellwise_errors2,
quadrature,
VectorTools::L2_norm
,_mask);
const double u2_l2_error =
VectorTools::compute_global_error(triangulation_omega2,
cellwise_errors2,
VectorTools::L2_norm);

And I got the following error!!
An error occurred in line <455> of file 
<../include/deal.II/numerics/vector_tools_integrate_difference.templates.h> 
in function
void dealii::VectorTools::internal::do_integrate_difference(const 
dealii::hp::MappingCollection&, const 
dealii::DoFHandler&, const InVector&, const 
dealii::Function&, OutVector&, 
const dealii::hp::QCollection&, const dealii::VectorTools::NormType&, 
const dealii::Function*, double) [with int dim = 2; int spacedim 
= 2; InVector = dealii::Vector; OutVector = dealii::Vector; 
typename InVector::value_type = double]
The violated condition was: 

::dealii::deal_II_exceptions::internals::compare_for_equality(exact_solution.n_components,
 
n_components)
Additional information: 
Dimension 1 not equal to 2.

 Obviously, we have dimensionality mismatching between u_omega2 and the 
exact solution. which means that the mask is not really picking up the 
first component of the solution u_omega2.  Do you have any suggestions to 
fix this issue?

Appreciate your help,
Najwa
On Thursday, July 20, 2023 at 11:48:04 AM UTC+3 Najwa Alshehri wrote:

> Thank you Daniel for the clear quick answer. I will follow it.
>
> Best,
> Najwa
>
> On Wednesday, July 19, 2023 at 5:16:14 PM UTC+3 d.arnd...@gmail.com wrote:
>
>> Najwa,
>>
>> The documentation of VectorTools::integrate_difference(
>> https://www.dealii.org/current/doxygen/deal.II/namespaceVectorTools.html#a676190d2c897ac5da68a9c460fa95832)
>>  
>> says
>>
>>
>> The additional argument weight allows to evaluate weighted norms. The 
>> weight function may be scalar, establishing a spatially variable weight in 
>> the domain for all components equally. This may be used, for instance, to 
>> only integrate over parts of the domain. The weight function may also be 
>> vector-valued, with as many components as the finite element: Then, 
>> different components get different weights. A typical application is when 
>> the error with respect to only one or a subset of the solution variables is 
>> to be computed, in which case the other components would have weight values 
>> equal to zero. The ComponentSelectFunction 
>> 
>>  
>> class is particularly useful for this purpose as it provides such a "mask" 
>> weight. The weight function is expected to be positive, but negative values 
>> are not filtered. The default value of this function, a null pointer, is 
>> interpreted as "no weighting function", i.e., weight=1 in the whole domain 
>> for all vector components uniformly.
>>
>> Best,
>> Daniel
>>
>> On Wed, Jul 19, 2023 at 8:01 AM Najwa Alshehri  
>> wrote:
>>
>>> Dear group members,
>>>
>>> I have one question, 
>>>
>>> I am trying to calculate the L2 norm of the error of a solution. In 
>>> particular, I have a *vector of the solution* u_omega and a *FeSystem* 
>>> with two fes.
>>>
>>> I am interested in computing the L2 norm of the error related to the 
>>> first fe using *integrate_difference * function. (Note here u_omega is *not 
>>> a blocked vector*, however, it has two solutions stacked together in 
>>> one vector). Can I extract the solution of the first part from u_omega?
>>>
>>>
>>>
>>> Thank you in advance for your help.
>>>
>>> Best,
>>>
>>> Najwa
>>>
>>> -- 
>>> 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/9741338e-2a31-418b-815d-277a5d7cb573n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: [deal.II] Re: Compilation deal.II 9.5

2023-07-20 Thread giuseppe orlando
Dear Bruno,
I tried to reinstall Kokkos removing the -DCMAKE_CXX_FLAGS option, but I 
get the same error during the creation of the Makefile for deal.II. I will 
try to figure out which might be the problem in the follwing days.

Best,

Giuseppe 

Il giorno mercoledì 19 luglio 2023 alle 19:36:53 UTC+2 bruno.t...@gmail.com 
ha scritto:

> Giuseppe, 
>
> I think the issue is because you set -DCMAKE_CXX_FLAGS=-arch=sm_60 when 
> compiling Kokkos. This is not necessary because Kokkos takes care of that 
> when you use -DKokkos_ARCH_PASCAL60=ON. Since you set that as a CXX flags 
> it might be passed to MPI when it shouldn't. The rest looks good.
>
> Best,
>
> Bruno
>
>
> Le mer. 19 juil. 2023 à 13:29, giuseppe orlando  a 
> écrit :
>
>> Dear Bruno,
>> thanks for the suggestion. I tried to follow it, but I still the get same 
>> error during the creation of the Makefile. Just to sum up I typed
>> "export OMPI_CXX=/project/sm77/bin/kokkos/bin/nvcc_wrapper"
>> "cmake -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/dealII/9.5.1/ 
>> -DCMAKE_CXX_COMPILER=/project/sm77/bin/kokkos/bin/nvcc_wrapper 
>> -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=/project/sm77/bin/p4est/ 
>> -DDEAL_II_WITH_MPI=ON -DDEAL_II_WITH_CUDA=ON 
>> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON -DKOKKOS_DIR=/project/sm77/bin/kokkos 
>> ../."
>>
>> At this point, I'm wondering if the problem could be related to how I 
>> installed Kokkos. This is the command to generate the Makefile for Kokkos 
>> and the installation went good, but at this point, I really don't know. 
>>
>> "cmake -DCMAKE_CXX_COMPILER=/project/sm77/kokkos/bin/nvcc_wrapper 
>> -DCMAKE_INSTALL_PREFIX=/project/sm77/bin/kokkos 
>> -DCMAKE_CXX_FLAGS=-arch=sm_60 -DKokkos_ENABLE_CUDA_LAMBDA=ON 
>> -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_PASCAL60=ON ../." 
>>
>> Best,
>>
>> Giuseppe
>>
>> Il giorno mercoledì 19 luglio 2023 alle 15:09:28 UTC+2 
>> bruno.t...@gmail.com ha scritto:
>>
>>> Giuseppe,
>>>
>>> Your configuration line looks good. I use the same but I also export 
>>> OMPI_CXX=/path/kokkos/bin/nvcc_wrapper
>>>
>>> Best,
>>>
>>> Bruno
>>>
>>> On Wednesday, July 19, 2023 at 4:38:07 AM UTC-4 gius...@gmail.com wrote:
>>>
>>> Hello everyone,
>>> I'm writing this post because I'm having some issues to compile the 
>>> latest release. I would need a version which supports CUDA and MPI being 
>>> CUDA-aware. Hence, I installed Kokkos using the flags 
>>> -DKokkos_ENABLE_CUDA=ON and -DKokkos_ENABLE_CUDA_LAMBDA=ON. Then, I tried 
>>> to build the Makefile specifying as CXX compiler the 'nvcc_wrapper' in 
>>> Kokkos, namely using -DCMAKE_CXX_COMPILER=/path/kokkos/bin/nvcc_wrapper and 
>>> using the flags -DDEAL_II_WITH_MPI=ON, -DDEAL_II_WITH_CUDA=ON, 
>>> -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON, -DKOKKOS_DIR=${Kokkos_dir}, but I get 
>>> an error in finding MPI
>>>
>>> [image: error_compilation_9_5.png] 
>>> I also tried to specify the compiler I have always used with the 
>>> previous version via -DMPI_CXX_COMPILER flag, but I get the same error. Did 
>>> someone encounter the same issue? Am I supposed to use 'nvcc_wrapper' also 
>>> for MPI?
>>>
>>> Thanks in advance.
>>>
>>> Best,
>>>
>>> Giuseppe
>>>
>>> -- 
>> 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 a topic in the 
>> Google Groups "deal.II User Group" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/dealii/7VthT7AeI4Q/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> dealii+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/d4717449-8c4a-48d2-b0eb-c56a4381f631n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/eb8caa99-28b8-455b-ad67-eac3e348931en%40googlegroups.com.


Re: [deal.II] Q: Question about extracting part of a vector

2023-07-20 Thread Najwa Alshehri
Thank you Daniel for the clear quick answer. I will follow it.

Best,
Najwa

On Wednesday, July 19, 2023 at 5:16:14 PM UTC+3 d.arnd...@gmail.com wrote:

> Najwa,
>
> The documentation of VectorTools::integrate_difference(
> https://www.dealii.org/current/doxygen/deal.II/namespaceVectorTools.html#a676190d2c897ac5da68a9c460fa95832)
>  
> says
>
>
> The additional argument weight allows to evaluate weighted norms. The 
> weight function may be scalar, establishing a spatially variable weight in 
> the domain for all components equally. This may be used, for instance, to 
> only integrate over parts of the domain. The weight function may also be 
> vector-valued, with as many components as the finite element: Then, 
> different components get different weights. A typical application is when 
> the error with respect to only one or a subset of the solution variables is 
> to be computed, in which case the other components would have weight values 
> equal to zero. The ComponentSelectFunction 
> 
>  
> class is particularly useful for this purpose as it provides such a "mask" 
> weight. The weight function is expected to be positive, but negative values 
> are not filtered. The default value of this function, a null pointer, is 
> interpreted as "no weighting function", i.e., weight=1 in the whole domain 
> for all vector components uniformly.
>
> Best,
> Daniel
>
> On Wed, Jul 19, 2023 at 8:01 AM Najwa Alshehri  
> wrote:
>
>> Dear group members,
>>
>> I have one question, 
>>
>> I am trying to calculate the L2 norm of the error of a solution. In 
>> particular, I have a *vector of the solution* u_omega and a *FeSystem* 
>> with two fes.
>>
>> I am interested in computing the L2 norm of the error related to the 
>> first fe using *integrate_difference * function. (Note here u_omega is *not 
>> a blocked vector*, however, it has two solutions stacked together in one 
>> vector). Can I extract the solution of the first part from u_omega?
>>
>>
>>
>> Thank you in advance for your help.
>>
>> Best,
>>
>> Najwa
>>
>> -- 
>> 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/9741338e-2a31-418b-815d-277a5d7cb573n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3a92adbb-f16d-4ac2-89d7-3ffac4a9bf5fn%40googlegroups.com.