Boundary conditions on segments

75 views
Skip to first unread message

Oleg Kmechak

unread,
Nov 20, 2018, 7:38:48 AM11/20/18
to deal.II User Group
Hello All,

I am trying to solve Laplace equation on 2d a little bit complicated area.. It is simulation of river network growth.
At this moment I can generate mesh(using Triangle and Tethex, cos Gmsh and its refinement tool sometimes fails), and using examples in step-4-6 to solve Laplace equation above this mesh in DealII. But I still didn't figured out how to set boundary conditions.
For example create_triangulation() funciton and CellData, contains value boundaryId but it is applied for whole cell, but I need instead this boundaryId applied to specific edge of cells. Like in this picture, which I have done in Mathematica:

river_network.jpg


upd: just moment ago figured out that SubCellData() contains exactly what I need! But I still will post this, cos I didn't saw any working example similar to mine and maybe some comments to stack of libraries that I am using.


With regards, 
Oleg Kmechak



Wolfgang Bangerth

unread,
Nov 20, 2018, 9:24:30 AM11/20/18
to dea...@googlegroups.com, Oleg Kmechak

Oleg,

> I am trying to solve Laplace equation on 2d a little bit complicated area.. It
> is simulation of river network growth.

Nice application!


> upd: just moment ago figured out that SubCellData() contains exactly what I
> need! But I still will post this, cos I didn't saw any working example similar
> to mine and maybe some comments to stack of libraries that I am using.

Yes, that's the way to do it. But you can't set boundary indicators on faces
that are not actually at the boundary.

Best
W.

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

Oleg Kmechak

unread,
Nov 27, 2018, 8:56:44 PM11/27/18
to deal.II User Group
Nice application! 
Thanks, and its very challenging :)

But you can't set boundary indicators on faces
that are not actually at the boundary.

You mean that I can't set Dirichlet Conditions on such structure as the tree above?
Cos this feature is critical for my work

With regards, 
Oleg Kmechak

Wolfgang Bangerth

unread,
Nov 27, 2018, 11:45:41 PM11/27/18
to dea...@googlegroups.com
On 11/27/18 6:56 PM, Oleg Kmechak wrote:
>
> But you can't set boundary indicators on faces
> that are not actually at the boundary.
>
>
> You mean that I can't set Dirichlet Conditions on such structure as the tree
> above?
> Cos this feature is critical for my work

What I'm saying is that you can't set boundary indicators on faces between two
cells (i.e., on *interior* faces). That's because these are not actually on
the *boundary*.

If you want to set conditions on degrees of freedom in the interior of the
domain, you need a different approach. The easiest way is to make sure that
the faces where you want to set boundary conditions are really at the boundary
-- i.e., these faces have exactly one adjacent cell; but you can have two
faces each bounding one cell at the physically same location: these are then
boundary faces.

Other approaches are to copy the logic of interpolate_boundary_values() and
make it work on interior faces that you mark through some other approach.

Oleg Kmechak

unread,
Dec 6, 2018, 5:44:02 PM12/6/18
to deal.II User Group
Thanks, Just moment ago have done Your first variant,
Regards,
Oleg Kmechak

Oleg Kmechak

unread,
Dec 6, 2018, 6:43:25 PM12/6/18
to deal.II User Group
Dear Wolfgan, 

Probably I understood how to set Dirichlet boundary condition using interpolate_boundary_values() and specifying argument boundary_id(but not tried it yet). But how about Neumann boundary condition? As I understand, using custom boundary_id on boundary cell, and with any specification by interpolate_boundary_values() will give me Neumman with zero flux, but I can't figure out how to set nonzero flux.

PS:  A little out of topic question. Even if I solved my equation and  have the solution vector, but I can't figure out how to "access" it like to function f(x,y)? It is done somehow by FEValue class? 

Regards, 
Oleg Kmechak




On Wednesday, 28 November 2018 05:45:41 UTC+1, Wolfgang Bangerth wrote:

Wolfgang Bangerth

unread,
Dec 6, 2018, 7:13:32 PM12/6/18
to dea...@googlegroups.com
On 12/6/18 4:43 PM, Oleg Kmechak wrote:
>
> Probably I understood how to set Dirichlet boundary condition using
> interpolate_boundary_values() and specifying argument boundary_id(but not
> tried it yet). But how about Neumann boundary condition? As I understand,
> using custom boundary_id on boundary cell, and with any specification by
> interpolate_boundary_values() will give me Neumman with zero flux, but I can't
> figure out how to set nonzero flux.

Neumann boundary values have to be implemented in a completely different way.
They go into the variational form. You may want to take a look at my lectures
on boundary values.


> PS:  A little out of topic question. Even if I solved my equation and  have
> the *solution* vector, but I can't figure out how to "access" it like to
> function f(x,y)? It is done somehow by FEValue class?

You can use FEFieldFunction if you need it at arbitrary points. If you need it
at quadrature points, then FEValues is the way to go -- take a look at
step-15, for example.

Best
WB

Oleg Kmechak

unread,
Dec 6, 2018, 7:18:42 PM12/6/18
to dea...@googlegroups.com
Thanks a lot.
Regards,
Oleg Kmechak

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/Yvav6lktXWs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages