[deal.II] Re: get_function_values giving different results depending on the number of MPI ranks

2022-01-28 Thread Lucas Myers
Whoops, this one was indeed a silly error! The problem had nothing to do 
with the `get_function_values` function. Rather, it only showed up there 
because that is the only place that I use ghost elements. These weren't 
being updated because (as clearly stated in the ghost vector documentation 
)
 
one should not write to a ghosted vector, except by a copy assignment from 
a completely distributed (non-ghost) vector. I fixed the problem by copying 
the `locally_relevant_solution` vector into a 
`completely_distributed_solution` vector, adding the update there, and then 
copying back over to the `locally_relevant_solution` vector.

As an aside, is there a way to throw a warning/error if one tries to write 
to a ghosted vector with anything except a completely distributed vector? 
If possible, it might save someone some frustration...

In any case, so sorry for all the spam.

Kind regards,
Lucas

On Wednesday, January 26, 2022 at 4:31:21 PM UTC-6 Lucas Myers wrote:

> Hi everyone,
>
> I've been trying to write a parallel distributed solution to a nonlinear 
> PDE using Newton's method. It runs fine on one rank, but when I use two the 
> solver fails to converge on the second iteration. I've tracked the 
> difference (between one rank and two) down to the `get_function_values` 
> function evaluating the previous solution at quadrature points differently. 
> This seems to happen only near the boundaries of regions owned by different 
> ranks. I figure this is some sort of synchronization error, but I cannot 
> figure out how to fix it. I believe that I am calling `compress` when is 
> necessary, and call `update_ghost_values` prior to calling 
> `get_function_values`. However, I am still getting the difference.
>
> To help with debugging, I've tried to write a program which mimics the 
> behavior in as few lines as possible (~150 with comments and whitespace). I 
> attach it here in case it helps identify my (hopefully silly) error. 
>
> Any help is much appreciated.
>
> Kind regards,
> Lucas
>

-- 
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/8731f7ac-aa73-451d-8212-df4b6f43fd30n%40googlegroups.com.


Re: [deal.II] Re: Cannot find the header files when compiling with WSL Linux distributive in VS code

2022-01-28 Thread Jiang Hu
Hi Raghunandan,

what is PPA? I am trying to set up in vscode, would like to know.

Thanks

Martin


On Mon, 17 Jan 2022 at 00:21, Raghunandan Pratoori  wrote:

