[FLASH-USERS] basic question regarding variable defintions

Jason Galyardt jason.galyardt at gmail.com
Sat Nov 11 16:25:43 EST 2017


Hi Jon,

For macros that are used exclusively in a single unit, the best way to do
this (in my opinion) is to create a header file within that unit's
directory structure, define that macro in the header file, and then
#include that header in the appropriate source file within that unit.

However, you seem to be looking at a solution array variable, which
requires special care. These are all #defined in Flash.h automagically by
the 'setup' command, using the Config files associated with the included
FLASH units (Simulation, Grid, etc.). So, if you find that XYZ_VAR is not
defined in Flash.h after you have run the 'setup' command, you should first
look into whether you're missing a FLASH unit (or sub-unit) in your
Simulation Config file. If you're sure that you're not missing the unit
that defines and uses XYZ_VAR, you can define it in the appropriate Config
file via a VARIABLE statement (here's an example
<http://flash.uchicago.edu/site/flashcode/user_support/flash4_ug_4p4/node44.html>,
and here's the syntax documentation
<http://flash.uchicago.edu/site/flashcode/user_support/flash4_ug_4p4/node34.html>
).

Cheers,
Jason


On Sat, Nov 11, 2017 at 3:55 PM, Slavin, Jonathan <jslavin at cfa.harvard.edu>
wrote:

> Hi,
>
> I'm trying to debug some user contributed code that I modified. In that
> code there a line like:
> #ifdef XYZ_VAR
>     solnData(XYZ_VAR,x,y,z) = ...
> #endif
>
> So my question is, how should one define some variable XYZ_VAR?  In the
> Config file? It seems not like an ordinary variable definition since it's
> associated with the definition of solnData.  Any help would be appreciated.
>
> Regards,
> Jon
>
> --
> ________________________________________________________
> Jonathan D. Slavin                 Harvard-Smithsonian CfA
> jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> phone: (617) 496-7981       Cambridge, MA 02138-1516
> cell: (781) 363-0035             USA
> ________________________________________________________
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20171111/3dbff96d/attachment.htm>


More information about the flash-users mailing list