[deal.II] Problem with Adaptive mesh refinement for NavierStokesProjection (Step-35)

2019-01-28 Thread gabriel . peters
Hi everyone, 
I am trying to implement an adaptive mesh refinement scheme for the Step-35 
examle program.
I implemented the mesh-refinement acording to the Step-26 tutorial.

So I proceeded in the refine_mesh function as follows:
1. Create a Solution_Transfer object for each Vector;
2. prepare refinement_and_coarsing; (here I also made a hangiing node 
constraint)
3. execute_ref_and_coars;
4. create_triangulation_and_dofs;
5. Interpolate_solution for each Solution_transfer vector;
6. finally distribute_constraints;

But the problem is, that after one mesh-refinement step the time-step 
solving of the Navierstokesprojection (in Step-35 it is in diffusion_step())
diverges. And I don't see why. Does anyone have an idea?

First I thought that I used the Boundary conditions in a wrong way during 
te refinement step,
 but the problem also comes up when I apply zero Boundary values on the 
whole domain for
the velocity u.

Tanks for your help.

Best regards 
Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-04-02 Thread gabriel . peters


Am Dienstag, 2. April 2019 01:48:41 UTC+2 schrieb Daniel Arndt:
>
> Alex,
>
> Hey I just added my changes to a github branch ( 
>> https://github.com/gabpeters/dealii/tree/sparsity )
>> I changed the make_sparsity_pattern(dof_row,dor_col,sparsity) function 
>> and also changed the header in the
>> dof_tools.h file and the signature in the dof_tools_sparsity.inst.in 
>> file.
>> But still I get the following error, when I compile my code:
>>
>> undefined reference to `void 
>> dealii::DoFTools::make_sparsity_pattern,
>>   
>> dealii::DynamicSparsityPattern>(dealii::DoFHandler<3, 3> const&, 
>> dealii::DoFHandler<3, 3> 
>>  const&, 
>> dealii::DynamicSparsityPattern&, dealii::ConstraintMatrix const&, bool)'
>>
>> Did I still forget to change any reference?
>>
>
> Looking at the GitHub branch it seems that you copied a lot of files from 
> an older deal.II version (you probably modified) to a recent developer 
> version. That is not going to work.
> It's best if you make modifications on top off the master branch. 
> Otherwise, it is also fine to make the modifications to an older release. 
> We can certainly sort out how to convert such a patch to one to the recent 
> master.
>
> Best,
> Daniel
>


Hey,
you are right, that github branch doesnt look very serious. 
Now I cloned a more recent version, and added the Constraintsmatrix and 
changed the instantiations.
https://github.com/gabpeters/dealii/tree/sparse
But somehow it still doesn't work. I still get the error "undefined 
reference..."
I hope I dont bother you too much with all these questions.

Best
Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Aw: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-03-27 Thread Gabriel Peters


 

Hey, I just worked through the make_sparsity_pattern code.

I think I know how to fix the mentioned problem. But I dont understand the

how to use the "bool_dof_mask" in the correct way. It is used in he constraints.add_entries_local_to_global(...)

function.

In the make_sparsity_pattern function with a single dof_handler and a constraintmatrix, it is constructed by a fe_collection.

But I don't see how to construct the bool_dof_mask with 2 dof_handlers and respectively 2 fe_collections.

Do you have a clue?

 

Best

Gabriel




Gesendet: Dienstag, 26. März 2019 um 13:32 Uhr
Von: "Daniel Arndt" 
An: "deal.II User Group" 
Betreff: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux


Gabriel,

 

 


 
I am trying to apply boundary conditions on a Sparsematrix with two Dof_handlers in a parallel::distributed::trinagulation setting for the Step-35 tutorial.

( Same context as in this thread https://groups.google.com/forum/#!topic/dealii/9ibgrQ0mFBs).

 

At initializing the gradient_operator, I have an object with two Dof_Handlers, which I use for a sparsity pattern.

 

DoFTools::make_sparsity_pattern (dof_handler_velocity,dof_handler_pressure,dsp);

 

But when I apply boundary values to a PETSCWrapper::SparseMatrix using this sparsity pattern I get the following error

at the function MatrixTools::apply_boundary_values"

 

  The violated condition was: !has_ghost_elements()



 

This issue does not come unexpected if you don't tell DoFTools::make_sparsity_pattern about the constraints you wan't to use.  :-)
 


 

 



 

 

I tried another way to apply the boundary conditions with the use of a COnstraintMatrix as in the Step-40 tutorial. But in that case the

make_sparsity_pattern function doesn't work, when I use the commandd:

 

DoFTools::make_sparsity_pattern (dof_handler_velocity,dof_handler_pressure,dsp,constraints_velocity,false);

 

(There I get the error "candidate expects 3 arguments, 5 provided).



 

A function taking two DoFHandle objects and an AffineConstraints (resp. ConstraintMatrix) object is simply not yet implemented.

It should not be terribly difficult to do that, though. You could essentially just give the overload of DoFTools::make_sparsity_pattern

you are looking at (https://github.com/dealii/dealii/blob/master/source/dofs/dof_tools_sparsity.cc#L212-L350)

some more (defaulted) parameters and replace sparsity.add_entries(...) with constraints.add_entries_local_to_global(...).

 

Do you want to give it a shot? We would happily take such a contribution! Feel free to ask if you have any questions, but

https://github.com/dealii/dealii/wiki/Contributing should give a good overview.

 

Best,

Daniel

 







-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-03-26 Thread gabriel . peters
Hey everyone,

I am trying to apply boundary conditions on a Sparsematrix with two 
Dof_handlers in a parallel::distributed::trinagulation setting for the 
Step-35 tutorial.
( Same context as in this thread 
https://groups.google.com/forum/#!topic/dealii/9ibgrQ0mFBs).

At initializing the gradient_operator, I have an object with two 
Dof_Handlers, which I use for a sparsity pattern.

DoFTools::make_sparsity_pattern 
(dof_handler_velocity,dof_handler_pressure,dsp);

But when I apply boundary values to a PETSCWrapper::SparseMatrix using this 
sparsity pattern I get the following error
at the function MatrixTools::apply_boundary_values"

  The violated condition was: !has_ghost_elements()


I tried another way to apply the boundary conditions with the use of a 
COnstraintMatrix as in the Step-40 tutorial. But in that case the 
make_sparsity_pattern function doesn't work, when I use the commandd:

DoFTools::make_sparsity_pattern 
(dof_handler_velocity,dof_handler_pressure,dsp,constraints_velocity,false);

(There I get the error "candidate expects 3 arguments, 5 provided).


Does somebody have an idea how I can apply the boundary values efficiently 
in that case?

Thanks a lot and best regards

Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-03-26 Thread Gabriel Peters
Hi. Thanks a lot for the advice.
I will Try it tomorrow and send a response whether it works.

Regards

Gabriel




Gabriel Peters
Endenicher Str. 310
53121 Bonn
00491525/5478185
gabriel.pet...@koeln.de

Am 26.03.19 um 13:32 schrieb Daniel Arndt

> Gabriel,
>
>
> > I am trying to apply boundary conditions on a Sparsematrix with two
> > Dof_handlers in a parallel::distributed::trinagulation setting for the
> > Step-35 tutorial.
> > ( Same context as in this thread
> > https://groups.google.com/forum/#!topic/dealii/9ibgrQ0mFBs).
> >
> > At initializing the gradient_operator, I have an object with two
> > Dof_Handlers, which I use for a sparsity pattern.
> >
> > DoFTools::make_sparsity_pattern
> > (dof_handler_velocity,dof_handler_pressure,dsp);
> >
> > But when I apply boundary values to a PETSCWrapper::SparseMatrix using
> > this sparsity pattern I get the following error
> > at the function MatrixTools::apply_boundary_values"
> >
> >   The violated condition was: !has_ghost_elements()
> >
>
> This issue does not come unexpected if you don't tell
> DoFTools::make_sparsity_pattern about the constraints you wan't to use.  :-)
>
>
> >
> > I tried another way to apply the boundary conditions with the use of a
> > COnstraintMatrix as in the Step-40 tutorial. But in that case the
> > make_sparsity_pattern function doesn't work, when I use the commandd:
> >
> > DoFTools::make_sparsity_pattern
> > (dof_handler_velocity,dof_handler_pressure,dsp,constraints_velocity,false);
> >
> > (There I get the error "candidate expects 3 arguments, 5 provided).
> >
>
> A function taking two DoFHandle objects and an AffineConstraints (resp.
> ConstraintMatrix) object is simply not yet implemented.
> It should not be terribly difficult to do that, though. You could
> essentially just give the overload of DoFTools::make_sparsity_pattern
> you are looking at
> (https://github.com/dealii/dealii/blob/master/source/dofs/dof_tools_sparsity.cc#L212-L350)
>
> some more (defaulted) parameters and replace sparsity.add_entries(...) with
> constraints.add_entries_local_to_global(...).
>
> Do you want to give it a shot? We would happily take such a contribution!
> Feel free to ask if you have any questions, but
> https://github.com/dealii/dealii/wiki/Contributing should give a good
> overview.
>
> Best,
> Daniel
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Aw: Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-04-04 Thread Gabriel Peters

Hey Daniel,

thanks for the pull, with this instantiation everything compiles fine and I can use it.

But I think I did a mistake somewhere in the function. Using the definiion of the function from your pull request

I call

DoFTools::make_sparsity_pattern (dof_handler_velocity,dof_handler_pressure,dsp,
                    constraints_vel,false);

 

and afterwards I call

 

SparsityTools::distribute_sparsity_pattern (dsp, dof_handler_velocity.n_locally_owned_dofs_per_processor(),mpi_communicator,locally_relevant_dofs_vel);

 

When I run the program on more than 2 processors I get the following error during the distribute_sparsity... function:  

    The violated condition was: local_lines.is_element(line_n)

    Additional information:
    The index set given to this constraints object indicates constraints for degree of freedom 16 should not be stored by this object, but a constraint is being added.

 

Do you have an idea how I can fix this?

 

(When I run the code on 1 or 2 processors, this error doesnt come up.

But I get divergence in the Gmres mehod,

which might imply that the boundaryconditions are not

applied in the correct way yet, but I first want to focus on the upper error.)

 

 

Thanks and best regards

 

Gabriel

 


 


Gesendet: Mittwoch, 03. April 2019 um 03:03 Uhr
Von: "Daniel Arndt" 
An: "deal.II User Group" 
Betreff: Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux



Gabriel,

 



Now I cloned a more recent version, and added the Constraintsmatrix and changed the instantiations.

https://github.com/gabpeters/dealii/tree/sparse



 

That looks much better!

 



 

But somehow it still doesn't work. I still get the error "undefined reference..."



 

Admittedly, getting the instantiations right in this case might not be straightforward.

I created a pull request to your branch at https://github.com/gabpeters/dealii/pull/1 to fix some issues such that the branch at least compiles for me.

If you are satisfied with everything, please create a pull request to the master branch.

 

 



I hope I dont bother you too much with all these questions.



 

Not at all! We are happily helping people to contribute.

 

Best,

Daniel

 

 


--
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.
For more options, visit https://groups.google.com/d/optout.

 

 

 







-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-04-05 Thread Gabriel Peters






Gabriel Peters
Endenicher Str. 310
53121 Bonn
00491525/5478185
gabriel.pet...@koeln.de

Am 05.04.19 um 15:55 schrieb Daniel Arndt

> Gabriel,
> 
> to extend on my last post. Finally, I think that your approach with the two 
> DoFHandler objects will give you some more problems.
> What is likely happening here is that the AffineConstraints object here is 
> used both for rows and columns although row dofs and column dofs are 
> unrelated.
> What you wanted here is to shift the pressure dofs such that they don't 
> overlap with the velocoty dofs. However, you can't just do this using a 
> renumbering since it is currently not allowed.

That would habe Been my question to your First post, how to apply 2 constraints 
in the „constraints.add... function, but your described Problem seems Even 
Harder to solve.

> Even if you get this to work here without shifting, you will have the same 
> problem when assembling your matrix and applying constraints.
> I agree with David that the better approach here is to use a FESystem that 
> accounts both for velocity and pressure and follow step-32.
> 
> Best,
> Daniel
> 
> -- 

This Sounds like but Problem.
But thanks a lot again. I will try next week to implement the code using 
Blockmatrices as prescribed. I‘ll let you know if it works or if further 
questions come up.

Best,
Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-03-28 Thread gabriel . peters


Am Mittwoch, 27. März 2019 13:58:47 UTC+1 schrieb Daniel Arndt:
>
> Gabriel,
>
> Am Mittwoch, 27. März 2019 06:16:18 UTC-4 schrieb Gabriel Peters: 
>>
>> Hey, I just worked through the make_sparsity_pattern code.
>> I think I know how to fix the mentioned problem. But I dont understand the
>> how to use the "bool_dof_mask" in the correct way. It is used in he 
>> constraints.add_entries_local_to_global(...)
>> function.
>> In the make_sparsity_pattern function with a single dof_handler and a 
>> constraintmatrix, it is constructed by a fe_collection.
>> But I don't see how to construct the bool_dof_mask with 2 dof_handlers 
>> and respectively 2 fe_collections.
>> Do you have a clue?
>>
>  
> "bool_dof_mask" is only used in case the make_*_pattern has a `const 
> Table<2, Coupling> & couplings` parameter. That is currently not the case 
> for the function you are looking at.
> For being backward-compatible we need to provide/keep the
>
> void DoFTools::make_sparsity_pattern ( const DoFHandlerType &  dof_row,
>const 
> DoFHandlerType &  dof_col,
>
> SparsityPatternType & sparsity )
>
> interface anyway, it is fine to add defaulted parameters at the end, but 
> adding `const Table<2, Coupling> & couplings` as third parameter would 
> not.
> For now, I would simply assume that all components couple and ignore the 
> last argument for add_entries_local_to_global. We can always create another 
> overload later if specifying the coupling is desired/necessary.
>
> Best,
> Daniel
>


Hey, its me again.
Today I had various tries fixing the upper problem.

At first I extended the make_sparsity_pattern function to

void DoFTools::make_sparsity_pattern ( const DoFHandlerType &  dof_row,
   const 
DoFHandlerType &  dof_col,
   
SparsityPatternType & sparsity,
   const 
ConstraintMatrix,
   const 
bool keep_constrained_dofs)

and also changed the dof_tools.h file in deal.II\source\dofs and changed 
the adding function;
but when I compiled this I got lots of errors of this kind:
 error:* template-id* 
‘make_sparsity_pattern, 
dealii::BlockDynamicSparsityPattern>’ for ‘void 
dealii::DoFTools::make_sparsity_pattern(const dealii::hp::DoFHandler<1, 
3>&, const dealii::hp::DoFHandler<1, 3>&, 
dealii::BlockDynamicSparsityPattern&)’ *does not match any template 
declaration*



My second attempt was to make a new function, with a different name, which 
takes the same arguments as above and does exactly was the classical 
make_sp_pt(row_id,col_id,sparsity) function does, up to the 
constraints.add... function.
I also added the header of these function to the dof_tools.h file.
This compiled fine, but when I used this function in my program I got the 
error:
  undefined reference to: (function parameters).


Could you maybe tel me what I did wrong, or did I do an fundamental error 
at editting the deal.ii code?


Thanks a lot again and sorry for the long message

Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-03-27 Thread Gabriel Peters
Okay
Thanks a lot.
If it works now, I will contribute it.

Best

Gabriel




Gabriel Peters
Endenicher Str. 310
53121 Bonn
00491525/5478185
gabriel.pet...@koeln.de

Am 27.03.19 um 13:58 schrieb Daniel Arndt

> Gabriel,
> 
> Am Mittwoch, 27. März 2019 06:16:18 UTC-4 schrieb Gabriel Peters: 
> >
> > Hey, I just worked through the make_sparsity_pattern code.
> > I think I know how to fix the mentioned problem. But I dont understand the
> > how to use the "bool_dof_mask" in the correct way. It is used in he 
> > constraints.add_entries_local_to_global(...)
> > function.
> > In the make_sparsity_pattern function with a single dof_handler and a 
> > constraintmatrix, it is constructed by a fe_collection.
> > But I don't see how to construct the bool_dof_mask with 2 dof_handlers and 
> > respectively 2 fe_collections.
> > Do you have a clue?
> >
>  
> "bool_dof_mask" is only used in case the make_*_pattern has a `const 
> Table<2, Coupling> & couplings` parameter. That is currently not the case 
> for the function you are looking at.
> For being backward-compatible we need to provide/keep the
> 
> void DoFTools::make_sparsity_pattern ( const DoFHandlerType &  dof_row,
>const 
> DoFHandlerType &  dof_col,
>
> SparsityPatternType & sparsity )
> 
> interface anyway, it is fine to add defaulted parameters at the end, but 
> adding `const Table<2, Coupling> & couplings` as third parameter would not.
> For now, I would simply assume that all components couple and ignore the 
> last argument for add_entries_local_to_global. We can always create another 
> overload later if specifying the coupling is desired/necessary.
> 
> Best,
> Daniel
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Applying boundary values in parll::distr:triang setting for two dof_handler Sparsematrux

2019-04-01 Thread gabriel . peters


Am Donnerstag, 28. März 2019 21:37:19 UTC+1 schrieb Daniel Arndt:
>
> Gabriel,
>
> At first I extended the make_sparsity_pattern function to
>>
>> void DoFTools::make_sparsity_pattern ( const DoFHandlerType &  dof_row,
>>const 
>> DoFHandlerType &  dof_col,
>>
>> SparsityPatternType & sparsity,
>>const 
>> ConstraintMatrix,
>>const 
>> bool keep_constrained_dofs)
>>
>> and also changed the dof_tools.h file in deal.II\source\dofs and changed 
>> the adding function;
>> but when I compiled this I got lots of errors of this kind:
>>  error:* template-id* 
>> ‘make_sparsity_pattern, 
>> dealii::BlockDynamicSparsityPattern>’ for ‘void 
>> dealii::DoFTools::make_sparsity_pattern(const dealii::hp::DoFHandler<1, 
>> 3>&, const dealii::hp::DoFHandler<1, 3>&, 
>> dealii::BlockDynamicSparsityPattern&)’ *does not match any template 
>> declaration*
>>
>>  
> This looks like you were not adapting the signature in the function's 
> definition in source/dofs/dof_tools_constraints.h. It still only has three 
> instead of five parameters.
>  
>
>> My second attempt was to make a new function, with a different name, 
>> which takes the same arguments as above and does exactly was the classical 
>> make_sp_pt(row_id,col_id,sparsity) function does, up to the 
>> constraints.add... function.
>> I also added the header of these function to the dof_tools.h file.
>> This compiled fine, but when I used this function in my program I got the 
>> error:
>>   undefined reference to: (function parameters).
>>
>  
> This looks like you didn't provide a definition but only a declaration.
>
> Do you have your changes in a GitHub branch such that we can have a look 
> what you did precisely?
>

Hey I just added my changes to a github branch ( 
https://github.com/gabpeters/dealii/tree/sparsity )
I changed the make_sparsity_pattern(dof_row,dor_col,sparsity) function and 
also changed the header in the
dof_tools.h file and the signature in the dof_tools_sparsity.inst.in file.
But still I get the following error, when I compile my code:

undefined reference to `void 
dealii::DoFTools::make_sparsity_pattern,
  
dealii::DynamicSparsityPattern>(dealii::DoFHandler<3, 3> const&, 
dealii::DoFHandler<3, 3> 
 const&, 
dealii::DynamicSparsityPattern&, dealii::ConstraintMatrix const&, bool)'

Did I still forget to change any reference?
Best
Gabriel

PS, you can ignore the make*s*_sparsity_pattern(...) function which I added 
to dof_tools_sparsity.cc

>
> Best,
> Daniel
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Sparsematrix initialization in P4est program

2019-02-25 Thread gabriel . peters


Am Montag, 18. Februar 2019 22:21:06 UTC+1 schrieb David Wells:
>
> Hi Gabriel,
>
> I believe that you are still using the standard deal.II SparseMatrix 
> class; is this correct? If so, this class won't work with fully distributed 
> calculations. You will need to use either the Trilinos or PETSc wrappers 
> since not all information is available on the local processor with the 
> default SparseMatrix class.
>
> Either way: I believe the error message you encountered is a result of a 
> bug in deal.II. I don't think that the routine 
> GridTools::get_finest_common_cells(), which is called by that particular 
> make_sparsity_pattern variant, works with distributed triangulations. If 
> you want to use distributed triangulations you will need to set up the 
> coupled sparsity pattern in a different way.
>
> If you want to parallelize step-35, it may be better to start by looking 
> at step-32, which shows how to implement the Stokes equations (coupled to a 
> Boussinesq equation) in a fully distributed setting. I believe they set up 
> the coupling of the matrix with velocity and pressure blocks in a different 
> way that should work for you.
>
> Does this make sense?
>
> Thanks,
> David Wells
>
>>
>>
Hey,
sorry for the late respons, I had some stuff to work at.

Today I had a close look to the  Step-32 and 31 tutorial  
and I think that this doen't help very much because in the Step-32 tutorial 
the pressure_fe_degree eguals the velocity_fe_degree,
which, in my view, makes thi function "make_sparsity_pattern" applicable, 
because you only have to insert one Dof_Handler object.
Thus one can use the same Dof_Handler for velocity and pressure, and 
everything is created as in the Step-32

In my case the velocity_fe_degree is one degree larger then the 
pressure_fe_degree. 
If I understood the construction right, I can't perform it in this case.

Do you see my problem, or am I wrong?

Best Regards
Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Sparsematrix initialization in P4est program

2019-02-17 Thread gabriel . peters
Hey everybody, 
I have a problem with initializing a Sparsematrix in a parallel program.
 am using a parallel::distributed::triangulaton (as in the Step40 tutorial) 
on 
the Navier Stokes Projection solver from the step35 tutorial.
The problem arises in the function 

NavierStokesProjection::initialize_gradient_operator()
{
{
DynamicSparsityPattern 

 
dsp(dof_handler_velocity.n_dofs(), dof_handler_pressure.n_dofs());
DoFTools::make_sparsity_pattern 

 
(dof_handler_velocity, dof_handler_pressure, dsp);
sparsity_pattern_pres_vel.copy_from (dsp);
}

where I have to use two different FE-spaces, one for the pressure and one 
for the velocity.
To perform this in parallel I used the following code (according to the 
sparsematrices in step40)

{
DynamicSparsityPattern 
dsp(locally_relevant_dofs_vel.size(),locally_relevant_dofs_pres.size());
DoFTools::make_sparsity_pattern (dof_handler_velocity, 
dof_handler_pressure, dsp); 
sparsity_pattern_pres_vel.copy_from (dsp);
}

This code compilates fine, but when Running it with MPI, it stops in the 
"make_sparsity_pattern" line with the error code
"this->is_artificial() == false
Additional information:
Cant asks for Dofs on articial cells."

Does somebody know how I can fix this? 

My last try was to use the Indexsets instead of their size, when declaring 
dsp.
But unfortunately DynamicSparsityPattern can only take on IndexSet.


Thanks a lot

Gabriel




-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Problem with Adaptive mesh refinement for NavierStokesProjection (Step-35)

2019-01-29 Thread gabriel . peters


Am Montag, 28. Januar 2019 15:19:36 UTC+1 schrieb Wolfgang Bangerth:
>
> On 1/28/19 6:38 AM, gabriel...@koeln.de  wrote: 
> > 
> > But the problem is, that after one mesh-refinement step the time-step 
> solving 
> > of the Navierstokesprojection (in Step-35 it is in diffusion_step()) 
> > diverges. And I don't see why. Does anyone have an idea? 
> > 
> > First I thought that I used the Boundary conditions in a wrong way 
> during te 
> > refinement step, 
> >   but the problem also comes up when I apply zero Boundary values on the 
> whole 
> > domain for 
> > the velocity u. 
>
> How do you choose the timestep? Are you making sure that it satisfies a 
> CFL 
> condition? 
>
> Best 
>   W. 
>
> -- 
>  
> Wolfgang Bangerth  email: bang...@colostate.edu 
>  
> www: http://www.math.colostate.edu/~bangerth/ 
>

I already implemented a time-step-function to satisfy the CFL condition.
The problem also comes up when I use global refinement in the refine_mesh 
step (for example in stead of KellyEstimator refinement).
But when apply global refinement at the start of the program everything 
works fine, so I think there is a slight error somewhere, which I dont see.

Regards
Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Problem with Adaptive mesh refinement for NavierStokesProjection (Step-35)

2019-02-01 Thread gabriel . peters
I tried some things, but also if I insert a safety factor of 0.1 or less 
the GMRES-procedure in the diffusion-step diverges.
I implemented the time step function such that

dt <= max_{T} h_T/(u_max(T))

where the max is taken over all cells and u_max is the maximal value of u 
on the cell T.
 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] p4est balance_mesh

2019-06-04 Thread Gabriel Peters
Hey everyone,

I am wondering, whether there is a deal.ii function, which balances a 
parallel::distributed::triangulation neighbouring elements by 2:1,
like the p8est_balance_ext function
(see 
http://p4est.github.io/api/p8est__extended_8h.html#ad3a61dc2b4b5cc69b03c995f188bfd8d
 
)

Such a function might be useful after calling 
triagulation.execute_refinement_and_coarsening();




I think it mgiht be possible to proceed as in the p4est test programs and 
called
* p4est_balance** (triangulation, P4EST_CONNECT_FULL, NULL);*

but I got the error message
cannot convert ‘dealii::parallel::distributed::Triangulation<3, 3>’ to 
‘p4est_t* {aka p4est*}’ for argument ‘1’ to ‘void p4est_balance(p4est_t*, 
p4est_connect_type_t, p4est_init_t)’
   p4est_balance (triangulation, P4EST_CONNECT_FULL, NULL);

which is obvious because the p::d::triangulation is not a p4est*



Does someone have an idea how to fix this or how to balance the 
triangulation?

Best regards

Gabriel
























-- 
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/60d8aaf5-5b6a-44b8-8dae-d4b937fef516%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Aw: Re: [deal.II] p4est balance_mesh

2019-06-05 Thread Gabriel Peters

Hi

I am setting refinement_flags on cells, based on the geometry I use, and I want to ensure, that the mesh is still balanced. But if p4est does this automatically when I call execute_refine...()  it might be enough.

Best

 

Gabriel

 

Gesendet: Dienstag, 04. Juni 2019 um 17:52 Uhr
Von: "Wolfgang Bangerth" 
An: "dealii@googlegroups.com" 
Betreff: Re: [deal.II] p4est balance_mesh

On 6/4/19 6:41 AM, Gabriel Peters wrote:
>
> I am wondering, whether there is a deal.ii function, which balances a
> parallel::distributed::triangulation neighbouring elements by 2:1,
> like the p8est_balance_ext function
> (see
> http://p4est.github.io/api/p8est__extended_8h.html#ad3a61dc2b4b5cc69b03c995f188bfd8d
> )
>
> Such a function might be useful after calling
> triagulation.execute_refinement_and_coarsening();
>
>
>
>
> I think it mgiht be possible to proceed as in the p4est test programs and called
> /p4est_balance//(triangulation, P4EST_CONNECT_FULL, NULL);/
> /
> /
> but I got the error message
> cannot convert ‘dealii::parallel::distributed::Triangulation<3, 3>’ to
> ‘p4est_t* {aka p4est*}’ for argument ‘1’ to ‘void p4est_balance(p4est_t*,
> p4est_connect_type_t, p4est_init_t)’
>    p4est_balance (triangulation, P4EST_CONNECT_FULL, NULL);
>
> which is obvious because the p::d::triangulation is not a p4est*
>
>
>
> Does someone have an idea how to fix this or how to balance the triangulation?

What are you trying to achieve? The p::d::Triangulation class calls that
function internally anyway to ensure the 2:1 balance. There is nothing you
need to do yourself.

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/4595f80e-7d83-72d6-71e2-6c1fffe5bb32%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.






-- 
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/trinity-414d3395-75ce-4e49-bf83-970d262dc820-1559727401019%403c-app-webde-bap55.
For more options, visit https://groups.google.com/d/optout.


Re: Aw: Re: [deal.II] p4est balance_mesh

2019-06-05 Thread Gabriel Peters
Ok thanks a lot.

Best
Gabriel




Gabriel Peters
Endenicher Str. 310
53121 Bonn
00491525/5478185
gabriel.pet...@koeln.de

Am 05.06.19 um 14:55 schrieb Wolfgang Bangerth

> On 6/5/19 3:36 AM, Gabriel Peters wrote:
> > I am setting refinement_flags on cells, based on the geometry I use, and I 
> > want to ensure, that the mesh is still balanced. But if p4est does this 
> > automatically when I call execute_refine...()  it might be enough.
> 
> p4est doesn't, but deal.II does when it refines the mesh. It automatically 
> calls p4est_balance after p4est_refine.
> 
> 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/13f21b39-b827-79a6-cbfc-882d21acba07%40colostate.edu.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/trinity-6bd1cbf9-bab9-4c27-b0eb-d0880cd0664c-1559739808619%40msvc-mesg-web104.
For more options, visit https://groups.google.com/d/optout.


[deal.II] p4est tree initilization

2019-05-29 Thread Gabriel Peters
Hey everyone,

I am working with a parallel::distributed::triangulation.
In my program I load a coarse grid from a file.

Is there a function to manually initialize trees in my triangulation, 
according to some regions of my domain (just as p4est does) or 
is this automatically done by calling p::d::tria, in some way? If this is 
the case, how many trees are initialized then?

Thaks a lot
and best regards

Gabriel


-- 
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/4ac1c3d5-df2c-4a4c-bd35-4f0952580453%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Problem Solving BlockSparsematrix system blockwise

2019-05-20 Thread Gabriel Peters
Hey everyone,
I have a problem at solving a blocksystem.

I have a matrix called "system_matrix" in Blockform M =  [[A,0],[B,C]]
and I want to solve classical Mx = F. (F = [f,0], x = [x1,x2])

I proceed according to the LinearSolvers class in the step-32 tutorial.
so by blockwise solving the system I want to solve A*x1 = f for x1
and later on I want to solve
C*x2 = 0 - B*x1 for x2.

In the code I use:
*std::shared_ptr Mp_preconditioner;*

and compute




*TrilinosWrappers::SolverGMRES solver_gmres(solver_control_gmres);
solver_gmres.solve(system_matrix.block(0,0),distributed_solution.block(0),
rhs.block(0),Mp_preconditioner);*


But when I compile this I get the error 

 error: no matching function for call to 
‘dealii::TrilinosWrappers::SolverGMRES::solve(dealii::BlockMatrixBase::BlockType&,
 
dealii::BlockVectorBase::BlockType&, 
dealii::BlockVectorBase::BlockType&, 
std::shared_ptr&)’
 rhs.block(0),Mp_preconditioner);



