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 
</Users/sensei/Downloads/src/dealii-9.1.0/include/deal.II/base/smartpointer.h> 
in function
    T *dealii::SmartPointer<const dealii::SparsityPattern, 
dealii::SparseMatrix<double> >::operator->() const [T = const 
dealii::SparsityPattern, P = dealii::SparseMatrix<double>]
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.dylib            0x00000001174e003e 
_ZNK6dealii12SmartPointerIKNS_15SparsityPatternENS_12SparseMatrixIdEEEptEv 
+ 206: 2   libdeal_II.g.9.1.0.dylib            0x00000001174e003e 
_ZNK6dealii12SmartPointerIKNS_15SparsityPatternENS_12SparseMatrixIdEEEptEv 
#1  3   libdeal_II.g.9.1.0.dylib            0x000000011abc65e5 
_ZN6dealii12SparseMatrixIdEaSEd + 69: 3   libdeal_II.g.9.1.0.dylib         
   0x000000011abc65e5 _ZN6dealii12SparseMatrixIdEaSEd 
#2  4   step-31                             0x000000010ada5f3a 
_ZN6dealii17BlockSparseMatrixIdEaSEd + 90: 4   step-31                     
        0x000000010ada5f3a _ZN6dealii17BlockSparseMatrixIdEaSEd 
#3  5   step-31                             0x000000010ada0e77 
_ZN6Step3121BoussinesqFlowProblemILi2EE22assemble_stokes_systemEv + 247: 5 
  step-31                             0x000000010ada0e77 
_ZN6Step3121BoussinesqFlowProblemILi2EE22assemble_stokes_systemEv 
#4  6   step-31                             0x000000010ad944b8 
_ZN6Step3121BoussinesqFlowProblemILi2EE3runEv + 504: 6   step-31           
                  0x000000010ad944b8 
_ZN6Step3121BoussinesqFlowProblemILi2EE3runEv 
#5  7   step-31                             0x000000010ad93ebd main + 125: 
7   step-31                             0x000000010ad93ebd main 
#6  8   libdyld.dylib                       0x00007fff6bbd93d5 start + 1: 8 
  libdyld.dylib                       0x00007fff6bbd93d5 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 [email protected].
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.

Reply via email to