Re: [deal.II] Re: Issue regarding higher order element

2019-07-18 Thread Krishanu Sen
Thanks a lot Bruno. I did find the issue following your suggestion!

On Tuesday, 16 July 2019 15:10:40 UTC-5, Bruno Turcksin wrote:
>
> Krishanu 
>
> Le mar. 16 juil. 2019 à 16:00, Krishanu Sen  > a écrit : 
> > 
> > I am using deal.ii for a nonlinear elasticity problem. And the change in 
> the code that is causing this error message is: 
> > 
> > 
> >  template  
> >   ElasticProblem::ElasticProblem () 
> > : 
> > dof_handler (triangulation), 
> > fe (FE_Q(3), dim) 
> >   {} 
> No it's not where the error comes from. It is from somewhere in 
> Step8::ElasticProblem<1>::assemble_system_matrix() You need to find 
> which line produces the error. 
>
> Best, 
>
> Bruno 
>

-- 
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/4bd717a4-738b-4c8b-a1da-b95d2042eb96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Issue regarding higher order element

2019-07-18 Thread Krishanu Sen
Thanks Prof. Bangerth for the suggestion. I will definitely learn about the 
debugger as it seems like a great tool.

Thanks,
Krishanu

On Thursday, 18 July 2019 03:42:54 UTC-5, Wolfga ng Bangerth wrote:
>
> On 7/16/19 2:10 PM, Bruno Turcksin wrote: 
> > No it's not where the error comes from. It is from somewhere in 
> > Step8::ElasticProblem<1>::assemble_system_matrix() You need to find 
> > which line produces the error. 
>
> Krishanu, 
> indeed, Bruno knows this because he is looking at the backtrace shown in 
> the 
> error message you posted: 
>
> #0  ./nodal_growth_dyn_full: 
> Step8::ElasticProblem<1>::assemble_system_matrix() 
> #1  ./nodal_growth_dyn_full: Step8::ElasticProblem<1>::run() 
> #2  ./nodal_growth_dyn_full: main 
>
> The easiest way to find these errors is to run the program in a debugger. 
> It 
> will stop in exactly the place where the problem is, and allow you to 
> inspect 
> all local variables. It's a tool so worth learning how to use! (There are 
> also 
> video lectures showing how to do that in eclipse.) 
>
> 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/102a6b2e-50cc-4d09-86b4-a3195fbf6c06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Porting tutorials to PETSc from Trilinos

2019-07-18 Thread Bruno Turcksin
Franco,

Le jeu. 18 juil. 2019 à 10:27, Franco Milicchio
 a écrit :
> Thanks for your answer. By the way, would a wrapper for the Eigen library be 
> appealing to anyone?
I am sure it would be useful!

> 
> An error occurred in line <382> of file 
> 
>  in function
> T *dealii::SmartPointer dealii::SparseMatrix >::operator->() const [T = const 
> dealii::SparsityPattern, P = dealii::SparseMatrix]
> The violated condition was:
> pointed_to_object_is_alive
> Additional information:
> The object pointed to is not valid anymore.

It looks like the sparsity pattern does not exist anymore. The matrix
object does not keep a copy of the sparsity pattern, so the sparsity
pattern needs to exist as long as the matrix that uses it is alive.

Best,

Bruno

-- 
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/CAGVt9eNGQNQt9qe389vk8ZWm2e02z_T8_cQ53_d%2B5KQ9%3DdX-jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Porting tutorials to PETSc from Trilinos

2019-07-18 Thread Franco Milicchio
Thanks for your answer. By the way, would a wrapper for the Eigen library 
be appealing to anyone?

And back to my lowly question :)

I was able to port the Step 31 code to plain deal.II without PETSc, but I 
have an error at runtime. At the moment I removed the preconditioners and 
just used a PreconditionIdentity to make it compile and link, I will deal 
with the right preconditioner later.

Apparently I have initialized something wrong, as the assignment to the 
matrix

if (rebuild_stokes_matrix == true)
  stokes_matrix = 0;

makes the program die. 

Number of active cells: 256 (on 5 levels)
Number of degrees of freedom: 3556 (n_u 2178 + n_p 289 + n_T 1089)

Timestep 0:  t=0
   Assembling...stokes_matrix 2467 x 2467 blocks 2 x 2


An error occurred in line <382> of file 
 
in function
T *dealii::SmartPointer >::operator->() const [T = const 
dealii::SparsityPattern, P = dealii::SparseMatrix]
The violated condition was: 
pointed_to_object_is_alive
Additional information: 
The object pointed to is not valid anymore.

Stacktrace:
---
#0  2   libdeal_II.g.9.1.0.dylib0x0001174e003e 
_ZNK6dealii12SmartPointerIKNS_15SparsityPatternENS_12SparseMatrixIdEEEptEv 
+ 206: 2   libdeal_II.g.9.1.0.dylib0x0001174e003e 
_ZNK6dealii12SmartPointerIKNS_15SparsityPatternENS_12SparseMatrixIdEEEptEv 
#1  3   libdeal_II.g.9.1.0.dylib0x00011abc65e5 
_ZN6dealii12SparseMatrixIdEaSEd + 69: 3   libdeal_II.g.9.1.0.dylib 
   0x00011abc65e5 _ZN6dealii12SparseMatrixIdEaSEd 
