Hi! I am a new user of Nek5000. I have read through the User Documentation, and ran some simulations. Now it is time for me to start editing a file that a colleague wrote fo me. I therefore need to know how the .usr file is used. For example: In the User Documentation it is written that uservp() is called "once per processor, and once per discrete point therein". Does this mean that this is called once before the simulation is executed or is it called once per time step or in some other fashion? I would guess that uservp() is called once before the simulation is run, is that correct? Does thi apply to all routines in the .usr file, or are some of them called repeatedly during the simulation? userbc() for instance? I have been looking for a definition of the variables that are accessible in the separate routines. For instance, the input arguments to useric are (ix,iy,iz,ieg). I have gotten to understand that ix, iy and iz relate to a spatial coordinate in some way, and that ieg is some kind of index for the fluid element. Is there a precise definition of these names available? In addition to the input arguments it seems as you have access to more variables than the input arguments in each routine. In useric() you may for instance change ux, uy and uz. Is there a full list of all parameters that are available available? /Johan
Johan, Essentially every variable is accessible through the include files, NEKUSE and TOTAL. NEKUSE variables are mapped and derferenced by Nek, point by point and step by step, except for useric(), which is called prior to start of time stepping. One critically important consideration is to not invoke any communication (or any expensive operation) in uservp, userbc, useric, userf, userq. If you try to communicate (e.g., alpha = glmax(t,n) invokes global communication) there will be trouble because different processors can have different numbers of points and not all of them will call the user routines the same number of times. The run would hang in that case, not to mention be very expensive. Should you need to do something like, the right approach is to do the global operation in userchk, store the result in a common block, and pass this to the user routine in question. I think if you look through the examples you will come to understand the basic approach. Paul ________________________________ From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]] Sent: Monday, August 22, 2016 8:46 AM To: [email protected] Subject: [Nek5000-users] General functionality of the .usr file Hi! I am a new user of Nek5000. I have read through the User Documentation, and ran some simulations. Now it is time for me to start editing a file that a colleague wrote fo me. I therefore need to know how the .usr file is used. For example: In the User Documentation it is written that uservp() is called "once per processor, and once per discrete point therein". Does this mean that this is called once before the simulation is executed or is it called once per time step or in some other fashion? I would guess that uservp() is called once before the simulation is run, is that correct? Does thi apply to all routines in the .usr file, or are some of them called repeatedly during the simulation? userbc() for instance? I have been looking for a definition of the variables that are accessible in the separate routines. For instance, the input arguments to useric are (ix,iy,iz,ieg). I have gotten to understand that ix, iy and iz relate to a spatial coordinate in some way, and that ieg is some kind of index for the fluid element. Is there a precise definition of these names available? In addition to the input arguments it seems as you have access to more variables than the input arguments in each routine. In useric() you may for instance change ux, uy and uz. Is there a full list of all parameters that are available available? /Johan
Thank you! I found many of the variables I recognize in the NEKUSE-file. The TOTAL-file there are lines of the type 'include' DXYZ Is DXYZ a separate file (I could not find it in such case)? Or is it a module (or similar)? Where can I find the description of what is included in TOTAL? I will be aware of not invoking communication in the .usr routines. /Johan ________________________________ From: [email protected] <[email protected]> on behalf of [email protected] <[email protected]> Sent: Monday, August 22, 2016 4:38 PM To: [email protected] Subject: Re: [Nek5000-users] General functionality of the .usr file Johan, Essentially every variable is accessible through the include files, NEKUSE and TOTAL. NEKUSE variables are mapped and derferenced by Nek, point by point and step by step, except for useric(), which is called prior to start of time stepping. One critically important consideration is to not invoke any communication (or any expensive operation) in uservp, userbc, useric, userf, userq. If you try to communicate (e.g., alpha = glmax(t,n) invokes global communication) there will be trouble because different processors can have different numbers of points and not all of them will call the user routines the same number of times. The run would hang in that case, not to mention be very expensive. Should you need to do something like, the right approach is to do the global operation in userchk, store the result in a common block, and pass this to the user routine in question. I think if you look through the examples you will come to understand the basic approach. Paul ________________________________ From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]] Sent: Monday, August 22, 2016 8:46 AM To: [email protected] Subject: [Nek5000-users] General functionality of the .usr file Hi! I am a new user of Nek5000. I have read through the User Documentation, and ran some simulations. Now it is time for me to start editing a file that a colleague wrote fo me. I therefore need to know how the .usr file is used. For example: In the User Documentation it is written that uservp() is called "once per processor, and once per discrete point therein". Does this mean that this is called once before the simulation is executed or is it called once per time step or in some other fashion? I would guess that uservp() is called once before the simulation is run, is that correct? Does thi apply to all routines in the .usr file, or are some of them called repeatedly during the simulation? userbc() for instance? I have been looking for a definition of the variables that are accessible in the separate routines. For instance, the input arguments to useric are (ix,iy,iz,ieg). I have gotten to understand that ix, iy and iz relate to a spatial coordinate in some way, and that ieg is some kind of index for the fluid element. Is there a precise definition of these names available? In addition to the input arguments it seems as you have access to more variables than the input arguments in each routine. In useric() you may for instance change ux, uy and uz. Is there a full list of all parameters that are available available? /Johan
You need to look in each of the include files mentioned in TOTAL. SOLN GEOM are two of the most important. Best, Paul ________________________________ From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]] Sent: Monday, August 22, 2016 10:53 AM To: [email protected] Subject: Re: [Nek5000-users] General functionality of the .usr file Thank you! I found many of the variables I recognize in the NEKUSE-file. The TOTAL-file there are lines of the type 'include' DXYZ Is DXYZ a separate file (I could not find it in such case)? Or is it a module (or similar)? Where can I find the description of what is included in TOTAL? I will be aware of not invoking communication in the .usr routines. /Johan ________________________________ From: [email protected] <[email protected]> on behalf of [email protected] <[email protected]> Sent: Monday, August 22, 2016 4:38 PM To: [email protected] Subject: Re: [Nek5000-users] General functionality of the .usr file Johan, Essentially every variable is accessible through the include files, NEKUSE and TOTAL. NEKUSE variables are mapped and derferenced by Nek, point by point and step by step, except for useric(), which is called prior to start of time stepping. One critically important consideration is to not invoke any communication (or any expensive operation) in uservp, userbc, useric, userf, userq. If you try to communicate (e.g., alpha = glmax(t,n) invokes global communication) there will be trouble because different processors can have different numbers of points and not all of them will call the user routines the same number of times. The run would hang in that case, not to mention be very expensive. Should you need to do something like, the right approach is to do the global operation in userchk, store the result in a common block, and pass this to the user routine in question. I think if you look through the examples you will come to understand the basic approach. Paul ________________________________ From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]] Sent: Monday, August 22, 2016 8:46 AM To: [email protected] Subject: [Nek5000-users] General functionality of the .usr file Hi! I am a new user of Nek5000. I have read through the User Documentation, and ran some simulations. Now it is time for me to start editing a file that a colleague wrote fo me. I therefore need to know how the .usr file is used. For example: In the User Documentation it is written that uservp() is called "once per processor, and once per discrete point therein". Does this mean that this is called once before the simulation is executed or is it called once per time step or in some other fashion? I would guess that uservp() is called once before the simulation is run, is that correct? Does thi apply to all routines in the .usr file, or are some of them called repeatedly during the simulation? userbc() for instance? I have been looking for a definition of the variables that are accessible in the separate routines. For instance, the input arguments to useric are (ix,iy,iz,ieg). I have gotten to understand that ix, iy and iz relate to a spatial coordinate in some way, and that ieg is some kind of index for the fluid element. Is there a precise definition of these names available? In addition to the input arguments it seems as you have access to more variables than the input arguments in each routine. In useric() you may for instance change ux, uy and uz. Is there a full list of all parameters that are available available? /Johan
participants (1)
-
nek5000-users@lists.mcs.anl.gov