• Main Page
  • Classes
  • Files
  • File List
  • File Members

reconstruction/lr_states_dc.c

Go to the documentation of this file.
00001 #include "../copyright.h"
00002 /*============================================================================*/
00003 /*! \file lr_states_dc.c
00004  *  \brief First order (donor cell, piecewise constant) spatial reconstruction.
00005  *
00006  * PURPOSE: First order (donor cell, piecewise constant) spatial reconstruction.
00007  * - The L/R-states at the left-interface in each cell are indexed i.
00008  * - W_{L,i-1/2} is denoted by Wl[i  ];   W_{R,i-1/2} is denoted by Wr[i  ]
00009  * - W_{L,i+1/2} is denoted by Wl[i+1];   W_{R,i+1/2} is denoted by Wr[i+1]
00010  *
00011  * CONTAINS PUBLIC FUNCTIONS: 
00012  * - lr_states()          - computes L/R states
00013  * - lr_states_init()     - NoOp function in this case
00014  * - lr_states_destruct() - NoOp function in this case                        */
00015 /*============================================================================*/
00016 
00017 #include <math.h>
00018 #include <stdio.h>
00019 #include <stdlib.h>
00020 #include "../defs.h"
00021 #include "../athena.h"
00022 #include "prototypes.h"
00023 #include "../prototypes.h"
00024 
00025 #ifdef FIRST_ORDER
00026 
00027 /*----------------------------------------------------------------------------*/
00028 /*! \fn void lr_states(const GridS *pG, const Prim1DS W[], const Real Bxc[],
00029  *               const Real dt, const Real dx, const int il, const int iu,
00030  *               Prim1DS Wl[], Prim1DS Wr[], const enum DIRECTION dir)
00031  * \brief Computes L/R states 
00032  *
00033  * Input Arguments:
00034  * - W = PRIMITIVE variables at cell centers along 1-D slice
00035  * - Bxc = B in direction of slice at cell centers
00036  * - dtodx = dt/dx
00037  * - il,iu = lower and upper indices of zone centers in slice
00038  * W must be initialized over [il-1:iu+1]
00039  *
00040  * Output Arguments:
00041  * - Wl,Wr = L/R-states of PRIMITIVE variables at interfaces over [il:iu+1]
00042  */
00043 
00044 void lr_states(const GridS *pG, const Prim1DS W[], const Real Bxc[],
00045                const Real dt, const Real dx, const int il, const int iu,
00046                Prim1DS Wl[], Prim1DS Wr[], const enum DIRECTION dir)
00047 {
00048   int i;
00049 
00050   for (i=il; i<=iu+1; i++) {
00051     Wl[i] = W[i-1];
00052     Wr[i] = W[i  ];
00053   }
00054 
00055   return;
00056 }
00057 
00058 /*----------------------------------------------------------------------------*/
00059 /*! \fn void lr_states_init(MeshS *pM)
00060  *  \brief NoOp for first order, but included for compatibility
00061  *   with integrator (needed for 2nd and 3rd order). */
00062 
00063 void lr_states_init(MeshS *pM)
00064 {
00065   return;
00066 }
00067 
00068 /*----------------------------------------------------------------------------*/
00069 /*! \fn void lr_states_destruct(void)
00070  *  \brief NoOp for first order, but included for compatibility
00071  *   with integrator (needed for 2nd and 3rd order). */
00072 
00073 void lr_states_destruct(void)
00074 {
00075   return;
00076 }
00077 
00078 #endif /* FIRST_ORDER */

Generated on Mon Sep 27 2010 23:03:08 for Athena by  doxygen 1.7.1