[Nek5000-users] Find out which cell a meshpoint belongs to

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Mar 3 13:52:18 CST 2016


Hi Lee,

Take a look at  nr, ns, nt, nel return arguments of findpts_setup() in nek/jl/findpts.c

An example of usage of this routine is in intpts_setup() and intpts() of nek/postpro.f

Aleks
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
Sent: Tuesday, February 02, 2016 4:31 AM
To: nek5000-users at lists.mcs.anl.gov
Subject: [Nek5000-users] Find out which cell a meshpoint belongs to

Hi neks,

I'm just wondering if there's currently a function which acts on a meshpoint and returns the cell it is closest to.

I have also tried doing this manually but I need to know the corners of each cell, if that is stored somewhere?

Otherwise, is there a way of generating a list of every gridpoint so I can calculate the corners using brute force.

Thanks,

Lee




On Tue, Feb 2, 2016 at 12:10 AM -0800, "nek5000-users at lists.mcs.anl.gov" <nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>> wrote:

Hi

The adjoint implementation in nek assumes change of the direction of
time evolution. The goal is to use the standard nek solver with minimal
modifications (only advection terms have to be changed). You get these
equations from you standard one by changing the time and pressure sign
(t -> -t; p-> -p). This of course changes your time integration limits,
but it shouldn't be a problem. So when you  have your linear direct
simulation, to turn it into dual one it is enough to include  in your
userchk include files ADJOINT and TSTEP, and for ISTEP.eq.0 set
IFADJOINT to true. Something like:
       subroutine userchk

       include 'SIZE'
       include 'TSTEP'           ! ISTEP
       include 'ADJOINT'            ! IFADJ

       if(ISTEP.eq.0) ADJOINT=.TRUE.

There is no need to modify ###.rea or ###.map files. The only problem
are boundary conditions for open flows, as they would require
non-homogeneous bc. In this case to avoid problems we usually use
sufficiently large domain together with zero Dirichlet bc. The last
issue is sufficient resolution for both direct and adjoin runs. I hope
this gives you some idea about nek implementation.
Regards
Adam

On 2016-02-01 22:17, nek5000-users at lists.mcs.anl.gov wrote:
> Hi Neks,
>
> To my knowledge, Nek5000 is able to solve adjoint equations of the form:
> $\partial u_a/\partial t + V.\nabla u_a - u_a.(\nabla V)^T + \nabla
> \p_a + 1/Re \nabla^2 u_a=0$ and $\nabla.u_a=0$
> where u_a and p_a are adjoint velocity and pressure. (Slightly
> different formulation may be seen in literature).
>
> Let's assume the forward problem is already solved so that $V$, i.e.
> velocity, (and possibly $p$ as the pressure) is (are) already know.
> Thus, the initial and boundary conditions for adjoint NS are also
> known. How can we now solve the dual/adjoint NS problem with Nek5000?
> Is there any example on how to modify .rea files? Specailly, the
> "convection term of $V.\nabla u_a - u_a.(\nabla V)^T$ needs to be
> modified compared to forward NS but am not sure how.
> My search of mailing list entails some modifications in "perturb.f"
> subroutine, but a little bit more clarification on that would be
> really appreciated.
>
> Yours,
> Saleh
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users

_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20160303/67eefdce/attachment.html>


More information about the Nek5000-users mailing list