#2  4   step-31 0x00010ada5f3a 
_ZN6dealii17BlockSparseMatrixIdEaSEd + 90: 4   step-31 
0x00010ada5f3a _ZN6dealii17BlockSparseMatrixIdEaSEd 
#3  5   step-31 0x00010ada0e77 
_ZN6Step3121BoussinesqFlowProblemILi2EE22assemble_stokes_systemEv + 247: 5 
  step-31 0x00010ada0e77 
_ZN6Step3121BoussinesqFlowProblemILi2EE22assemble_stokes_systemEv 
#4  6   step-31 0x00010ad944b8 
_ZN6Step3121BoussinesqFlowProblemILi2EE3runEv + 504: 6   step-31   
  0x00010ad944b8 
_ZN6Step3121BoussinesqFlowProblemILi2EE3runEv 
#5  7   step-31 0x00010ad93ebd main + 125: 
7   step-31 0x00010ad93ebd main 
#6  8   libdyld.dylib   0x7fff6bbd93d5 start + 1: 8 
  libdyld.dylib   0x7fff6bbd93d5 start 



I have checked the sizes as you can see, and they seem to be properly 
initialized. So my guess is that I am doing something wrong with sparsity 
patterns, but I don't know how:

  BlockSparsityPattern sp(2, 2);
  sp.copy_from(dsp);
  stokes_matrix.reinit(sp); //stokes_matrix.reinit(dsp);
  // ...
  SparsityPattern sp(n_T, n_T);
  sp.copy_from(dsp);
  temperature_matrix.reinit(sp); //temperature_matrix.reinit(dsp);
  temperature_mass_matrix.reinit(sp); 
//temperature_mass_matrix.reinit(temperature_matrix);
  temperature_stiffness_matrix.reinit(sp); 
//temperature_stiffness_matrix.reinit(temperature_matrix);

The code I've modified is available in full here: 
https://gist.github.com/fmilicchio/2dac430d7c071f98b4f66d79d2101b04

Any hints?

Thank you very much for your help!
Franco

-- 
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/49a9517b-cb68-4dfd-96fb-0e1ed53ec1e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Setting up system matrix fails

2019-07-18 Thread Wolfgang Bangerth
On 7/18/19 3:41 AM, Gabriel Peters wrote:
> 
> Thanks a lot for the hint, now I found an error in my coupling for the 
> make_sparsity_pattern function.
> So indeed the space was not allocated.

Great, glad to help. It's easier to point people at the likely problem once 
you've made every mistake yourself once (or even more often than that)... ;-)

Cheers
  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/d801189d-d676-f9c8-6a83-9e5d00f12e7d%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Setting up system matrix fails

2019-07-18 Thread Gabriel Peters


Am Donnerstag, 18. Juli 2019 10:52:46 UTC+2 schrieb Wolfgang Bangerth:
>
> On 7/9/19 9:01 AM, Gabriel Peters wrote: 
> > 
> > After some debugging I found out that the term /(-1)* 
> sol_p[i]*div_sol_u[j]/ 
> > makes this trouble. Can somebody tell me why? 
>
> My suspicion would be that you are writing into an element of the matrix 
> for 
> which you have not allocated space in the sparsity pattern. Could that be 
> the 
> case? 
>
> Thanks a lot for the hint, now I found an error in my coupling for the 
make_sparsity_pattern function.
So indeed the space was not allocated.
Thanks a lot

Gabriel

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/1b940cdf-8252-49c8-8b0a-f59faa2b73dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Setting up system matrix fails

2019-07-18 Thread Wolfgang Bangerth
On 7/9/19 9:01 AM, Gabriel Peters wrote:
> 
> After some debugging I found out that the term /(-1)* sol_p[i]*div_sol_u[j]/ 
> makes this trouble. Can somebody tell me why?

My suspicion would be that you are writing into an element of the matrix for 
which you have not allocated space in the sparsity pattern. Could that be the 
case?

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/835a0843-815a-28fc-b976-43e209af3ebc%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] How to set material id with MPI

2019-07-18 Thread Wolfgang Bangerth
On 7/17/19 7:46 PM, Phạm Ngọc Kiên wrote:
> I am trying to write codes to find a subset of cells that I want to set their 
> material id.
> The codes run well with 1 processor.
> However, when testing with more than 1 processor, the codes did wrong things.
> This is because each processor only owns a subset of cells with distributed 
> triangulation.
> Do we have a way to address this issue in deal.II?

In addition to Daniel's questions, take a look at the documentation of the 
parallel::distributed::Triangulation class documentation. It talks about 
similar issues with boundary ids. I would imagine that setting material ids 
poses similar challenges, and has similar solutions.

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/9afe5b13-a5db-ba22-81d1-acd9eb952d7d%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Issue regarding higher order element

2019-07-18 Thread Wolfgang Bangerth
On 7/16/19 2:10 PM, Bruno Turcksin wrote:
> No it's not where the error comes from. It is from somewhere in
> Step8::ElasticProblem<1>::assemble_system_matrix() You need to find
> which line produces the error.

Krishanu,
indeed, Bruno knows this because he is looking at the backtrace shown in the 
error message you posted:

#0  ./nodal_growth_dyn_full: Step8::ElasticProblem<1>::assemble_system_matrix()
#1  ./nodal_growth_dyn_full: Step8::ElasticProblem<1>::run()
#2  ./nodal_growth_dyn_full: main

The easiest way to find these errors is to run the program in a debugger. It 
will stop in exactly the place where the problem is, and allow you to inspect 
all local variables. It's a tool so worth learning how to use! (There are also 
video lectures showing how to do that in eclipse.)

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/165fa819-3baf-0faf-cabc-5206b54fb1bf%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.