<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
.EmailQuote
{margin-left:1pt;
padding-left:4pt;
border-left:#800000 2px solid}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 12pt;">Hi Lee,<br>
<br>
Take a look at nr, ns, nt, nel return arguments of findpts_setup() in nek/jl/findpts.c<br>
<br>
An example of usage of this routine is in intpts_setup() and intpts() of nek/postpro.f<br>
<br>
Aleks<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF137448"><font color="#000000" face="Tahoma" size="2"><b>From:</b> nek5000-users-bounces@lists.mcs.anl.gov [nek5000-users-bounces@lists.mcs.anl.gov] on behalf of nek5000-users@lists.mcs.anl.gov [nek5000-users@lists.mcs.anl.gov]<br>
<b>Sent:</b> Tuesday, February 02, 2016 4:31 AM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] Find out which cell a meshpoint belongs to<br>
</font><br>
</div>
<div></div>
<div>
<div>Hi neks,
<div><br>
</div>
<div>I'm just wondering if there's currently a function which acts on a meshpoint and returns the cell it is closest to.</div>
<div><br>
</div>
<div>I have also tried doing this manually but I need to know the corners of each cell, if that is stored somewhere?</div>
<div><br>
</div>
<div>Otherwise, is there a way of generating a list of every gridpoint so I can calculate the corners using brute force.</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Lee</div>
<div><br>
</div>
<br>
<br>
<br>
<div class="x_gmail_quote">On Tue, Feb 2, 2016 at 12:10 AM -0800, "nek5000-users@lists.mcs.anl.gov"
<span dir="ltr"><<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>></span> wrote:<br>
<br>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div class="PlainText">Hi<br>
<br>
The adjoint implementation in nek assumes change of the direction of <br>
time evolution. The goal is to use the standard nek solver with minimal <br>
modifications (only advection terms have to be changed). You get these <br>
equations from you standard one by changing the time and pressure sign <br>
(t -> -t; p-> -p). This of course changes your time integration limits, <br>
but it shouldn't be a problem. So when you have your linear direct <br>
simulation, to turn it into dual one it is enough to include in your <br>
userchk include files ADJOINT and TSTEP, and for ISTEP.eq.0 set <br>
IFADJOINT to true. Something like:<br>
subroutine userchk<br>
<br>
include 'SIZE'<br>
include 'TSTEP' ! ISTEP<br>
include 'ADJOINT' ! IFADJ<br>
<br>
if(ISTEP.eq.0) ADJOINT=.TRUE.<br>
<br>
There is no need to modify ###.rea or ###.map files. The only problem <br>
are boundary conditions for open flows, as they would require <br>
non-homogeneous bc. In this case to avoid problems we usually use <br>
sufficiently large domain together with zero Dirichlet bc. The last <br>
issue is sufficient resolution for both direct and adjoin runs. I hope <br>
this gives you some idea about nek implementation.<br>
Regards<br>
Adam<br>
<br>
On 2016-02-01 22:17, nek5000-users@lists.mcs.anl.gov wrote:<br>
> Hi Neks,<br>
><br>
> To my knowledge, Nek5000 is able to solve adjoint equations of the form:<br>
> $\partial u_a/\partial t + V.\nabla u_a - u_a.(\nabla V)^T + \nabla <br>
> \p_a + 1/Re \nabla^2 u_a=0$ and $\nabla.u_a=0$<br>
> where u_a and p_a are adjoint velocity and pressure. (Slightly <br>
> different formulation may be seen in literature).<br>
><br>
> Let's assume the forward problem is already solved so that $V$, i.e. <br>
> velocity, (and possibly $p$ as the pressure) is (are) already know. <br>
> Thus, the initial and boundary conditions for adjoint NS are also <br>
> known. How can we now solve the dual/adjoint NS problem with Nek5000? <br>
> Is there any example on how to modify .rea files? Specailly, the <br>
> "convection term of $V.\nabla u_a - u_a.(\nabla V)^T$ needs to be <br>
> modified compared to forward NS but am not sure how.<br>
> My search of mailing list entails some modifications in "perturb.f" <br>
> subroutine, but a little bit more clarification on that would be <br>
> really appreciated.<br>
><br>
> Yours,<br>
> Saleh<br>
> _______________________________________________<br>
> Nek5000-users mailing list<br>
> Nek5000-users@lists.mcs.anl.gov<br>
> <a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" target="_blank">
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
<br>
_______________________________________________<br>
Nek5000-users mailing list<br>
Nek5000-users@lists.mcs.anl.gov<br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>