This error also comes up at solving the lower right block




*TrilinosWrappers::SolverCG solver_cg(solver_control_cg);
solver_cg.solve(system_matrix.block(1,1),
distributed_solution.block(1),u_tmp_p,
Amg_preconditioner);*


Can somebody tell me what actually went wrong? I think I did everything 
quite similar to the LinearSolvers class which works finely.
Thanks a lot and best regards

Gabriel







-- 
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/a89681fc-950b-473b-a18b-666feaf89207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Problem Solving BlockSparsematrix system blockwise

2019-05-20 Thread Gabriel Peters
Hey Jean-Paul
Thanks a lot, Now it works finely.
Best regards

Gabriel




Gabriel Peters
Endenicher Str. 310
53121 Bonn
00491525/5478185
gabriel.pet...@koeln.de

Am 20.05.19 um 15:01 schrieb Jean-Paul Pelteret

> Dear Gabriel,
> 
> It looks to me like you forgot to dereference the shared pointer for the 
> preconditioner. So,
> 
> solver_gmres.solve(
>   system_matrix.block(0,0),
>   distributed_solution.block(0),
>   rhs.block(0),
>   *Mp_preconditioner); // <— here
> 
> You probably have the same problem for the other call.
> 
> I hope this was the correct observation to help sole the issue!
> 
> Best,
> Jean-Paul
> 
> 
> > On 20 May 2019, at 13:56, Gabriel Peters  wrote:
> > 
> > Hey everyone,
> > I have a problem at solving a blocksystem.
> > 
> > I have a matrix called "system_matrix" in Blockform M =  [[A,0],[B,C]]
> > and I want to solve classical Mx = F. (F = [f,0], x = [x1,x2])
> > 
> > I proceed according to the LinearSolvers class in the step-32 tutorial.
> > so by blockwise solving the system I want to solve A*x1 = f for x1
> > and later on I want to solve
> > C*x2 = 0 - B*x1 for x2.
> > 
> > In the code I use:
> > std::shared_ptr Mp_preconditioner;
> > 
> > and compute
> > 
> > TrilinosWrappers::SolverGMRES solver_gmres(solver_control_gmres);
> > 
> > 
> > solver_gmres.solve(system_matrix.block(0,0),distributed_solution.block(0),
> > rhs.block(0),Mp_preconditioner);
> > 
> > 
> > But when I compile this I get the error 
> > 
> >  error: no matching function for call to 
> > ‘dealii::TrilinosWrappers::SolverGMRES::solve(dealii::BlockMatrixBase::BlockType&,
> >  
> > dealii::BlockVectorBase::BlockType&, 
> > dealii::BlockVectorBase::BlockType&, 
> > std::shared_ptr&)’
> >  rhs.block(0),Mp_preconditioner);
> > 
> > 
> > 
> > This error also comes up at solving the lower right block
> > TrilinosWrappers::SolverCG solver_cg(solver_control_cg);
> > solver_cg.solve(system_matrix.block(1,1),
> > distributed_solution.block(1),
> > u_tmp_p,
> > Amg_preconditioner);
> > 
> > 
> > Can somebody tell me what actually went wrong? I think I did everything 
> > quite similar to the LinearSolvers class which works finely.
> > Thanks a lot and best regards
> > 
> > Gabriel
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > The deal.II project is located at http://www.dealii.org/ 
> > <http://www.dealii.org/>
> > For mailing list/forum options, see 
> > https://groups.google.com/d/forum/dealii?hl=en 
> > <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 
> > <mailto:dealii+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/dealii/a89681fc-950b-473b-a18b-666feaf89207%40googlegroups.com
> >  
> > <https://groups.google.com/d/msgid/dealii/a89681fc-950b-473b-a18b-666feaf89207%40googlegroups.com?utm_medium=email_source=footer>.
> > For more options, visit https://groups.google.com/d/optout 
> > <https://groups.google.com/d/optout>.
> 
> -- 
> 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/62B07170-EA44-4276-8813-4E8C9E25A1BF%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/trinity-394d81e1-d8a2-4b6a-bc1d-d49182149cd8-1558358138435%40msvc-mesg-web003.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Problem Adding Trilinos::MPI::BlockVector

