Coder Social home page Coder Social logo

alihyder727 / snap_working Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 110.62 MB

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.01% Python 0.46% C++ 94.84% Mathematica 0.01% Shell 0.02% C 0.74% Fortran 0.87% IDL 0.01% Roff 2.01% CMake 0.21% Cuda 0.09% JavaScript 0.01% CSS 0.01% Ruby 0.71% Perl 0.01% HTML 0.01% M4 0.01% Batchfile 0.01%

snap_working's Introduction

Simulating Non-hydrostatic Atmospheres on Planets (SNAP)

License

Build Status

Athena++ Atmospheric Dynamics Code

Coding Style Guide

Functions

  1. If a function returns more than one elementary variables, pass pointers as arguments.
  2. If a function returns complex variables, pass references.
  3. 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.
  4. 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.

Classes and structures

  1. Class/structure names should be contatenated noun phrases capitalizating the first letter.
  2. Class/structure names should be in singular form.
  3. Class/structure names should not have underscores in the name.

Variables

  1. Variable names should begin with a lower case letter
  2. Variable names can contain underscores.
  3. Private or protected variables must contain an underscore at the end of the name.
  4. 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

  1. One dimensional arrays should be a C++ vector container.
  2. An one dimensional arrays is passed to a function by the pointer to its element and the size of the array.

Multidimensional arrays

  1. Spatially dependent multidimensional arrays are allocated as the AthenaArray
  2. Other multidimensional arrays are allocated by template functions.

Choice of units

  1. 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

  1. Physical constants are declared as const Real const under a Class or under a Namespace.

Pointers

  1. Use nullptr for null pointer.

Indentation

  1. Use 2 spaces for indentation.

Documentation

  1. Block documentation
  2. Function documentation
  3. Variable documentation
  4. Special commands
    • \todo
    • \bug
    • \warning
    • \deprecated

snap_working's People

Contributors

alihyder727 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.