[petsc-users] Regarding DM Labels
Jed Brown
jed at jedbrown.org
Mon Jun 8 15:02:57 CDT 2020
MUKKUND SUNJII <mukkundsunjii at gmail.com> writes:
> Greetings,
>
> I am working on modifying the shallow water model in ex11 for the purpose of my thesis.
>
> I wish to run a specific dam break scenario using this model. In the scenario, the velocity fields of certain cells must be constrained. That is I want to create an “artificial wall” inside the domain by constraining the value [uh] to not change.
Why not make your unstructured mesh be the non-wall domain? That way
you don't have to constrain cell values and you can (correctly) make the
(reconstructed) zero velocity occur at the cell boundary rather than the
cell interior.
> For this purpose, I tried creating a separate label in the DM. Further, I added the cells whose velocity values I wanted to constrain to the label using the routine : DMLabelSetValue(labelWall, c, 100);
>
> Next, in the routine where the boundary conditions are set, I pass a separate command :
>
> PetscDSAddBoundary(prob, DM_BC_ESSENTIAL, "wall", "DamWall", 0, 1, &comp, (void (*)(void)) PhysicsBoundary_Dam_Wall, sizeof(damWallids), &damWallids, phys);
>
> Ofcourse, in the function PhysicsBoundary_Dam_Wall() I set the vector value of [uh] to 0. When I do run the program, I do not see any of this in play (i.e., the values are not being constrained).
>
> Is there a smarter way to go about this or would you suggest a correction in my current method?
>
> Thank you in advance for your wonderful suggestions and work!
>
> Regards,
>
> Mukkund Sunjii
More information about the petsc-users
mailing list