2019-05-08 Thread Gabriel Peters
Hey everyone,

I have a problem with adding Vectors in a Multiparallel program.
Here I use TrilinosWrappers::MPI::BlockVector vector_1, vector_2;
which are initialized ion the same fashion, as in the step-32 tutorial
vector_1.reinit(stokes_relevant_partitioning, MPI_COMM_WORLD);
vector_2.reinit(stokes_relevant_partitioning, MPI_COMM_WORLD);

Now I want to call

vector_1.block(0).add(1.0, vector_2.block(0));

This compiles fine, but when I run the executbale on >=2 processors I get 
the following error:






*An error occurred in line <2015> of file 
 in 
functionvoid 
dealii::TrilinosWrappers::MPI::Vector::add(dealii::TrilinosScalar, const 
dealii::TrilinosWrappers::MPI::Vector&, dealii::TrilinosScalar, const 
dealii::TrilinosWrappers::MPI::Vector&)The violated condition was: 
!has_ghost_elements()Additional information: You are trying an 
operation on a vector that is only allowed if the vector has no ghost 
elements, but the vector you are operating on does have ghost elements. 
Specifically, vectors with ghost elements are read-only and cannot appear 
in operations that write into these vectors.*



I tried to avoid the ghost cells, so I had another try, intializing the 
Vectors in another fashion:
vector_1.reinit(stokes_partitioning, stokes_relevant_partitioning,
MPI_COMM_WORLD, true);

