Athena++ Atmospheric Dynamics Code
- If a function returns more than one elementary variables, pass pointers as arguments.
- If a function returns complex variables, pass references.
- The returned variables are normally placed in the first few arguments in a function
- Exception #1: In MPI calls, the send argument is always placed in the first.
- Function names should begin with a lowercase verb indicating the action and dependent
words using initial capitals.
- Exception #1: conversion function can be named with either capitalized names or uncaptialized names to preserve symmetry. An example is deg2rad. It is allowed to use either 2 or To in the name of the conversion function.
- Exception #2: if a function name is a single verb, the verb should be capitalized. An example is Vectorize.
- Exception #3: C function names can be lowercase verb phrases concatenated by underscores.
- Class/structure names should be contatenated noun phrases capitalizating the first letter.
- Class/structure names should be in singular form.
- Class/structure names should not have underscores in the name.
- Variable names should begin with a lower case letter
- Variable names can contain underscores.
- Private or protected variables must contain an underscore at the end of the name.
- Variable names for pointers should start with the letter p.
- Exception #1: previous or next pointer in a linked list can be named as prev or *next.
- One dimensional arrays should be a C++ vector container.
- An one dimensional arrays is passed to a function by the pointer to its element and the size of the array.
- Spatially dependent multidimensional arrays are allocated as the AthenaArray
- Other multidimensional arrays are allocated by template functions.
- The units of a physical variable should use SI by default. Using units different from SI
should be specified by appending underscore units at the end of the variable name.
- Example #1: pres_bar means pressure in bars.
- Physical constants are declared as const Real const under a Class or under a Namespace.
- Use nullptr for null pointer.
- Use 2 spaces for indentation.
- Block documentation
- Function documentation
- Variable documentation
- Special commands
- \todo
- \bug
- \warning
- \deprecated