<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Greetings, <div class=""><br class=""></div><div class="">I am working on modifying the shallow water model in ex11 for the purpose of my thesis. </div><div class=""><br class=""></div><div class="">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. </div><div class=""><br class=""></div><div class="">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 : <span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class=""> DMLabelSetValue(labelWall</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">c</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(93, 151, 196);" class="">100</span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">)</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">;</span></div><div class=""><br class=""></div><div class=""><font color="#000000" class="">Next, in the routine where the boundary conditions are set, I pass a separate command :</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">PetscDSAddBoundary(prob</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">DM_BC_ESSENTIAL</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(166, 202, 145);" class="">"wall"</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(166, 202, 145);" class="">"DamWall"</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(93, 151, 196);" class="">0</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(93, 151, 196);" class="">1</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">&comp</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">(</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">void </span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">(*)(</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">void</span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">)) PhysicsBoundary_Dam_Wall</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, sizeof</span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">(damWallids)</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">&damWallids</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(74, 92, 110); font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255);" class="">phys)</span><span style="font-family: Menlo; font-size: 9pt; background-color: rgb(255, 255, 255); color: rgb(242, 137, 49);" class="">;</span></div><div class=""><br class=""></div><div class=""><font color="#000000" class="">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). </font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">Is there a smarter way to go about this or would you suggest a correction in my current method?</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Thank you in advance for your wonderful suggestions and work!</span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Regards, </span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Mukkund Sunjii </span></font></div></body></html>