In this case the adding of the vectors worked out fineliy, 
but later on in the program I want to use Extractors to get the 
function_values at quadrature_points. So I call

if(cell->is_locally_owned)
[...]
fe_values,reinit(cell);
std::vector > vector_1_values(n_q_points);
fe_values[velocities].get_function_values(vector_1,vector_1_values);

But with the new initialization of vector_1 now the "get_function_values" 
function fails with the error:





*dealii::TrilinosScalar 
dealii::TrilinosWrappers::MPI::Vector::operator()(dealii::TrilinosWrappers::MPI::Vector::size_type)
 
constThe violated condition was: falseAdditional information: You 
tried to access element 225 of a distributed vector, but this element is 
not stored on the current processor. Note: There are 972 elements stored on 
the current processor from within the range 1215 through 2186 but Trilinos 
vectors need not store contiguous ranges on each processor, and not every 
element in this range may in fact be stored locally.*


Does somebody have an idea how either add the vectors in the right way 
or fix the get_function_value function call?

Thanks a lot and best regards

Gabriel


-- 
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/af7d94f3-c906-4730-9a1c-6f593c01d98f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Adding TrilinosWrapper::BlockSparseMatrix

2019-05-06 Thread gabriel . peters
Hey everyone,

I got a problem regarding TrilnosWrappers::BlockSparseMatrix.

