Problem in inhomogeneous constraints

72 views
Skip to first unread message

Tomas Fernandez Bouvier

unread,
Jun 26, 2024, 7:00:46 AM (8 days ago) Jun 26
to deal.II User Group
In the context of a parallel implementation of step-26, where I inspired myself in step-32, I am trying to set a different constant in the initial and boundary conditions that I apply to my system. Below is an image of the result when I set the initial system to 1 instead of 0. I tried to investigate the implementation of a rhs. Somehow the conditions appear to be inhomogeneous and therefore the rhs is modified. The only improvement that I got was when I muted this lines in my code:

            if (constraints.is_inhomogeneously_constrained(
                  data.local_dof_indices[i]))
              {
                for (unsigned int j = 0; j < dofs_per_cell; ++j)
                  data.matrix_for_bc(j, i) +=0 ;
                  /*
                    (scratch.phi_T[i] * scratch.phi_T[j] *
                       (use_bdf2_scheme ? ((2 * time_step + old_time_step) /
                                           (time_step + old_time_step)) :
                                          1.) ) *
                    scratch.fe_values.JxW(q);
                  */
              }

but I am still not able to set the entire system initial temperature to 1 or any other initial value.

Can you help me?

Thank you!



Screenshot from 2024-06-26 13-55-07.png
step-26.cc

Tomas Fernandez Bouvier

unread,
Jun 26, 2024, 9:32:53 AM (8 days ago) Jun 26
to deal.II User Group
EDIT:

I fixed the problem that involved inhomogeneous constraints (i had not initialized the bc matrix). However I am still struggling since boundary conditions are only being interpolated on the external face of my boundary cells.

Wolfgang Bangerth

unread,
Jun 26, 2024, 11:51:55 AM (7 days ago) Jun 26
to dea...@googlegroups.com

Tomas,
I must admit that I don't understand what the issue is. What does the
image show, and what is it you expect it to show? Part of my confusion
is that you use terms initial conditions, right hand side, and (in the
Subject line) constraints, but these are not obviously related to each
other.

It is, of course, possible that step-32 has a bug that prevents it from
dealing correctly with non-zero initial conditions but that doesn't show
up with the zero initial conditions used there.

Best
W.

On 6/26/24 07:32, Tomas Fernandez Bouvier wrote:
> *** Caution: EXTERNAL Sender ***
> Screenshot from 2024-06-26 13-55-07.png
>
> --
> 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+un...@googlegroups.com
> <mailto:dealii+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/efb4046c-8d37-4243-8dba-bc959af2b0dan%40googlegroups.com <https://groups.google.com/d/msgid/dealii/efb4046c-8d37-4243-8dba-bc959af2b0dan%40googlegroups.com?utm_medium=email&utm_source=footer>.

Tomas Fernandez Bouvier

unread,
Jun 27, 2024, 4:12:47 AM (7 days ago) Jun 27
to deal.II User Group
Sorry I didn't explain myself properly. On the other hand I have a better understanding on the problem now.

Long short story: Instead of setting the initial temperature to 0 as in most of the examples, I set it to 1. When I tried to solve the system I saw the artifact that I showed in the previous picture. The program was reporting that I had in-homogeneous boundary conditions, that's why I titled my question like that. But I am now sure that every quadrature point in the system is set to 1 and yet when solving the first step I still have a smaller value that appears in the adjacent points to the boundary. I created a minimally refined lattice and the error persists.
Screenshot from 2024-06-27 10-44-53.png

Tomas Fernandez Bouvier

unread,
Jun 27, 2024, 5:23:32 AM (7 days ago) Jun 27
to deal.II User Group
Hi,

I managed to figure out the solution myself. I was not initializing properly the matrix_bc entries and I was missing part of the inhomogeneous boundary condition loop, as I mentioned in the previous message. I still have one conceptual question though: why setting the initial temperature (and hence the boundary conditions) to a constant leads to my system being in-homogeneously constrained?

Thank you for your time.

Wolfgang Bangerth

unread,
Jun 27, 2024, 3:06:47 PM (6 days ago) Jun 27
to dea...@googlegroups.com
On 6/27/24 03:23, Tomas Fernandez Bouvier wrote:
> why setting the initial temperature (and hence the boundary conditions) to a
> constant leads to my system being in-homogeneously constrained?

That's the definition of "in-homogeneously constrained": Some variables are
fixed at non-zero values. So if your Dirichlet boundary conditions are
non-zero, you end up with inhomogeneous constraints.

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


Tomas Fernandez Bouvier

unread,
Jun 28, 2024, 5:18:59 AM (6 days ago) Jun 28
to deal.II User Group
Makes sense. Thank you for your patience!

Best
Tomás
Reply all
Reply to author
Forward
0 new messages