> Hi,
>
> I use VS Code with WSL. I followed the instructions on these 2 pages and
> was able to get it to work -
> https://code.visualstudio.com/docs/cpp/config-wsl
> https://code.visualstudio.com/docs/cpp/cmake-linux
>
> Also, how did you install deal.ii in wsl? I used the PPA and it took care
> of all the paths to be added.
>
> Best,
> Raghunandan.
>
>
>
> On Sunday, January 16, 2022 at 2:13:26 AM UTC-6 keassyguang wrote:
>
>> Hi, everyone. I'm interested in deal.ii, but I did have trouble
>> configuring the deal.ii.
>>
>> I am trying to compile the program for Linux in VS code (version 1.63.2)
>> using WSL (Windows Subsystem for Linux) ubuntu 20.04.3. I successfully
>> compile the "Hello, World!" program, but when I try to compile the tutorial
>> programs shown in dell.ii documentation, such as the step-1, the
>> compilation terminated with an error message "No such file or directory".
>> Then, the system includePath in VS code has been set to "/usr/include/**"
>> and other libs as shown in the below figures, however, it dosenot work.
>>
>> [image: 1.png][image: 2.png]
>>
>> Later, I manually edit some head files. For example, as shown in the
>> below figure, I know the "Kokkos_MasterLock.hpp" file is in the directory
>> of "/usr/include/trilinos", so I modified the 55th line of
>> "Kokkos_Core_fwd.hpp" file by adding the "trilions" directory into the path
>> "#include " (the original is "#include
>> "). After that, the compiler can find the
>> "Kokkos_MasterLock.hpp" file, however, the compilation terminated with
>> another new file named "Kokkos_Macros.hpp". Truly, I can edit the path as
>> the aforementioned method, it is impossible to edit all the files using
>> this way. So, can someone tell me how to compile the program for Linux in
>> VS code using WSL? It will be of great help to me.
>>
>> [image: 3.png][image: 4.png][image: 5.png]
>>
> --
> 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/48537997-41c2-41b5-a260-18e7f320aef5n%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/CA%2BFpyQFbXHmbXAbCzbxSfFPVuWp4ke88m8WuHrA8rJekCpcHyg%40mail.gmail.com.


Re: [deal.II] Finding gradient of divergence over divergence normal

2022-01-28 Thread Wolfgang Bangerth

On 1/28/22 15:04, shahab.g...@gmail.com wrote:
Thank you for your answer. Yes, I want to evaluate the quantity at 
quadrature points. This is a source term (Continuum Surface Force) that 
should be added to the (Navier-Stokes) equations.


Then you will multiply it by a test function, and you should integrate 
it by parts.


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
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/eedb31b1-91a3-4b8d-80b8-556f97ad7464%40colostate.edu.


Re: [deal.II] Finding gradient of divergence over divergence normal

2022-01-28 Thread shahab.g...@gmail.com
Thank you for your answer. Yes, I want to evaluate the quantity at 
quadrature points. This is a source term (Continuum Surface Force) that 
should be added to the (Navier-Stokes) equations. 

On Friday, January 28, 2022 at 3:04:14 PM UTC-5 Wolfgang Bangerth wrote:

> On 1/28/22 7:56 AM, shahab.g...@gmail.com wrote:
> > 
> > I am looking for a way to obtain the distribution of ∇.(∇C/|∇C|) where C 
> is 
> > the main variable and I have its distribution (values, gradients and 
> > laplacians) over the domain. This is used for finding the normal vector 
> and 
> > its divergence over the moving interface of two materials in a 
> simulation. I 
> > would appreciate any suggestions you might have.
>
> When you say "obtain the distribution of ..." do you mean that you want to 
> evaluate that quantity at individual (quadrature) points? Or what do you 
> want 
> to do with it?
>
> The quantity you are looking at is not well defined for the usual finite 
> elements: grad C is a disontinuous function, and taking the divergence is 
> going to exacerbate the problems with this expression. The question 
> therefore 
> is what you want to do with it. A common approach is to use it in a weak 
> formulation where you can integrate by parts to get rid of the divergence.
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
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/b3e7b312-e438-49ee-a049-09a68f9ffdb8n%40googlegroups.com.


Re: [deal.II] Finding gradient of divergence over divergence normal

2022-01-28 Thread Wolfgang Bangerth

On 1/28/22 7:56 AM, shahab.g...@gmail.com wrote:


I am looking for a way to obtain the distribution of ∇.(∇C/|∇C|) where C is 
the main variable and I have its distribution (values, gradients and 
laplacians) over the domain. This is used for finding the normal vector and 
its divergence over the moving interface of two materials in a simulation. I 
would appreciate any suggestions you might have.


When you say "obtain the distribution of ..." do you mean that you want to 
evaluate that quantity at individual (quadrature) points? Or what do you want 
to do with it?


The quantity you are looking at is not well defined for the usual finite 
elements: grad C is a disontinuous function, and taking the divergence is 
going to exacerbate the problems with this expression. The question therefore 
is what you want to do with it. A common approach is to use it in a weak 
formulation where you can integrate by parts to get rid of the divergence.


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
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/8ea094c2-025a-1062-c2fa-10cca67bc183%40colostate.edu.


[deal.II] Finding gradient of divergence over divergence normal

2022-01-28 Thread shahab.g...@gmail.com
Dear all,

I am looking for a way to obtain the distribution of ∇.(∇C/|∇C|) where C is 
the main variable and I have its distribution (values, gradients and 
laplacians) over the domain. This is used for finding the normal vector and 
its divergence over the moving interface of two materials in a simulation. I 
would appreciate any suggestions you might have.

Regards,
Shahab

-- 
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/270cac7e-7272-4d08-bf74-820e01566321n%40googlegroups.com.