In my program I have a TrilnosWrappers::BlockSparseMatrix system_matrix 
which consists of two
parts, one permanent part, which is computed at the beginning at the 
programm, not every iteration, to save time (called 
system_matrix_permanent) and one iterative part, which is computed in every 
iteration (called system_matrix_iterative). Hence system_matrix = 
system_matrix_permanent + system_matrix_iterative

Thus, after assembling those matrices, I want to call something like

system_matrix.add(system_matrix_permanent,system_matrix_permanent);

But I always get the error message 

error: no matching function for call to 
‘dealii::TrilinosWrappers::BlockSparseMatrix::add(dealii::TrilinosWrappers::BlockSparseMatrix&)’
  system_matrix.add(system_matrix_iterative);


Is there any function which adds up TrilinosWrappers::BlockSparseMatrix 
objects?

Thanks a lot and best regards

Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Aw: Re: [deal.II] Adding TrilinosWrapper::BlockSparseMatrix

2019-05-06 Thread Gabriel Peters

Hey Jean-Paul

Thanks a lot, that's what I was looking for, and now it works finely.

 

Best

Gabriel

 

Gesendet: Montag, 06. Mai 2019 um 14:27 Uhr
Von: "Jean-Paul Pelteret" 
An: dealii@googlegroups.com
Betreff: Re: [deal.II] Adding TrilinosWrapper::BlockSparseMatrix


