<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Georgia;
panose-1:2 4 5 2 5 4 5 2 3 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
h3
{mso-style-priority:9;
mso-style-link:"Überschrift 3 Zchn";
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:13.5pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.berschrift3Zchn
{mso-style-name:"Überschrift 3 Zchn";
mso-style-priority:9;
mso-style-link:"Überschrift 3";
font-family:"Cambria","serif";
color:#4F81BD;
font-weight:bold;}
span.mw-headline
{mso-style-name:mw-headline;}
span.E-MailFormatvorlage19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:551311837;
mso-list-type:hybrid;
mso-list-template-ids:747547504 1274601906 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Gilles,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">implementing natural boundary conditions in GetDP is actually quite easy. If you just want to set the derivative of u<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">with respect to the normal direction (a scalar value) you can just write:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Galerkin{ [ -du_dn[], {u}]; In GammaInner; Jacobian JSur; Integration I1;}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I’ve modified your example accordingly. Please find the attached files and screenshots 1 and 2.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">If you have a vector and just want to get it’s normal part, you can multiply it with the build-in function Normal[], which gives you<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">a unit vector normal to the surface. The direction of the normal vector is defined in Gmsh, where you can also invert the direction. You should
check if they are<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">pointing in the right direction (usually outwards, i.e. away from the computation domain). See screenshot 3.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">In you .pro files there are two additional points I had to change:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Function space must cover the complete computation-domain, i.e. Omega AND GammaInner AND GammaOuter (Therefore I definied group “TotalDomain”)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">In PostProcessing the value of u should be evaluated also in TotalDomain. Otherwise you cannot plot u OnElementsOf GammaInner, as GammaInner
does not belong to group Omega<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Have a nice weekend!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Michael<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> getdp [mailto:getdp-bounces@ace20.montefiore.ulg.ac.be]
<b>On Behalf Of </b>gilles quemener<br>
<b>Sent:</b> Friday, October 17, 2014 11:43 AM<br>
<b>To:</b> getdp@geuz.org<br>
<b>Subject:</b> [Getdp] 3D Laplace equation with Neumann and Dirichlet boundary conditions<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">Hello,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">Currently I am trying to solve Laplace equation in 3D with both some Neumann and Dirichlet boundary conditions<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">on different parts of the problem domain. This domain consists in an outer cube with a cubic hole at centre
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">(see attached file Laplace3D.geo).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">The problem to be solved is the following :<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">- div(grad(u) = 0 in Omega
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">with both the following BC:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">1) Dirichlet BC:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"> u = 0 on GammaOuter<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">2) Neumann BC:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">\partial u / \partial normal = grad(u).normal = (gbx, gby, gbz).(normalX, normalY, normalZ) on GammaInner<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">where:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">GammaOuter = Outer cube surface<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">GammaInner = Inner cube surface<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">Omega = volume limited by these two surfaces<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">I tried to modify Onelab examples for 2D Laplace equations as shown at
<a href="http://onelab.info/wiki/Category:GetDP">http://onelab.info/wiki/Category:GetDP</a>.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">I have some known functions of space coordinates X[], Y[] and Z[] and of an order norder (=3 e.g.) for gbx[], gby[]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">and gbz[].<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">As I do not know how to access the normal components (normalX, normalY and normalZ) within GetDP and as
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">my geometry is quite simple, I divided both GammerOuter and GammaInner into 6 individual Physical Surfaces:
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">top, bottom, left, right, front and back faces for each cube. There the normal vectors are known and I can therefore
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">write the Neumann boundary conditions on each face see the (Weak) Formulation space in the attached file
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">Laplace3D.pro. Note: how to proceed for more complicated surfaces is still a mystery to me but this is not my current<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">problem !<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">Gmsh (command: gmsh Laplace3D.geo -3) does its works and provides me with a 3D mesh of the domain of interest.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">GetDP (command: getdp Laplace3D.pro -solve -pos) runs and outputs files, but solved potentials are null everywhere !<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">Does anyone have some clue on what I am doing wrong in this formulation ? I tried to solve the same problem<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">using FreeFem++ (see atached files Laplace-cube-cube.edp and MeshSurface.idp) and got results making some sense.
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">But I would prefer much more to solve it in Gmsh/GetDP as Gmsh is so powerful for postprocessing data.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099">Thanks a lot for any help,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"> Gilles<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
<h3><span class="mw-headline"><span style="font-family:"Georgia","serif";color:#000099"> </span></span><span style="font-family:"Georgia","serif";color:#000099"><o:p></o:p></span></h3>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Georgia","serif";color:#000099"><o:p> </o:p></span></p>
</div>
</div>
</div>
</body>
</html>