Dear Gabriel,
 

There is a function to do this operation

https://dealii.org/9.0.0/doxygen/deal.II/classBlockMatrixBase.html#a9ee9987ece33a052d2b7a44034a8a01a

So you should write this as



system_matrix.add(1.0, system_matrix_iterative);

 

I hope this helps.

 

Best,

Jean-Paul



 


On 06 May 2019, at 13:55, gabriel.pet...@koeln.de wrote:
 



Hey everyone,

 

I got a problem regarding TrilnosWrappers::BlockSparseMatrix.

 

In my program I have a TrilnosWrappers::BlockSparseMatrix system_matrix which consists of two

parts, one permanent part, which is computed at the beginning at the programm, not every iteration, to save time (called system_matrix_permanent) and one iterative part, which is computed in every iteration (called system_matrix_iterative). Hence system_matrix = system_matrix_permanent + system_matrix_iterative

 

Thus, after assembling those matrices, I want to call something like

 

system_matrix.add(system_matrix_permanent,system_matrix_permanent);

 

But I always get the error message

 

error: no matching function for call to ‘dealii::TrilinosWrappers::BlockSparseMatrix::add(dealii::TrilinosWrappers::BlockSparseMatrix&)’
  system_matrix.add(system_matrix_iterative);

 

 

Is there any function which adds up TrilinosWrappers::BlockSparseMatrix objects?

 

Thanks a lot and best regards

 

Gabriel


 
--
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.
For more options, visit https://groups.google.com/d/optout.




 
--
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.
For more options, visit https://groups.google.com/d/optout.







-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Setting up system matrix fails

2019-07-09 Thread Gabriel Peters
Hey everyone,

I am setting up a system matrix in Trilinos::Blocksparsematrix with a 
DOfHandler, which has 3 velocity components and 1 pressure component 
(analogously to step-32).
Somehow everything worked fine a long time, but now I get an error I dont 
understand.

I call:




*std::vector  div_sol_u   (dofs_per_cell);
std::vector  sol_p   (dofs_per_cell);*

*[...]*



* for (unsigned int k=0; khttp://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/2f4887c3-4853-4515-85b2-9280832b8d5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Error at Trilinos installation

2019-04-25 Thread gabriel . peters
Hey everyone,
I have an error at compiling deal_ii_with_Trilinos=ON, which I dont 
understand.

First I installed,then I called 

cmake -DCMAKE_INSTALL_PREFIIX=/home/peters/Documents/installs 
-DDEAL_II_WITH_TRILINOS=ON 
-DTRILINOS_DIR=/home/peters/Documents/build_trilinos

This all worked finely, but when I called make install I get the following 
error:

[ 55%] Linking CXX shared library ../lib/libdeal_II.so
/usr/bin/ld: 
/home/peters/Documents/build_trilinos/lib/libmuelu-adapters.a(MueLu_CreateEpetraPreconditioner.cpp.o):
 
relocation R_X86_64_PC32 against symbol 
`_ZTVN7Teuchos17SerialTriDiMatrixIidEE' can not be used when making a 
shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
source/CMakeFiles/deal_II.dir/build.make:964: recipe for target 
'lib/libdeal_II.so.9.1.0-pre' failed
make[2]: *** [lib/libdeal_II.so.9.1.0-pre] Error 1
CMakeFiles/Makefile2:941: recipe for target 
'source/CMakeFiles/deal_II.dir/all' failed
make[1]: *** [source/CMakeFiles/deal_II.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
peters@stud-04:~/programs/dealii$ m


Can somebody tell me, what went wrong? And where do I have to add the order 
"recompile with -fPIC".

Thanks a lot and best regards


Gabriel


-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Error at Trilinos installation

2019-04-25 Thread gabriel . peters
Hey everyone,
I have an error at compiling deal_ii_with_Trilinos=ON, which I dont 
understand.

First I installed Trilinos,then I called 

cmake -DCMAKE_INSTALL_PREFIIX=/home/peters/Documents/installs 
-DDEAL_II_WITH_TRILINOS=ON 
-DTRILINOS_DIR=/home/peters/Documents/build_trilinos

This all worked finely, but when I called make install I get the following 
error:

[ 55%] Linking CXX shared library ../lib/libdeal_II.so
/usr/bin/ld: 
/home/peters/Documents/build_trilinos/lib/libmuelu-adapters.a(MueLu_CreateEpetraPreconditioner.cpp.o):
 
relocation R_X86_64_PC32 against symbol 
`_ZTVN7Teuchos17SerialTriDiMatrixIidEE' can not be used when making a 
shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
source/CMakeFiles/deal_II.dir/build.make:964: recipe for target 
'lib/libdeal_II.so.9.1.0-pre' failed
make[2]: *** [lib/libdeal_II.so.9.1.0-pre] Error 1
CMakeFiles/Makefile2:941: recipe for target 
'source/CMakeFiles/deal_II.dir/all' failed
make[1]: *** [source/CMakeFiles/deal_II.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
peters@stud-04:~/programs/dealii$ m


Can somebody tell me, what went wrong? And where do I have to add the order 
"recompile with -fPIC".

Thanks a lot and best regards


Gabriel

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Inserting FESolution into systemmatrix

2019-04-25 Thread gabriel . peters
Hey everyone,

I want to set up a BlockMatrix, with entries, which are enforced by a 
velocity components of aBlockVector "solution_old".
The Vector contains velocity entries in the first dim terms and pressure 
entries in the last component.

Similar to the 'assemble_system' function of Step-21 tutorial, I use

std::vector > solution_old_values(n_q_points);

While assembling the system over all cells I call

fe_values.get_function_values (solution_old, solution_old_values);

In the Step-21 tutorial, they call

const double old_s = old_solution_values[q](dim+1); 

to get the dim+2 component of the vector.

Up to here, everything compiles fine, but I dont know how to apply the 
values correctly
Therefore I have the following two questions:

Do I simply have to call: const double solution_o = 
solution_old_values[q](0);
to get the velocity component? In fact they are vector-valued, so a double 
doesn't make sense that much.

And thus my second question is: Do I apply the value correctly to the local 
matrix 
by calling:
local_matrix(i,j) += solution_o * fe_values[velocities].shape_value(i,q) * 
fe_values[velocities].shape_value(j,q);


As always, thanks a lot anf best regards

Gabriel




-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Inserting FESolution into systemmatrix

2019-04-25 Thread Gabriel Peters






Gabriel Peters
Endenicher Str. 310
53121 Bonn
00491525/5478185
gabriel.pet...@koeln.de

Am 25.04.19 um 15:28 schrieb Wolfgang Bangerth

> On 4/25/19 4:51 AM, gabriel.pet...@koeln.de wrote:
> > 
> > std::vector > solution_old_values(n_q_points);
> > 
> > While assembling the system over all cells I call
> > 
> >      fe_values.get_function_values (solution_old, solution_old_values);
> > 
> > In the Step-21 tutorial, they call
> > 
> > const double old_s = old_solution_values[q](dim+1);
> > 
> > to get the dim+2 component of the vector.
> > 
> > Up to here, everything compiles fine, but I dont know how to apply the 
> > values 
> > correctly
> > Therefore I have the following two questions:
> > 
> > Do I simply have to call: const double solution_o = 
> > solution_old_values[q](0);
> > to get the velocity component? In fact they are vector-valued, so a double 
> > doesn't make sense that much.
> 
> Correct. The vector should be a `Tensor<1,dim>` and you would have to copy 
> the 
> first `dim` components of `solution_old_values[q]` into the tensor. That's 
> burdensome, so I would suggest that instead you use extractors:
>std::vector> old_velocity_values(n_q_points);
>fe_values[velocities].get_function_values (...);
> and then you already have (only) the velocities and in their right data type.
> 
> 
> > And thus my second question is: Do I apply the value correctly to the local 
> > matrix
> > by calling:
> > local_matrix(i,j) += solution_o * fe_values[velocities].shape_value(i,q) * 
> > fe_values[velocities].shape_value(j,q);
> 
> This looks funny. You are multiplying a scalar 'solution_o' and phi_i*phi_j 
> where the latter two are vectors. This works, of course, but didn't you want 
> solution_o to be a vector as well?

Oh thanks I Wrote bullshit.
I wanted solution_o to be vector-valued.
And I want to multiply it with a gradient function. So I want

 local_matrix(i,j) += solution_o * fe_values[velocities].shape_gradient(i,q) * 
fe_values[velocities].shape_gradient(j,q);

Does this look any better?

> 
> You are also missing the JxW.
I left it out to here to keep Notation as Short as possible

Best regards 
Gabriel

> 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] getting components of Blockvector

2019-08-22 Thread Gabriel Peters
Hey everyone,

I have the following problem
I have a classical velocity - pressure Blockvector "soluion" and a FEsystem 
(initialized via
* fe(FE_Q(degree + 1), dim, FE_Q(degree), 1)*

For some testing I want to get the velocity compontents of solution in 
seperate vectors,
i.e. a vector u_x which contains the velocity values of solution in 
x-direction.

I am not really sure yet how to get these values.

My attempt is to use FEValues and quadrature points


u_x.reinit(n_dofs_in_one_direction);
*FEValues fe_values(fe, 
quadrature_formula, update_values);*
*std::vector>  velocity_values(n_q_points);*
*const FEValuesExtractors::Vector   velocities(0);*

*for (const auto  : dof_handler.active_cell_iterators())*
* {*
*  fe_values.reinit(cell);*
*  fe_values[velocities].get_function_values(solution, 
velocity_values);*
 
*[...]*

*}*

With this procedure I get the vector of Tensors velocity_values, which 
contains the velocity-values of "solution" in every direction at the 
quadratue points. So now I an easily get the values of velocity_values in 
the x-direction at the quadrature points. But how do I get the values of 
u_x at the dofs?

Does somebody have an idea how to fix this, or a better way to do handle 
this?


Best regards

Gabriel

-- 
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/ab0a6346-2529-4909-9d3e-b8da278e40fe%40googlegroups.com.


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.