Instruction: Write an abstract for the following acadamic paper.

Input:
Paper: we have recorded the flight of a fly during take off and landing using digital high speed photography . it is shown that the dynamics of flexible wings are different for these procedures . during this observation fly flew freely in a big box and it was not tethered .
Abstract: in this fluid dynamics video , we demonstrated take off and landing of a fly . the deformation of wings is in focus in this video .

Paper: the ability to simulate hydrodynamic flow is key to studying most astrophysical objects . supernova explosions , gamma - ray bursts , x - ray bursts , classical novae , the outbursts of luminous blue variables ( lbvs ) , and stellar winds are just a few phenomena for which understanding and numerical tools evolve in tandem . this is due in part to the physical complexity , multi - dimensional character , and instabilities of such dynamical fluids . moreover , rotation is frequently a factor in the dynamical development of astrophysical transients . one - dimensional hydrodynamics is by and large a solved problem , but multi - dimensional hydrodynamics is still a challenge . in the context of astrophysical theory , this is due primarily to the need to address time - dependent gravitational potentials , complicated equations of state ( eoss ) , flexible grids , multi - d shock structures , and chaotic and turbulent flows . as a result , theorists who aim to understand the universe devote much of their time to code development and testing . one of the outstanding and complex problems in theoretical astrophysics is the mechanism for core - collapse supernovae . for more than two decades , the preferred mechanism of explosion has been the delayed neutrino mechanism @xcite . one - dimensional ( 1d ) simulations generally fail to produce explosions @xcite . however , 2-dimensional ( 2d ) simulations , and the accompanying aspherical instabilities , suggest that the neutrino - mechanism may indeed be viable @xcite , though this has yet to be proven . in fact , @xcite have recently reported an acoustic mechanism , which seems to succeed on long timescales when and if other mechanisms fail . these authors identified two primary reasons why this mechanism might have been missed before : 1 ) 2d radiation - hydrodynamic simulations with reasonable approximations are still expensive to run , and with limited resources simulations are rarely carried to late enough times ; and 2 ) , a noteworthy feature of the code they used , vulcan/2d , is its arbitrary lagrangian - eulerian ( ale ) structure . vulcan/2d incorporates non - standard grids that liberate the inner core from the courant and resolution limitations of standard spherical grids . in this context , @xcite claim that simulating all degrees of freedom leads to a new mechanism in which the gravitational energy in aspherical accretion is converted to explosion energy by first exciting protoneutron star core g - modes . these modes then radiate acoustic power and revive the stalled shock into explosion . remarkably , the acoustic mechanism , given enough time , leads to successful core - collapse supernovae in all progenitors more massive than @xmath19 m@xmath2 simulated to date @xcite . however , this is a remarkable claim , and given the implications , must be thoroughly investigated . for instance , one question to ask is : could the results seen by @xcite be numerical artifacts of vulcan ? therefore , to address this and other issues that surround the acoustic supernova mechanism , as well as a host of other outstanding astrophysical puzzles , we have designed the new hydrodynamic code , bethe - hydro , from the bottom up . bethe - hydro will be coupled with the 2d mixed - frame radiation transport scheme of @xcite to create the 2d radiation / hydrodynamics code bethe , and the merger of these two codes will be the subject of a future paper . in this paper , we present and test the hydrodynamic and gravity algorithms of bethe - hydro . since bethe - hydro uses arbitrary grids and a general gravity solver , we expect it to be a powerful and flexible numerical tool , able to configure the grid to suit the computational challenge . the core of bethe - hydro is a 1d and 2d ale hydrodynamics solver . first , solutions to the lagrangian hydrodynamic equations are obtained on an arbitrary polygonal grid . then , to avoid tangled grids , the hydrodynamic variables can be remapped to another grid . a unique and powerful feature of ale schemes is their flexibility to tailor an arbitrary grid to the computational challenge and to alter the grid dynamically during runtime . hence , purely lagrangian , purely eulerian , or arbitrarily moving grids ( chosen to optimize numerical performance and resolution ) are possible . these grids can be non - orthogonal , non - spherical , and non - cartesian . some of the earliest 2d hydrodynamic simulations in astrophysics were , in fact , performed to address the core - collapse problem . while some employed standard fixed - grid schemes @xcite , other 2d simulations were calculated with adaptive grids . although many utilized moving grids , for the most part , the differencing formulations were eulerian @xcite . on the other hand , @xcite did employ an `` euler - lagrange '' method involving a lagrangian hydrodynamic solve , followed by a remapping stage . even though these simulations did exploit radially dynamical grids , they were restricted to be orthogonal and spherical . many of the current hydrodynamic algorithms used in astrophysics are based upon either zeus @xcite or higher - order godunov methods , in particular the piecewise - parabolic method ( ppm ) @xcite . both approaches have been limited to orthogonal grids . one concern with ppm - based codes is that they solve the hydrodynamic equations in dimensionally - split fashion . as a result , there have been concerns that these algorithms do not adequately resolve flows that are oblique to the grid orientation . rectifying this concern , recent unsplit higher - order godunov schemes , or approximations thereof , have been developed @xcite . despite this and the employment of adaptive mesh refinement ( amr ) , these codes must use orthogonal grids that are often strictly cartesian .    in bethe - hydro , we use finite - difference schemes based upon the support - operator method @xcite of @xcite and @xcite . differencing by this technique enables conservation of energy to roundoff error in the absence of rotation and time - varying gravitational potentials . similarly , momentum is conserved accurately , but due to the artificial viscosity scheme that we employ , it is conserved to roundoff error for hydrodynamic simulations using cartesian coordinates only . moreover , using the support - operator method and borrowing from an adaptation of the support - operator technique for elliptic equations @xcite , we have developed a gravity solver for arbitrary grids . unfortunately , by including a general gravity capability , we sacrifice strict energy and momentum conservation . however , we have performed tests and for most cases the results are reasonably accurate . furthermore , we have included rotational terms and we use a modified version of the subcell pressure scheme to mitigate hourglass instabilities @xcite .    to resolve shocks , we employ an artificial viscosity method , which is designed to maintain grid stability as well @xcite , and there are no restrictive assumptions made about the equation of state . higher - order godunov techniques employ riemann solvers to resolve shocks , but frequently need an artificial viscosity scheme to eliminate unwanted post - shock ringing . moreover , the inner workings of riemann solvers often make local approximations that the eos has a gamma - law form , which stipulates that as the internal energy goes to zero so does the pressure . for equations of state appropriate for core - collapse supernovae , this artificially imposed zero - point energy can pose problems for the simulations @xcite . two codes in astrophysics which have already capitalized on the arbitrary grid formulations of ale are djehuty @xcite and vulcan/2d @xcite . in both cases , the grids employed were designed to be spherical in the outer regions , but to transition smoothly to a cylindrical grid near the center . these grid geometries reflected the basic structure of stars , while avoiding the cumbersome singularity of a spherical grid . with this philosophy , @xcite , using djehuty , have studied the helium core flash phase of stellar evolution in 3d . in the core - collapse context , @xcite , using vulcan/2d , performed 2d radiation / hydrodynamic and radiation / mhd simulations with rotation . several gravity solvers have been employed in astrophysics . the most trivial are static or monopole approaches . for arbitrary potentials , the most extensively used are n - body schemes , which fit most naturally in smooth particle hydrodynamics ( sph ) codes @xcite . as a virtue , sph solves the equations in a grid - free context , and while sph has opened the way to three - dimensional ( 3d ) hydrodynamic simulations in astrophysics , including core - collapse simulations @xcite , the smoothing kernels currently employed pose serious problems for simulating fundamental hydrodynamic instabilities such as the kelvin - helmholtz instability @xcite . another approach to the solution of poisson s equation for gravity is the use of multipole expansions of the potential @xcite . this technique achieves its relative speed by calculating simple integrals on a spherical grid once . then , the stored integrals are used in subsequent timesteps . in bethe - hydro , we construct finite - difference equations for poisson s equation using the support - operator method and find solutions to the resulting linear system of equations for the potentials via an iterative multigrid - preconditioned conjugate - gradient method @xcite .    in  [ section : bethe_hydro ] , we give a summary of bethe - hydro and sketch the flowchart of the algorithm . the coordinates and mesh details are discussed in  [ section : coords_mesh ] . we then describe in  [ section : lag_hydro ] the discrete lagrangian equations , including specifics of the 2@xmath0-order time - integration and rotational terms . section [ section : gravity ] gives a complete description of the 1d and 2d gravity solvers . hydrodynamic boundary conditions are discussed in  [ section : hydro_boundary ] . the artificial viscosity algorithm that provides shock resolution and grid stability is described in  [ section : artificial_viscosity ] . in  [ section : hourglass ] , we present the subcell pressure scheme that suppresses hourglass modes . remapping is described in depth in  [ section : remap ] . in  [ section : tests ] , we demonstrate the code s strengths and limitations with some test problems . finally , in  [ section : discussion ] we summarize the central characteristics and advantages of bethe - hydro . in ale algorithms , the equations of hydrodynamics are solved in lagrangian form . within this framework , equations for the conservation of mass , momentum , and energy are : @xmath3 @xmath4 and @xmath5 @xmath6 is the mass density ( which we refer to simply as `` density '' and is distinct from the energy or momentum densities ) , @xmath7 is the fluid velocity , @xmath8 is the gravitational potential , @xmath9 is the isotropic pressure , @xmath10 is the specific internal energy , and @xmath11 is the lagrangian time derivative . the equation of state may have the following general form : @xmath12 where @xmath13 denotes the mass fraction of species @xmath14 . therefore , we also solve the conservation equations : @xmath15 completing the set of equations for self - gravitating astrophysical flows is poisson s equation for gravity : @xmath16 where @xmath17 is newton s gravitational constant . all ale methods have the potential to solve eqs . ( [ eq : mass_lag]-[eq : ene_lag ] ) using arbitrary , unstructured grids . in this lies the power and functionality of ale methods . the solutions involve two steps and are conceptually quite simple : 1 ) a lagrangian solver moves the nodes of the mesh in response to the hydrodynamic forces ; and 2 ) to avoid grid tangling , the nodes are repositioned , and a remapping algorithm interpolates hydrodynamic quantities from the old grid to this new grid . of course , the challenge is to find accurate solutions , while conserving energy and momentum . in constructing bethe - hydro to satisfy these requirements , we use the ale hydrodynamic techniques of @xcite , @xcite , @xcite , and @xcite .    to summarize the overall structure of bethe - hydro , we present a schematic flowchart , fig . [ flowchart ] , and briefly describe the key steps . establishing the structure for all subsequent routines , the first step is to construct the arbitrary , unstructured grid . this leads to the next step , problem initialization . then , the main loop for timestep integration is entered . after a call to the eos to obtain the pressure , solutions to poisson s equation for gravity are calculated using either the 2d or 1d algorithms in  [ section : gravity ] . both use the support - operator method to discretize eq . ( [ eq : poisson ] ) , and the resulting system of linear equations is solved by a tridiagonal solver in 1d and a multigrid pre - conditioned conjugate - gradient iterative method in 2d (  [ section : gravity ] ) .    after the timestep is calculated (  [ section : predictor_corrector ] ) , the lagrangian equations of hydrodynamics are solved on an arbitrary grid using the compatible hydrodynamics algorithm of @xcite ( see  [ section : lag_hydro ] for further discussion ) . to ensure 2nd - order accuracy in both space and time , we employ a predictor - corrector iteration (  [ section : predictor_corrector ] ) , in which a second call to the eos and the gravity solver are required . other than the gravity solver block , the lagrangian hydrodynamics solver (  [ section : lag_hydro ] ) is represented by the set of steps beginning with predictor and ending with corrector ( fig . [ flowchart ] ) .    after finding lagrangian hydrodynamic solutions at each timestep , one could proceed directly to the next timestep , maintaining the lagrangian character throughout the simulation . however , in multiple spatial dimensions , grid tangling will corrupt flows with significant vorticity . in these circumstances , we conservatively remap the lagrangian solution to a new arbitrary grid that mitigates tangled grids . the new grid may be the original grid , in which case we are solving the hydrodynamic equations in the eulerian frame , or it may be a new , arbitrarily - defined , grid . in bethe - hydro , eqs . ( [ eq : mass_lag]-[eq : poisson ] ) may be solved with any of several coordinate systems and assumed symmetries . included are the standard 1d & 2d cartesian coordinate systems . for astrophysical applications , we use 1d spherical and 2d cylindrical coordinate systems . irrespective of the coordinate system , we indicate a position by @xmath18 . the components of the cartesian coordinate system are @xmath19 and @xmath20 ; the spherical components are @xmath21 , @xmath22 , and @xmath23 ; and the cylindrical coordinates are @xmath21 , @xmath24 , and @xmath23 . distinct from the coordinate system is the grid , or mesh , which defines an arbitrary discretization of space . it is this unique feature and foundation of ale techniques that provides their flexibility . figure [ grid_ex ] shows two example grids : the butterfly mesh on the left and a spiderweb mesh on the right . either may be used in a 2d cartesian or 2d cylindrical simulations , although the placement of the nodes is neither cartesian nor cylindrical . instead , these meshes have been designed to simulate spherically or cylindrically convergent phenomena without the limitation of small zones near the center . when using cylindrical coordinates in ale algorithms , one may use control - volume differencing ( cvd ) or area - weighted differencing ( awd ) ; we use cvd . thorough comparisons of these two differencing schemes may be found in @xcite . here , we give a basic justification for choosing cvd . for cvd , the volumes of the subcell , cell , and node are calculated by straightforward partitioning of these regions by edges . hence , volumes and masses are exact representations of their respective regions . while this discretization is natural and easy to comprehend , it does not preserve strict spherical symmetry when using a spherical grid and cylindrical coordinates . on the other hand , awd is designed to preserve spherically symmetric flows , but only with the use of spherical grids that have equal spacing in angle . since this prevents the use of arbitrary grids , and the asymmetries of cvd are small , we use cvd for discretization .    construction of the grid begins with the arbitrary placement of nodes . at these nodes , coordinate positions , velocities , and accelerations are defined . simply specifying node locations does not completely define a mesh , since there is not a unique way to assign cells and masses to these nodes . therefore , the user must specify the connectivity among nodes , which define the arbitrarily - shaped polygonal cells . it is within these cells that cell - centered averages of @xmath6 , @xmath10 , @xmath9 , @xmath13 , and @xmath8 are defined .    with the node positions , their connectivity , and the cells defined , a mesh is completely specified and all other useful descriptions follow . cells are denoted by @xmath24 , and nodes are indexed by @xmath25 . the set of nodes that defines cell @xmath24 are @xmath26 , where the nodes are ordered counterclockwise . conversely , the set of cells that shares node @xmath25 is denoted by @xmath27 . each cell has @xmath28 nodes that define it , and each node has @xmath29 cells that share it . the sample sub - grid depicted in fig . [ fig : grid ] helps to illustrate the nodal and cell structure . the filled circles indicate node positions , @xmath30 , and the crosses indicate the cell - center positions , @xmath31 . the solid lines are direction - oriented edges that separate cells from one another , and the open circles indicate their mid - edge locations . partitioning the cell into subcells , the dashed lines connect the mid - edges with the cell centers . no matter how many sides a cell has , with this particular division the subcells are always quadrilaterals . naturally , the cell volumes ( see appendix [ section : integrals ] for formulae calculating discrete volumes ) , @xmath32 , are related to the subcell volumes , @xmath33 , by @xmath34 furthermore , each node has a volume , @xmath35 , defined by the adjoining subcells that share the node @xmath25 : @xmath36 for calculating pressure forces and fluxes , vectors are assigned to each half edge on either side of node @xmath25 : @xmath37 and @xmath38 , where @xmath39 indicates the half edge in the counterclockwise direction around the cell and @xmath40 indicates its opposite counterpart . their magnitudes are the areas represented by the half edges , and their directions point outward and normal to the surface of cell @xmath24 . from these half - edge area vectors , an area vector , @xmath41 , that is associated with zone @xmath24 and node @xmath25 is then defined : @xmath42 similarly , vectors are associated with the lines connecting the mid - edges and the cell centers : @xmath43 . again , their magnitudes are the corresponding area , but while the vector is normal to this line , the direction is oriented counterclockwise around the cell . the fundamental assumption of lagrangian algorithms is that the mass , @xmath44 , of a discrete volume @xmath32 is constant with time . for staggered - grid methods , in which scalars are defined as cell - centered averages and vectors are defined at the nodes , it is necessary to define a lagrangian mass , @xmath45 , for the nodes as well . this nodal mass is associated with the node s volume @xmath35 ( eq . [ eq : volume_node ] ) . conservation of mass ( eq . [ eq : mass_lag ] ) implies zero mass flux across the boundaries , @xmath46 , of either the cell volume or nodal volume . therefore , the region of overlap for @xmath32 and @xmath35 , which is the subcell volume @xmath33 , is bounded by surfaces with zero mass flux . consequently , the most elemental lagrangian mass is the subcell mass , @xmath47 , and the cell mass ( @xmath44 ) and node mass ( @xmath45 ) are constructed as appropriate sums of subcell masses : @xmath48 and @xmath49 hence , we arrive at three discrete forms of mass conservation ( eq . [ eq : mass_lag ] ) : @xmath50    in defining the discrete momentum and energy equations , we use the compatible hydrodynamics algorithms developed by @xcite . specifically , the discrete divergence and gradient operators are _ compatible _ in that they faithfully represent their analog in continuous space _ and _ their definitions are expressly related to one another using the hydrodynamic expressions for conservation of momentum and energy . as a result , this approach leads to discretizations that satisfy momentum and energy conservation to machine accuracy . this is accomplished with the support - operator method @xcite . given the integral identity , @xmath51 where @xmath8 is any scalar and @xmath52 is some vector , there is an incontrovertible connection between the divergence and gradient operators . for many choices of discretization , the discrete counterparts of these operators could violate this integral identity . simply put , the goal of the support - operator method is to define the discrete operators so that they satisfy eq . ( [ eq : intidentity ] ) . the first step is to define one of the discrete operators . it is often , but not necessary , that the discrete divergence operator is defined via gauss s law : @xmath53 and then eq . ( [ eq : intidentity ] ) is used to compatibly define the other discrete operator . discretizing the hydrodynamic equations , @xcite begin by defining @xmath54 at the nodes and use the integral form of energy conservation and an equation equivalent to eq . ( [ eq : intidentity ] ) to define for each cell the discrete divergence of the velocity , @xmath55 .    to begin , @xcite integrate eq . ( [ eq : mom_lag ] ) ( excluding gravity and rotational terms ) over the volume of node @xmath25 , producing the discrete form for @xmath56 and the momentum equation : @xmath57 where @xmath58 is the change in velocity from timestep @xmath59 to the next timestep @xmath60 , the timestep is @xmath61 , and @xmath62 is the pressure in cell @xmath24 . in other words , the net force on node @xmath25 is a sum of the pressure times the directed zone areas that share node @xmath25 . hence , the subcell force exerted by zone @xmath24 on point @xmath25 is @xmath63 . a more complete description of the subcell force , however , must account for artificial viscosity (  [ section : artificial_viscosity ] ) : @xmath64 where @xmath65 is the subcell force due to artificial viscosity . furthermore , in this work , we include gravity and rotation for 2d axisymmetric simulations , and the full discrete momentum equation becomes @xmath66 where @xmath67 and @xmath68 are the gravitational and rotational accelerations , respectively . for simplicity , and to parallel the discussion in @xcite , we ignore these terms in the momentum equation and proceed with the compatible construction of the energy equation ( see  [ section : consenerot ] and  [ section : consenegravity ] for discussions of total energy conservation including rotation and gravity , respectively ) .    to construct the discrete energy equation , @xcite integrate eq . ( [ eq : ene_lag ] ) over the discrete volume of cell @xmath24 : @xmath69 where @xmath70 . then , the objective is to determine a discrete form for the right hand side of this equation that conserves energy and makes the discrete gradient and divergence operators compatible . @xcite accomplish this with the integral for conservation of energy ( neglecting gravity ) : @xmath71 where the second expression is the integral identity , eq . ( [ eq : intidentity ] ) , that defines the physical relationship between the gradient and divergence operators . neglecting boundary terms , the discrete form of this integral is @xmath72 where we used @xmath73 , @xmath74 , and substituted in eq . ( [ eq : mom_discrete1 ] ) . if we set the expression for each zone in eq . ( [ eq : enecons_discrete ] ) to zero , we arrive at the compatible energy equation : @xmath75 the rhs of eq . ( [ eq : ene_discrete ] ) is merely the @xmath76 work term of the first law of thermodynamics . its unconventional form is a consequence of the support - operator method . thus , we derive two significant results . first , inspection of eqs . ( [ eq : ene_discrete ] ) and ( [ eq : mom_discrete1 ] ) leads to compatible definitions for the discrete gradient and divergence operators . specifically , the discrete analogs of the gradient and divergence operators are @xmath77 and @xmath78 second , eqs . ( [ eq : mass_discrete ] ) , ( [ eq : mom_discrete1 ] ) , and ( [ eq : ene_discrete ] ) form the compatible discrete equations of lagrangian hydrodynamics .      in its current form , bethe - hydro strictly conserves momentum for simulations that use cartesian coordinates and not cylindrical coordinates . @xcite show that the requirement for strict conservation is the use of control - volume differencing , or that exact representations of cell surfaces are employed . as a simple example , consider momentum conservation with pressure forces only : @xmath79 for cartesian coordinates , the sum @xmath80 is exactly zero for each cell as long as the surface - area vectors are exact representations of the cell s surface . this is not the case for area - weighted differencing , and hence momentum is not conserved in that case . for cylindrical coordinates , the sum of surface - area vectors gives zero only for the @xmath24-component . however , the assumption of symmetry about the cylindrical axis ensures momentum conservation for the @xmath21-component . therefore , control - volume differencing ensures momentum conservation , even with the use of cylindrical coordinates .    based upon similar arguments , the subcell - pressure forces that eliminate hourglass motions (  [ section : hourglass ] ) are formulated to conserve momentum for both cartesian and cylindrical coordinates . on the other hand , because we multiply the cartesian artificial viscosity force by @xmath81 to obtain the force appropriate for cylindrical coordinates , the artificial viscosity scheme (  [ section : artificial_viscosity ] ) that we employ is conservative for cartesian coordinates only . we test momentum conservation with the sedov blast wave problem (  [ section : sedov ] ) using cartesian and cylindrical coordinates . symmetry dictates conservation in the @xmath21-component of the momentum . consequently , we compare the @xmath24-component of the total momentum at @xmath82 s with subsequent times . since the initial momentum of this test is zero , we obtain a relative error in momentum by @xmath83 , where @xmath84 is the @xmath24-component of the total momentum at time @xmath85 and @xmath86 is a similar quantity for @xmath87 . as expected , the relative error using cartesian coordinates reflects roundoff error . for cylindrical coordinates and 35,000 cells , the relative error in momentum is @xmath88 after 0.8 s and 71,631 timesteps . although momentum is strictly conserved for simulations using cartesian coordinates only , the sedov blast wave problem demonstrates that momentum is conserved very accurately , even when cylindrical coordinates are used . our method is explicit in time . therefore , for numerical convergence , we limit the timestep , @xmath61 , to be smaller than three timescales . by the courant - friedrichs - levy ( cfl ) condition we limit @xmath61 to be smaller than the shortest sound - crossing time and the time it takes flow to traverse a cell . the latter condition is useful to avoid tangled meshes and is necessary when remapping is used . in addition , it is limited to be smaller than the fractional change in the volume represented by @xmath55 . in calculating these timescales a characteristic length for each cell is needed . given arbitrary polygonal grids , we simply use the shortest edge for each cell . in practice , the timestep is the shortest of these timescales multiplied by a scaling factor , cfl . in our calculations , we set @xmath89 .    to ensure second - order accuracy and consistency with the time levels specified in eqs . ( [ eq : mom_discrete2 ] ) and ( [ eq : ene_discrete ] ) , we employ predictor - corrector time integration using the finite difference stencil from @xcite . for each timestep , the current time level of each quantity is identified with @xmath59 in superscript . the time - centered quantities are indicated with a @xmath90 superscript , while the predicted values are labeled @xmath91 , and the fully updated values for the next timestep are labeled with a @xmath60 superscript . table [ table : predictor - corrector ] lists the steps for the predictor - corrector integration . the predictor step begins by defining the forces on nodes , @xmath92 , using current pressures @xmath93 , areas @xmath94 , and artificial viscosity forces @xmath95 . ( [ eq : mom_discrete2 ] ) is then used to calculate the predicted velocity , @xmath96 . the predicted node coordinate is then calculated by @xmath97 , where @xmath98 is the time - centered velocity computed as @xmath99 . then , using @xmath92 and @xmath98 in eq . ( [ eq : ene_discrete ] ) , the predicted specific internal energy , @xmath100 , is obtained . using the predicted node positions , the predicted rotational acceleration ( @xmath101 ) , volume ( @xmath102 ) , and density ( @xmath103 ) , are computed , which in turn are used to calculate the predicted gravitational acceleration , @xmath104 . calling the eos with @xmath100 and @xmath103 gives the predicted pressure @xmath105 . we finish the predictor step and prepare for the corrector step by calculating the time - centered positions @xmath106 , pressures @xmath107 , rotational accelerations @xmath108 , and gravitational accelerations @xmath109 as simple averages of their values at the @xmath110 and @xmath59 time levels . the corrector step then proceeds similarly to the predictor step . @xmath107 and @xmath111 are used to compute @xmath112 , which in turn is used to compute the updated velocity , @xmath113 . after computing the new time - centered velocity , the node coordinates are finally updated using the time - centered velocity . then , the specific internal energy , @xmath114 , is updated using @xmath112 and @xmath98 . finally , the volume , @xmath115 , and density @xmath116 are computed for the next timestep .      in 2d simulations using cylindrical coordinates , we have extended bethe - hydro to include rotation about the axis of symmetry . for azimuthally symmetric configurations , all partial derivatives involving @xmath23 are zero . consequently , the conservation of mass and energy equations are @xmath117 and @xmath118 where the @xmath119 subscript on the del operator reminds us that the derivatives with respect to @xmath23 vanish . for concise notation , we define a pseudo lagrangian derivative : @xmath120 while eqs . ( [ eq : mass_lag_rot ] ) and ( [ eq : ene_lag_rot ] ) are simple extensions of the true mass ( eq . [ eq : mass_lag ] ) and energy ( eq . [ eq : ene_lag ] ) equations , the presence of `` christoffel '' terms in the momentum equation give it extra terms : @xmath121 where the extra rotational terms are represented by @xmath122 : @xmath123    to see the origin of these extra terms , one must begin with the momentum equation in cylindrical coordinates and eulerian form : @xmath124 again , dropping terms involving partial derivatives of @xmath23 , and moving all terms not involving partial derivatives to the right - hand side ( rhs ) , eq . ( [ eq : mom_cyl ] ) reduces to @xmath125 hence , using our definition for the pseudo lagrangian derivative , @xmath126 , and @xmath127 in eq . ( [ eq : mom_azsymmetric ] ) we obtain eq . ( [ eq : mom_lag_rot ] ) . it is now apparent why @xmath126 is a pseudo lagrangian derivative . strictly , the `` extra '' rotational terms are a result of `` christoffel '' terms in the true lagrangian derivative . therefore , in defining @xmath126 without them , we ve defined a pseudo lagrangian derivative .    conveniently , the @xmath23 component of eq . ( [ eq : mom_lag_rot ] ) , @xmath128 is simply a statement of the conservation of angular momentum about the axis of symmetry : @xmath129 where @xmath130 is the angular momentum about the @xmath24-axis of a lagrangian mass . other than the appearance of an extra term on the rhs of the @xmath21-component and of an equation for the @xmath23 component in eq . ( [ eq : mom_lag_rot ] ) , the 2d hydrodynamic equations including rotation about the @xmath24-axis are similar to the equations without rotation . therefore , the algorithms for dynamics in the 2d plane remain the same , except for the inclusion of the conservation of angular momentum equation and the fictitious force term . it seems natural to define @xmath131 and @xmath132 , where @xmath133 is the angular velocity of node @xmath25 . in fact , our first implementation of rotation did just this . however , results indicated that this definition presents problems near the axis of rotation . whether @xmath134 or @xmath133 is defined , the angular momentum at node @xmath25 is associated with the region of subcells that comprise the node s volume . for the nodes on the axis , this definition states that @xmath135 since @xmath136 , which implies that the angular momentum for the region of subcells near the axis is zero . this awkward feature causes no problems for lagrangian calculations with no remapping . however , during the subcell remapping step , the subcells near the axis contain no angular momentum , yet physically there should be some angular momentum to be remapped . therefore , we have devised an alternative method for including rotational terms in 2d simulations . just as for mass , the angular momentum of a subcell , @xmath137 , is a primary indivisible unit , which by eq . ( [ eq : cons_ang ] ) is constant during a lagrangian hydrodynamic timestep . the angular momentum for a cell is @xmath138 and for each node is @xmath139 to relate angular velocity and @xmath140 to the angular momentum , we treat each subcell as a unit with constant angular velocity . for such regions of space the angular momentum is related to the angular velocity by @xmath141 where @xmath142 is the moment of inertia for subcell @xmath143 . since we are interested in accelerations and velocities at the nodes , we choose that @xmath144 , which naturally leads to @xmath145 substituting eq . ( [ eq : define_jzp ] ) into eq . ( [ eq : define_jp ] ) , we define a relationship between the angular momentum at the nodes and the angular velocity at the nodes : @xmath146 where @xmath147 by conservation of angular momentum , @xmath148 , the angular velocity at the @xmath60 timestep , @xmath149 , is @xmath150    finally , a new form for the @xmath21-component of @xmath68 is constructed . the previously defined form is @xmath151 , and having @xmath21 in the denominator poses numerical problems near and at @xmath152 . since @xmath153 , the new half timestep acceleration is @xmath154      without rotation and time - varying gravity , the equations for 2d simulations using cylindrical coordinates conserve energy to machine precision . however , with rotation , strict energy conservation is lost . using the equations for energy and momentum including rotation , eqs . ( [ eq : ene_lag_rot ] ) and ( [ eq : mom_lag_rot ] ) the energy integral becomes @xmath155 since the terms @xmath156 and @xmath157 are equal in magnitude and opposite in sign , the rate of change for the total energy reduces to the usual surface integral : @xmath158 if the form of the energy equation is to remain the same , discrete versions of @xmath156 and @xmath157 must be derived that cancel one another .    in the previous section , we made arguments not to use @xmath159 . however , it is simpler and more intuitive to illustrate why the 2d equations , including rotation , can not satisfy strict energy conservation , while satisfying angular momentum conservation . with conservation of angular momentum we have @xmath160 or @xmath161 the discrete time derivative of @xmath140 is then @xmath162 where we have used @xmath163 . this specifics the required time levels for the components of @xmath164 to conserve angular momentum . considering time integration , the discrete analog of @xmath165 is @xmath166 . to ensure that this sums to zero , the discrete analog of @xmath167 is @xmath168 with these time levels , the 2d equations , which include rotation , would satisfy energy and angular momentum conservation to round - off error however , @xmath169 and @xmath170 are not known at the beginning of the timestep . it is only after the predictor step of the predictor - corrector method that @xmath170 and @xmath171 are obtained . as a result , @xmath167 , including the correct time levels and predictor values , is @xmath172 but to conserve angular momentum and energy , @xmath169 appears in the denominator . therefore , the terms @xmath173 and @xmath174 will not be exactly opposite and equal in magnitude , and angular momentum and energy conservation can not be enforced to machine precision at the same time .    in the previous section , we motivated a different discretization of angular momentum , angular velocity , and @xmath140 . however , the basic results of this section do not change . there is still the fundamental problem that to strictly conserve angular momentum , positions at the @xmath60 time level are required , while one must use the predicted , @xmath91 , values in updating the radial velocity . sacrificing strict energy conservation , we have chosen to strictly conserve angular momentum for simulations including rotation . we have designed a test that isolates and tests rotation . using cylindrical coordinates , the calculational domain lies in the @xmath175 plane and extends from the symmetry axis , @xmath176 , to @xmath177 cm and from @xmath178 cm to @xmath179 cm . the initial density is homogeneous with @xmath180 g @xmath181 . isolating the rotational forces , we eliminate pressure gradients by setting the internal energy everywhere to zero . consequently , the trajectory of a lagrangian mass is a straight line in 3d and has a very simple analytic evolution for @xmath182 , determined only by its initial position and velocity . we set @xmath183 and give @xmath140 and @xmath184 homologous profiles : @xmath185 cm s@xmath186 and @xmath187 cm s@xmath186 . this produces a homologous self - similar solution for @xmath184 and @xmath140 that our algorithm for rotation should reproduce .    in figure [ rottestplot ] , plots of @xmath140 vs. @xmath21 ( top panel ) and @xmath188 vs. @xmath21 panel ( bottom ) show that bethe - hydro performs well with this test . simultaneously testing the rotational remapping (  [ section : ang_vel_remap ] ) and hydrodynamic algorithms , we employ three remapping regions . the inner 0.1 cm is eulerian , zones exterior to 0.2 cm follow lagrangian dynamics , and the region in between provides a smooth transition between the two domains . both @xmath140 and @xmath188 profiles are presented at @xmath189 , and @xmath190 s. as designed the angular momentum is conserved to machine accuracy . in the top panel ( @xmath140 vs. @xmath21 ) , it is hard to discern any deviation of the simulation ( crosses ) from the analytic solution ( solid line ) . in fact , the maximum error as measured by @xmath191 ranges from @xmath192 near the beginning of the simulation to @xmath193 at the end . @xmath188 vs. @xmath21 ( bottom panel ) shows similar accuracy , except for the region near the axis . at the center @xmath194 reaches a maximum value of 0.2 rads s@xmath186 at @xmath195 s. on the whole , fig . [ rottestplot ] demonstrates that this code reproduces the analytic result with and without remapping . there are two general strategies for solving poisson s equation for gravity on arbitrary grids . the first is to define another regular grid , interpolate the density from the hydro grid to this new gravity grid , and use many of the standard poisson solvers for regular grids . however , in our experience this approach can lead to numerical errors , which may lead to unsatisfactory results . the second approach is to solve eq . ( [ eq : poisson ] ) explicitly on the arbitrary hydro grid , eliminating an interpolation step . we prefer the latter approach , giving potentials and accelerations that are more consistent with the hydrodynamics on an unstructured mesh .    in determining the discrete analogs of eq . ( [ eq : poisson ] ) , we use the support - operator method . after a bit of algebra these discrete equations may be expressed as a set of linear equations whose unknowns are the discretized gravitational potentials . solving for these potentials is akin to solving a matrix equation of the form , @xmath196 , and since the solutions change little from timestep to timestep , we use an iterative matrix inversion approach in which the initial guess is the solution from the previous timestep .    in solving poisson s equation for gravity , we seek an algorithm satisfying the following conditions : 1 ) the potential should be defined at zone centers and the gravitational acceleration should be defined at the nodes ; 2 ) we should conserve momentum and energy as accurately as possible ; and 3 ) the solver must be fast . to this end , we employ the method described in @xcite , @xcite , and @xcite for elliptic solvers . specifically , we follow the particular implementation of @xcite .    applying the support - operator method , we first define the divergence operator and , in particular , define @xmath197 . poisson s equation for gravity may be written as an equation for the divergence of the acceleration , @xmath198 where @xmath199 , the gravitational acceleration , is the negative of the gradient of the potential . @xmath200 integrating eq . ( [ eq : poisson_div ] ) over a finite volume gives @xmath201 and if the volume of integration , @xmath202 , is chosen to be that of a cell , the rhs of eq . ( [ eq : divtheorem ] ) becomes @xmath203 . in discretizing the middle term in eq . ( [ eq : divtheorem ] ) , @xmath204 an expression for the divergence of @xmath199 follows naturally : @xmath205 where @xmath206 is the area of edge @xmath207 , and @xmath208 is the component of the acceleration parallel to the direction of the edge s area vector . therefore , substituting eq . ( [ eq : discretediv ] ) into eq . ( [ eq : divtheorem ] ) suggests a discrete expression for eq . ( [ eq : poisson_div ] ) : @xmath209    having defined the discrete divergence of a vector , we then use the support - operator method to write the discrete equivalent of the gradient . once again , the integral identity relating the divergence and gradient operators is given by eq . ( [ eq : intidentity ] ) . applying the definition for the discrete divergence , the first term on the lhs of eq . ( [ eq : intidentity ] ) is approximated by @xmath210 where @xmath211 is the component of @xmath52 perpendicular to edge @xmath207 , and the rhs of eq . ( [ eq : intidentity ] ) is approximated by @xmath212 it is already apparent that the discrete potential is defined for both cell centers ( @xmath213 ) and edges ( @xmath214 ) . this fact seems cumbersome . however , we will demonstrate below that in the final equations the number of unknowns may be reduced by eliminating the cell - centered potentials , @xmath213 , in favor of the edge - centered potentials , @xmath214 . completing the discretization of eq . ( [ eq : intidentity ] ) , the second term on the lhs is @xmath215 where @xmath216 is a volumetric weight and @xmath217 and @xmath67 are defined at the nodes . the volumetric weight associated with each corner is defined as one quarter of the area of the parallelogram created by the sides that define the corner . additionally , the weights are normalized so that @xmath218 . the remaining task is to define the dot product @xmath219 at each corner when the vector is expressed in components of a nonorthogonal basis set : @xmath220 where @xmath221 and @xmath222 are basis vectors located at the center of the edges on either side of the corner associated with node @xmath25 with orientations perpendicular to the edges , and @xmath223 and @xmath211 are the corresponding magnitudes in this basis set . with this basis set , the inner product is @xmath224 where @xmath225 \ , , \ ] ] and @xmath226 is the angle formed by edges @xmath207 and @xmath227 . using eqs . ( [ eq : h_basis])-([eq : smatrix ] ) in eq . ( [ eq : intidentity_lhs2 ] ) , the second term on the lhs of eq . ( [ eq : intidentity ] ) is @xmath228 where @xmath229 and @xmath230 . combining eqs . ( [ eq : intidentity_lhs1 ] ) , ( [ eq : intidentity_rhs ] ) , and ( [ eq : intidentity_lhs2 ] ) , we have the discrete form of the identity eq . ( [ eq : intidentity ] ) : @xmath231 = 0 \ , .\end{gathered}\ ] ] to find the equation for @xmath208 on each edge we set the corresponding @xmath232 and set all others to zero . this gives an expression for @xmath208 in terms of @xmath214 , @xmath213 , and the other edge - centered accelerations of cell @xmath24 : @xmath233 = 0\end{gathered}\ ] ] or @xmath234 \\ = ( \phi_e - \phi_z)a_e \ , .\end{gathered}\ ] ] together , the set of equations for the edges of cell @xmath24 forms a matrix equation of the form on the @xmath24-axis are zero because the areas on the axis of symmetry are zero . therefore , for the zones along the axis , one less equation and variable appear in the set of equations for @xmath208 . ] @xmath235 where @xmath236 is a vector based upon the edge values , @xmath237 . inverting this equation gives an expression for the edge accelerations as a function of the cell- and edge - centered potentials : @xmath238 after finding the edge acceleration for each zone , these values are inserted into eq . ( [ eq : discretepoisson_div ] ) . the stencil of potentials for this equation for each cell includes the cell center and all edges . while eq . ( [ eq : gacc_phiz_phie ] ) gives the edge accelerations associated with cell @xmath24 , there is no guarantee that the equivalent equation for a neighboring cell will give the same acceleration for the same edge . to ensure continuity , we must include an equation which equates an edge s acceleration vectors from the neighboring cells : @xmath239 where @xmath240 and @xmath241 are the edge accelerations as determined by eq . ( [ eq : gacc_phiz_phie ] ) for the left ( @xmath242 ) and right ( @xmath243 ) cells . while we could have chosen a simpler expression for eq . ( [ eq : gacc_continuity ] ) , the choice of sign and coefficients ensures that the eventual system of linear equations involves a symmetric positive - definite matrix . this enables the use of fast and standard iterative matrix inversion methods such as the conjugate - gradient method . the stencil for this equation involves the edge in question , the cell centers on either side , and the rest of the edges associated with these cells . at first glance , it seems that we need to invert the system of equations that includes the cell - centered equations , eq . ( [ eq : gacc_phiz_phie ] ) , and the edge - centered equations , eq . ( [ eq : gacc_continuity ] ) . instead , we use eq . ( [ eq : discretepoisson_div ] ) to express the cell - centered potentials in terms of edge - centered potentials and the rhs of the equation : @xmath244 where @xmath245 , and @xmath246 substituting eq . ( [ eq : phizeq ] ) into the expression for the edge acceleration , eq . ( [ eq : gacc_phiz_phie ] ) , @xmath247 where @xmath248 . finally , substituting eq . ( [ eq : gacc_phie ] ) into eq . ( [ eq : gacc_continuity ] ) gives the matrix equation for gravity with only edge - centered potential unknowns : @xmath249 the stencil for this equation involves the edge and all other edges associated with the zones on either side of the edge in question . taken together , the equations result in a set of linear equations for the edge - centered potentials , @xmath214 . since this class of matrix equations is ubiquitous , there exists many accurate and fast linear system solvers we can exploit . to do so , we recast our discrete form of poisson s equation as @xmath250 where @xmath251 is a vector of the edge - centered potentials , and @xmath252 is the corresponding vector of source terms . we solve the matrix equation using the conjugate - gradient method with a multigrid preconditioner . in particular , we use the algebraic multigrid package , amg1r6 for details on performance . ] @xcite . unfortunately , this discretization scheme does not adequately define the accelerations at the nodes where they are needed in eq . ( [ eq : mom_discrete2 ] ) . therefore , we use the least - squares minimization method to determine the gradient on the unstructured mesh . assuming a linear function for the potential in the neighborhood of node @xmath14 , @xmath253 , we seek to minimize the difference between @xmath254 and @xmath255 , where @xmath254 is the neighbor s value and @xmath255 is the evaluation of @xmath253 at the position of the neighbor , @xmath256 . more explicitly , we minimize the following equation : @xmath257 where the `` neighbors '' are the nearest cell - centers and edges to node @xmath14 and are denoted by @xmath258 , @xmath259 @xmath260 , @xmath261 , and @xmath262 .    usually , minimization of eq . ( [ eq : least_gacc_eq1 ] ) leads to a matrix equation for two unknowns : @xmath263 and @xmath264 , the gradients for @xmath8 in the @xmath19 and @xmath20 directions , respectively (  [ section : swept ] ) . however , @xmath265 , the potential at the node is not defined and is a third unknown with which eq . ( [ eq : least_gacc_eq1 ] ) must be minimized . performing the least - squares minimization process with respect to the three unknowns , @xmath265 , @xmath263 , and @xmath264 , leads to the following set of linear equations for each node : @xmath266 where @xmath267 inversion of this linear system gives the potential and the gradient at the node . specifically , we use the adjoint matrix inversion method to find the inverse matrix and the three unknowns , including @xmath263 and @xmath264 . the outer boundary condition we employ for the poisson solver is a multipole expansion for the gravitational potential at a spherical outer boundary . assuming no material exists outside the calculational domain and that the potential asymptotes to zero , the potential at the outer boundary , @xmath268 , is given by @xmath269 where @xmath270 is the usual legendre polynomial . in discretized form , ( [ eq : boundary_eq1 ] ) becomes @xmath271 where @xmath272 is the order at which the multipole expansion is truncated .      for 1d spherically symmetric simulations , calculation of gravity can be straightforward using @xmath273 where @xmath274 is all of the mass enclosed by point @xmath25 . instead , we solve poisson s equation for gravity using similar methods to those employed for the 2d gravity . by doing this , we remain consistent when comparing our 1d and 2d results . furthermore , we show that deriving a poisson solver based upon the support - operator method is equivalent to the more traditional form , eq . ( [ eq : gacc_enclosed ] ) . the inherent symmetries of 1d spherical simulations reduce eq . ( [ eq : ge_equation ] ) to the following form : @xmath275 unlike the full 2d version , one may eliminate the edge potentials in favor for the cell - centered potentials and the accelerations at the edges . since each edge @xmath207 will have an equation for its value associated with cells @xmath24 and @xmath276 , this leads to @xmath277 using the continuity of accelerations at the edges , @xmath278 the expression for gravitational acceleration at edge @xmath207 in terms of the cell - centered potentials is @xmath279 substituting this expression into @xmath280 leads to a tridiagonal matrix equation for the cell - centered potential , which can be inverted in o(n ) operations to give the cell - centered potentials . substituting these cell - centered potentials back into eq . ( [ eq : gacc_1dsph ] ) gives the gravitational acceleration needed for the momentum equation ( eqs . [ eq : mom_lag ] and [ eq : mom_discrete2 ] ) . it should be noted that eq . ( [ eq:1dgaussgravity ] ) can be rewritten as a recursion relation for the gravitational acceleration , @xmath281 , at node @xmath25 : @xmath282 where @xmath283 is the mass of the cell interior to point @xmath25 . with the boundary condition @xmath284 and then recursively solving eq . ( [ eq : recursive ] ) for @xmath281 from the center outward , the expression for the gravitational acceleration simplifies to eq . ( [ eq : gacc_enclosed ] ) . this is the traditional form by which the gravitational acceleration is calculated for 1d spherically symmetric simulations and for which the potential is usually not referenced . the beauty of our approach is that 1d and 2d simulations are consistent , and that it self - consistently gives the gravitational potential .      for self - gravitating hydrodynamic systems , the total energy is @xmath285 where @xmath286 is the total internal energy , @xmath287 is the total kinetic energy , and @xmath288 is the total potential energy : @xmath289 an alternative form is possible with the substitution of eq . ( [ eq : poisson_div ] ) into eq . ( [ eq : totpot1 ] ) and integration by parts : @xmath290 \ , .\ ] ] the integral form of eq . ( [ eq : totalenergy ] ) is @xmath291 and total energy conservation is given by @xmath292 since the solution to poisson s equation for gravity , using green s function , is @xmath293 the time derivative of the total potential energy may take three forms : @xmath294 note that this is true only for the total potential energy and does not imply @xmath295 . using eq . ( [ eq : dudt ] ) and the eulerian form of the hydrodynamics equations ( see appendix [ section : eulerian_hydro ] ) , eq . ( [ eq : dedt ] ) becomes a surface integral : @xmath296 which simply states that energy is conserved in the absence of a flux of energy through the bounding surface . the discrete analogs of @xmath286 and @xmath287 are trivially obtained using @xmath297 and @xmath298 , respectively . the discrete total potential energy may take two forms , the analogs of eqs . ( [ eq : totpot1 ] ) and ( [ eq : totpot2 ] ) : @xmath299 \ , , \\ \end{array } \right .\ ] ] where @xmath300 indicates outer - boundary values . upon trying both forms , we get similar results . therefore , we use the simpler form involving the cell - center potential : @xmath301 . because our discrete hydrodynamics equations including gravity do not give strict energy conservation , we use the core - collapse simulation (  [ section : corecollapse ] ) to gauge how well energy is conserved . rather than measuring the relative error in total energy by @xmath302 , where @xmath303 , @xmath304 is the initial total energy , and @xmath305 is the total energy at timestep @xmath59 , we use @xmath306 . for stellar profiles , the kinetic energy is small and the internal and gravitational energies are nearly equal in magnitude , but opposite in sign . since the total energy is roughly zero in comparison to the primary constituents , @xmath286 and @xmath288 , of the total energy , we use the gravitational potential energy as a reference . for example , the internal and gravitational energies start at @xmath307 erg and reach @xmath308 ergs at the end of the run . however , the total energy is a small fraction of these energies initially , @xmath309 , and after core bounce , @xmath310 . hence , we measure the relative error in total energy as @xmath306 . the total energy for the 1d and 2d core - collapse simulations evolve similarly and is conserved quite well . for all times except a few milliseconds around bounce , total energy is conserved better than @xmath11 @xmath311 . during collapse , from 0 to 147 ms , the total energy deviates by only @xmath13 @xmath312 . over a span of 5 ms around bounce , @xmath313 ms , the total energy changes by @xmath12.2 @xmath314 . for 100s of milliseconds afterward , the relative error in the total energy reduces to @xmath17 @xmath312 . hence , for all but about 5 ms of a simulation that lasts many hundreds of milliseconds the relative error in total energy is better than @xmath11 @xmath315 . we include here several assessments of the 1d and 2d poisson solvers . first , we calculate , using the butterfly mesh , the potential for a homogeneous sphere and compare to the analytic solution . this tests overall accuracy and the ability of our solver to give spherically symmetric potentials when a non - spherical mesh is employed . similarly , we substantiate the algorithm s ability to produce aspherical potentials of homogeneous oblate spheroids . then , we verify that the hydrodynamics and gravity solvers give accurate results for stars in hydrostatic equilibrium , and for a dynamical problem , the goldreich - weber self - similar collapse @xcite . figure [ maclaurin_sphere ] compares the simulated and analytic solutions for a homogeneous sphere , having density @xmath316 g @xmath181 , and maximum radius @xmath317 cm . the analytic potential inside the sphere is @xmath318 , and the top panel of fig . [ maclaurin_sphere ] shows the relative difference of the analytic potential and the numerical solution , @xmath213 , as a function of radius . results for four resolutions of the butterfly mesh are shown : 2550 cells with an effective radial resolution @xmath319 0.02 cm ( blue ) ; 8750 cells with @xmath319 0.01 cm ( green ) ; 15,200 cells with @xmath319 0.006 cm ( yellow ) ; and 35,000 cells with @xmath320 0.005 cm ( red ) . two facts are obvious : 1 ) the solutions are accurate at a level of @xmath321 for @xmath322 and @xmath323 for @xmath324 ; and 2 ) the degree to which the solution is spherically symmetric is similarly a few times @xmath325 for @xmath322 and a few times @xmath326 for @xmath324 . plotting the minimum error as a function of the effective radial resolution , the bottom panel of fig . [ maclaurin_sphere ] verifies that the 2d poisson solver convergences with 2@xmath327-order accuracy ( solid line ) . next , we calculate the aspherical potential for an oblate spheroid . the homogeneous oblate spheroid has an elliptic meridional cross section , and the minor- and major - axes of the ellipse are @xmath328 and @xmath329 , where @xmath329 is the equatorial radius . thus , the eccentricity of the spheroid is @xmath330 . given a uniform density , @xmath331 , the potential for a spheroid is @xmath332 \right ) \ , , \ ] ] where , for oblate spheroids , @xmath333 \frac{(1 - e^2)^{1/2}}{e^2 } \ , , \ ] ] @xmath334 \frac{(1 - e^2)^{1/2}}{e^2 } \ , , \ ] ] and @xmath335 @xcite . numerical results with @xmath336 are shown in fig . [ maclaurin_spheroid ] . as with the sphere , @xmath337 g @xmath181 and @xmath317 cm . however , for the given eccentricity , the polar - axis radius , @xmath328 , is 0.6 cm . once again , the grid is a butterfly mesh , but this time the outer boundary follows the ellipse defining the surface of the spheroid . the top panel of fig . [ maclaurin_spheroid ] presents the spheroid s potential , and the degree of accuracy is presented in the bottom plot . with @xmath338 and @xmath322 , the relative error in the potential ranges from @xmath339 near the outer boundary to @xmath321 in interior regions . conspicuous are features in the relative error that track abrupt grid orientation changes in the mesh . fortunately , these features have magnitudes smaller than or similar to the relative error in the local region . the relative error in the gravitational acceleration magnitude , latexmath:[$(|\vec{g}_p| -    @xmath1@xmath341 to @xmath1@xmath326 , where @xmath342 is the analytic acceleration and @xmath343 is the maximum magnitude on the grid . typical errors in the acceleration direction range from @xmath1@xmath341 to @xmath1@xmath326 radians with rare deviations as large as @xmath1@xmath344 radians near the axis and abrupt grid orientation changes .    in fig . [ laneemden_plot ] , we demonstrate that the ale algorithm in combination with our gravity solver produces reasonably accurate hydrostatic equilibria . the grid is the butterfly mesh with 8750 zones , and the initial model is a lane - emden polytrope with @xmath345 , @xmath346 m@xmath347 , and @xmath348 cm . crosses show the density profile at @xmath349 s , while the solid line shows the maximum density as a function of time and that the star pulsates . these oscillations result from the slight difference between an analytic hydrostatic equilibrium structure and a discretized hydrostatic equilibrium structure , and with increasing resolution , they decrease in magnitude . interestingly , the oscillations continue for many cycles with very little attenuation . simulating the goldreich - weber self - similar collapse @xcite in 1d and 2d is a good test of dynamic simulations including gravity . the analytic profile is similar to a lane - emden polytrope with @xmath350 , and in fact , we use the gamma - law eos with @xmath351 . while the lane - emden polytropes are assumed to be in hydrostatic equilibrium , the goldreich - weber self - similar collapse has a homologous velocity profile and a self - similar density profile . the physical dimensions have been scaled so that @xmath352 m@xmath347 , the initial central density is @xmath353 g @xmath181 , and the maximum radius of the profile is @xmath354 cm . for the 1d simulation , we initiate the grid with 200 evenly - spaced zones , and for 2d , a butterfly mesh with 35,000 zones ( effectively with 200 radial zones ) is used to initiate the grid . subsequent evolution for both simulations uses the lagrangian configuration . figure [ gwplot ] shows snapshots of density vs. radius for 1d ( top panel ) and 2d ( bottom panel ) simulations at @xmath3550 , 20 , 40 , 60 , 80 , 100 , 120 , and 130 ms . both plots indicate that the simulations ( crosses ) track the analytic solution ( solid lines ) . quantitatively , we measure a relative difference , @xmath356 , for the reported times , where @xmath357 are the simulated cell - center densities and @xmath358 are the analytic values . consistently , the largest deviations are at the center and table [ table : gw ] gives these values for the 1d simulation ( 2@xmath0 column ) and the 2d simulation ( 3@xmath359 column ) . the relative differences range from @xmath360 at 0 ms to @xmath361 at 130 ms for the 1d simulation and @xmath362 at 0 ms to @xmath363 at 130 ms for the 2d simulation . at all times , the departure from spherical symmetry is no more than @xmath364 . boundary conditions are implemented in one of two ways . either an external pressure is specified or the velocities at the nodes are fixed . for external pressures , ghost cells are defined that have no true volume or mass associated with them . their only function is to apply an external force to the boundary cells equal to an external pressure times the boundary surface area . specifying nodal velocities on the boundary accomplishes the same task . in this case , there is an implied external force and pressure . in practice , generic dynamical boundaries use the external pressure boundary condition . on the other hand , pistons , reflecting walls , and the azimuthal axis have the velocity perpendicular to the boundary specified , while the parallel component executes unhindered hydrodynamic motions . to resolve shocks over just a few zones , we include artificial viscosity in the equations of hydrodynamics . for 1d simulations , we add a viscous - like term to the pressure @xcite . we denote this viscous pressure by @xmath365 . the original realization of @xmath365 employed one term proportional to @xmath366 , where @xmath367 is the difference in velocity from one zone to the next . while this form adequately resolved shocks , unphysical oscillations were observed in the post - shock flow . a second term , linear in @xmath367 , was then added that effectively damped these oscillations @xcite . another form which we employ for our 1d simulations is @xmath368 where @xmath369 is the sound speed , @xmath370 is the parameter associated with the linear term , and @xmath371 is the parameter associated with the quadratic term . this form has the appealing attribute that it is motivated by the expression for the shock - jump condition for pressure in an ideal gas @xcite .    for 2d simulations , the artificial viscosity scheme we have settled upon is the tensor artificial viscosity algorithm of @xcite . here , we do not re - derive the artificial viscosity scheme , but highlight some of its salient features and practical implementations . the useful feature of the tensor algorithm is its ability to calculate artificial viscosity on an arbitrary grid , while suppressing artificial grid buckling when the flow is not aligned with the grid . in the strictest sense , the tensor artificial viscosity does not employ the simple viscous pressure described above . instead , @xcite assume that the artificial viscosity tensor is a combination of a scalar coefficient , @xmath372 and the gradient of the velocity tensor , @xmath373 . therefore , references to the parameters @xmath370 and @xmath371 in 1d and 2d refer to the same linear or quadratic dependence on @xmath374 . with this assumption , the momentum equation , eq . ( [ eq : mom_lag ] ) , becomes @xmath375 and the energy equation , eq . ( [ eq : ene_lag ] ) , is @xmath376 where @xmath377 , using the normal einstein summation convention . with the method of support operators , @xcite derive discrete forms of these equations . analogous to the gradient of the pressure term , the discrete artificial viscosity term in the momentum equation becomes a summation of corner forces , @xmath378 and the corresponding term in the energy equation is the usual force - dot - velocity summation : @xmath379 therefore , implementation of the artificial viscosity scheme is straightforward and similar to that for the pressure forces .    in practice , this artificial viscosity scheme is formulated for cartesian coordinates , and to obtain the equivalent force for cylindrical coordinates , we multiply the cartesian subcell force by @xmath81 . in general , this works quite well , but sacrifices strict momentum conservation ( see  [ section : momcons ] ) . a problem that can plague lagrangian codes using cells with 4 or more sides is the unphysical hourglass mode @xcite . to suppress this problem , we employ a modified version of the subcell pressure algorithm of @xcite . for all physical modes ( translation , shear , and extension / contraction ) the divergences of the velocity on the subcell and cell levels are equal , @xmath380 hence , as long as the calculation is initiated such that the subcell densities of a cell are equal to the cell - averaged density , then they should remain equal at all subsequent times . any deviation of the subcell density from the cell density , @xmath381 , is a direct result of the hourglass mode . the scheme of @xcite uses this deviation in subcell density to define a subcell pressure that is related to the deviation in subcell and cell density , @xmath382 , by @xmath383 with the corresponding deviation in pressure : @xmath384 . application of these pressures as subcell forces counteracts the hourglass distortion . however , the pressure throughout the cell is no longer uniform . as a result , the subcell pressures exert forces on the cell centers and mid - edge points . these locations in the grid are not subject to physical forces as are the nodes . instead , their movement is tied to the motions of the nodes . to conserve momentum , the forces acting on these enslaved points must be redistributed to the dynamical nodes . though the choice of redistribution is not unique , we follow the procedure established by @xcite for the form of the subcell force ( for the definitions of @xmath41 and @xmath43 , see  [ section : coords_mesh ] and fig . [ fig : grid ] . ) : @xmath385 \ , .\ ] ]    this particular scheme works quite well for lagrangian calculations . however , it can be incompatible with subcell remapping algorithms . the hourglass suppression scheme described above assumes that only hourglass motions result in nonzero values for @xmath382 . even in calculations that are completely free of hourglass motions , the subcell remapping scheme can and will produce subcell densities within a cell that are different from the cell density . since this difference of subcell and cell densities has nothing to do with hourglass motions , any subcell forces that arise introduce spurious motions that do nt correct the hourglass motions . investigating several alternative schemes , we settled on a modification of the @xcite approach . after each remap , we define a tracer density whose only purpose is to track the relative changes in the subcell and cell volumes during the subsequent hydrodynamic solve . for convenience , and to keep the magnitude of the subcell pressures about right , we set the subcell tracer density equal to the cell density . after replacing @xmath382 with the difference between the subcell tracer density and the cell density , @xmath386 , we proceed with the scheme prescribed by @xcite . we have found that the subcell forces of @xcite significantly resist hourglass motions only after @xmath382 achieves significant magnitude . for our new hourglass scheme , if a remap is implemented after each hydrodynamic solve , @xmath386 does not have a chance to achieve large values , and hence , the subsequent subcell forces are not very resistant to hourglass distortions . however , for many simulations , we have found that it is not necessary to remap after every lagrangian hydrodynamic solve . rather , the remap may be performed after @xmath387 timesteps . in these circumstances , the subcell tracer density is allowed to evolve continuously as determined by the hydrodynamic equations . with large @xmath387 , @xmath386 does develop significant amplitude and the subcell forces become effective in suppressing the hourglass modes . in fact , in the limit that @xmath388 , this scheme becomes the hourglass suppression scheme of @xcite .    in practice , we multiply this subcell force by a scaling factor . to determine the appropriate magnitude of this scaling factor , we executed many test problems and found that problems that involved the perturbation of hydrostatic equilibrium provide a good test of the robustness of the hourglass fix . during the testing protocol , we ran a simulation for at least 200,000 timesteps , ensuring that the hourglass fix remains robust for long calculations . for lagrangian calculations , a scaling factor @xmath389 produced reasonable results . for runs in which remapping occurred after @xmath387 timesteps , we found that larger values of the scaling factor were required . however , for very large values of @xmath387 , such as 64 or greater , such large values compromised small structures in the flow . hence , we settled on scaling factors near 1 for large @xmath387 . for small @xmath387 , we found that the difference in tracer density and the cell - centered density had little time to build to significant amplitudes , so larger values of the scaling factor are required , but anything above 4 produced noticeable problems in flows with many timesteps . in summary , the scaling factor should be adjusted to be @xmath389 for large @xmath387 and @xmath390 for small @xmath387 .      to demonstrate the need for an hourglass suppression scheme , and that our algorithm to address the hourglass distortions works , we show in fig . [ gw_fmerit_comp ] results for the goldreich - weber self - similar collapse in 2d (  [ section : gravity_tests ] ) , with and without the hourglass suppression (  [ section : hourglass ] ) . these results represent a lagrangian simulation of the self - similar collapse at @xmath391 ms . on the left ( `` @xmath392 '' ) the grid clearly shows problematic grid buckling when the hourglass suppression is turned off . the grid on the right ( `` @xmath393 '' ) shows the elimination of grid buckling with the use of the hourglass suppression scheme and a scaling factor of 2.0 . figure [ rt_stills_fmerit ] illustrates the problem of using the hourglass suppression scheme of @xcite in combination with the subcell remapping algorithm (  [ section : remap ] ) . all three panels show the results of the single - mode rayleigh - taylor instability at @xmath394 s. for the left panel , no hourglass suppression is employed . this panel represents our control . while the hourglass instability does not cause serious problems for the calculation , one can see evidence of slight hourglass patterns at the scale of the grid resolution . in particular , two blobs near the top and on the edges form distinct patterns . the central panel demonstrates the problem of using the subcell remapping scheme and the subcell pressure method of @xcite . on the other hand , the right panel demonstrates that the modified subpressure scheme we have developed suppresses the hourglass distortions , while preserving the expected flow . fluid flows with large vorticity quickly tangle a lagrangian mesh , presenting severe problems for lagrangian hydrodynamic codes . to avoid entangled grids , it is common to remap the state variables after each lagrangian hydrodynamic advance to another less tangled mesh . even flows that exhibit very little vorticity , but extreme compression or expansion along a particular direction , leading to very skewed cells , can limit the accuracy of lagrangian calculations . in this case as well , one can employ a remapping scheme which is designed to minimize the calculational error . to remap , a new grid must be established . one choice is to remap to the original grid , thereby effectively solving the hydrodynamics equations on an eulerian mesh . another is to use a reference jacobian matrix rezone strategy , which establishes a new mesh close to the lagrangian mesh , while reducing numerical error by reducing unnecessarily skewed zones . the arbitrary nature of the remapping algorithm even allows the freedom of choosing one rezoning scheme in one sector of the grid and another rezoning scheme in other sectors . for example , one could remap in an eulerian fashion in one sector , let the grid move in a lagrangian manner in another , and in the intervening region smoothly match these two regions . generally , there are two options for remapping schemes . one can remap from one arbitrary grid to another completely unrelated arbitrary grid . for these unrelated grids , one needs to determine the overlap of the zones of the first grid with the zones of the second . in general , this can be a very cumbersome and expensive process . as a result most ale codes , remap to an arbitrary grid that is not too different from the first . specifically , the usual stipulation employed is that the face of each cell does not traverse more than one cell during a timestep , and that the connectivity among nodes , faces , edges , and cells remains the same from the first grid to the remapped grid . the regions swept by the faces then contain the mass , momentum , or energy which is added to the cell on one side of the face and subtracted from the cell on the other side . it is in this context that we use the swept - region remapping algorithms of @xcite , @xcite , @xcite , and @xcite . this remapping scheme may be described by four stages :    1 .   the first is the gathering stage . this is a stage in which subcell quantities of the mass , momenta , and energies are defined in preparation for the bulk of the remapping process . 2 .   the second is to remap the subcell quantities from the lagrangian grid to the new rezoned grid using the swept - region approximation . in doing so , the remapping algorithm remains 2nd - order accurate , but avoids time intensive routines to calculate the overlap regions of the old and new grids . 3 .   the third is to repair the subcell densities . because exact spatial integration is avoided with the swept - region approximation , local bounds of subcell densities may be violated . therefore , a repair algorithm which redistributes mass , momentum , and energies to preserve the local bounds is implemented . finally , there is the scattering stage , in which the primary variables of the hydrodynamics algorithm are recovered for the new rezoned grid .      in order to remap the primary quantities using the subcell remapping algorithm , mass , momenta , internal energy , and kinetic energy must be defined at the subcell level . in the lagrangian stage , the subcell mass , @xmath47 , is already defined . the subcell density which is a consequence of the change in the subcell volume ( @xmath33 ) during the lagrangian hydro step is @xmath395 unfortunately , there is no equivalent quantity for the subcell internal energy . instead , we define the internal energy density for each zone , @xmath396 , fit a linear function for the internal energy density , @xmath397 , and integrate this function over the volume of each subcell to determine the total subcell internal energy and , consequently , the average subcell internal energy density : @xmath398 performing the integration of eq . ( [ eq : gather_energy ] ) involves a volume integral and volume integrals weighted by @xmath19 and @xmath20 in cartesian coordinates or @xmath21 and @xmath24 in cylindrical coordinates ( see appendix [ section : integrals ] for formulae calculating these discrete integrals ) . note , that , by construction , these newly defined internal energies satisfy conservation of internal energy for each zone , @xmath399 . similarly , there are no readily defined subcell - centered averages for the momenta , @xmath400 , or velocities , @xmath401 . however , they should be related to one another by @xmath402 if the gathering stage is to preserve momentum conservation , then the following equality must hold : @xmath403 by inspection , it might seem natural to set @xmath404 . however , we follow the more accurate suggestion made by @xcite to define the subcell - averaged velocity as follows : @xmath405 where @xmath406 is obtained by averaging over all nodal velocities associated with zone @xmath24 , and @xmath407 and @xmath408 are edge - averaged velocities given by @xmath409 and @xmath410 . substituting eq . ( [ eq : subcellvel ] ) into eq . ( [ eq : momconssubcell ] ) and rearranging terms , we get an expression for the subcell velocity that depends on known subcell masses and nodal velocities : @xmath411 we now rewrite eq . ( [ eq : vsubcellexplicit1 ] ) in a form that obviously makes it easy to write the gathering operation in matrix form : @xmath412 if @xmath413 is a vector of one component of all velocities associated with cell @xmath24 , and @xmath414 is the equivalent for subcell velocities , then @xmath415 where the matrix , @xmath416 , for each zone is given by the coefficients in eq . ( [ eq : vsubcellexplicit ] ) .    to conserve total energy in the remap stage , we define the subcell kinetic energy and follow the same gather procedure as for the velocity by simply replacing velocity with the specific kinetic energy : @xmath417 we ensure conservation of total kinetic energy for a cell : @xmath418 where @xmath419 is the subcell - averaged specific kinetic energy . then , the transformation from nodal specific kinetic energies to subcell - averaged specific kinetic energies is given by @xmath420 where @xmath421 is a vector of the subcell - averaged specific kinetic energies , @xmath422 is a vector of the nodal specific kinetic energies , and @xmath416 is the same transformation matrix used for the velocity transformations . having found the specific kinetic energies , the calculation of the kinetic energy for each subcell is then straightforward : @xmath423 .    upon completion of the gathering stage , each relevant quantity , @xmath47 , @xmath400 , @xmath424 , and @xmath425 , is expressed as a fundamentally conserved quantity for each subcell . from these conserved quantities and the subcell volumes , we have the corresponding densities , which , as is explained in  [ section : swept ] , are important components of the remapping process . having gathered all relevant subcell quantities , we begin the bulk of the remapping process . since all variables are now expressed in terms of a conserved quantity ( subcell mass , energy , and momentum ) and a density ( mass density , energy density , and momentum density ) , for clarity of exposition , we focus on representative variables , subcell mass and density , to explain the generic remapping algorithm . when there are differences in the algorithm for the other variables , we note them . we have instituted the remapping algorithm of @xcite . to avoid the expensive process of finding the overlap of the lagrangian grid with the rezoned grid , this algorithm modifies the mass of each subcell with a swept - edge approximation for the rezoning process . as long as the connectivity and neighborhood for each cell remain the same throughout the calculation , time spent in connectivity overhead is greatly reduced . the objective of the remapping algorithm is then to find the amount of mass , @xmath426 , that each edge effectively sweeps up due to the rezoning process and to add or subtract this change in mass to the old subcell mass to obtain the new subcell mass , @xmath427 : @xmath428 of course , the change in mass is obtained by integration of a density function over the volume of the swept region : @xmath429 the density function , @xmath430 , may take on any functional form . to maintain second - order accuracy of the algorithm we use a linear density function ; @xmath431 where @xmath432 is the average of the nodal positions defining the subcell .    in determining the gradient , @xmath433 , we employ one of two standard methods for calculating the gradient using the densities from subcell @xmath143 and its neighbors . the first method uses green s theorem to rewrite a bounded volume integral as a boundary integral around the same volume . we begin with a definition of the average gradient of @xmath6 for a given region . for each component , the average gradient is @xmath434 where @xmath435 and @xmath436 are the gradients in the x- and y - directions , respectively . the region over which the integrals are evaluated is defined by segments connecting the centers of the neighboring subcells . hence , the discrete form of the average gradient is @xmath437 while this method works reasonably well , an unfortunate consequence of the integration and division by volume is that the value of the gradient is directly influenced by the shape and size of the cell . an alternative method for determining gradients , which is not as easily influenced by the shape of the mesh , is a least - squares procedure . for simplicity of notation , we describe this method in the context of cells rather than subcells . again , assuming a linear form for @xmath438 , we seek to minimize the difference between @xmath439 and @xmath440 , where @xmath439 is the neighbor s value and @xmath440 is the extrapolation of cell @xmath24 s linear function to the position of the neighbor , @xmath441 . more explicitly , we wish to minimize the following equation : @xmath442 where the set of neighbors for cell @xmath24 is denoted by @xmath443 , @xmath444 @xmath445 and @xmath446 are the @xmath19 and @xmath20 components of the gradient , @xmath447 , @xmath448 , @xmath449 , and @xmath450 . minimizing eq . ( [ eq : least_eq1 ] ) with respect to the two unknowns , leads to the following set of linear equations : @xmath451 for each subcell , where @xmath452 solving this linear system with cramer s rule then gives the least - squares gradients .    after calculating the gradient we ensure monotonicity using the barth - jespersen limiter @xcite . the gradient is limited by a scalar , @xmath213 , that has a range between 0 and 1 : @xmath453 first , we determine the minimum and maximum value of @xmath6 among @xmath357 and its neighbors @xmath439 : @xmath454 @xmath455 we satisfy the requirement that @xmath456 this is accomplished in the following way . @xmath457 where @xmath458 is a limiter associated with each node of the cell and is given by @xmath459 where @xmath460 is the unlimited linear function evaluated at the nodes .    with the linear function @xmath461 defined for each subcell , we return to the task of determining the swept mass , @xmath426 . the specific linear function @xmath461 for density used in eq . ( [ eq : swept_eq2 ] ) depends upon which subcell the edge encroaches upon . in fact , it is quite possible that the volume swept by the edge intersects more than one immediate neighbor of the subcell in question . of course , an accurate swept - edge integration scheme would take into account all spatial functions in the relevant subcells . @xcite , and references therein , have noted that such an accurate scheme may be cumbersome and computational expensive . instead , they suggest an approximate swept region integration in which only the subcells to the left and right of the oriented edge need matter in determining the spatial function of density used for integration . to this end , an oriented volume integral is defined : @xmath462 whether this volume integral is negative or positive , the density function is taken from either the left or right subcell : @xmath463      while the above scheme is second - order accurate and mass conserving , the approximations made in the swept - edge algorithm can violate local bounds . in practice , the values of the remapped densities should be bounded by the neighborhood values of the original grid . computationally expensive schemes that find the overlap regions among the old and new grid can be made to preserve the bounds . however , the local bounds can be violated in swept - edge remapping . using the linearity - and - bound - preserving method of @xcite , we conservatively repair quantities by redistributing mass , energy , momenta , and number to neighbors satisfying the local bounds of the quantities on the previous lagrangian grid . however , the order in which one processes the cells and subcells influences the specific values that emerge from the repair process . therefore , we employ the order independent scheme of @xcite . these repair schemes are designed to repair subcell densities . for velocities and composition we wish to preserve the bounds of @xmath7 and @xmath13 . therefore , we have appropriately adjusted the scheme to conservatively repair momenta and particle number by preserving the local bounds of @xmath7 and @xmath13 , respectively . the final remap step is to recover the primary variables for the next hydrodynamic step . the new cell - centered and node - centered masses are @xmath464 and @xmath465 respectively . consequently , the subcell and cell - averaged densities are @xmath466 and @xmath467 respectively . recovering the velocities at the nodes is slightly more involved . first , the new subcell - averaged velocity is defined using the remapped momenta and masses : @xmath468 then , for each cell we invert the matrix equation that transforms node velocities into subcell velocities : @xmath469 in this scheme , each cell provides its own velocity for a node , which may be different from another cell s value for the same node . therefore , for each node velocity , we average node velocities resulting from the inversion of eq . ( [ eq : vmatrix ] ) : @xmath470    finally , we recover the specific internal energy . comparing the sum of the old internal energy and kinetic energy with the sum of remapped internal energy and a kinetic energy defined by the remapped node velocities will not necessarily ensure conservation of total energy . therefore , the old kinetic energy is remapped along with the node velocities . the discrepancy between these two kinetic energy representations is then added to the internal energy , ensuring conservation of total energy during the remap stage : @xmath471 \ , .\ ] ] the new cell - centered specific internal energy is then obtained using the modified internal energy , @xmath472 , and the remapped mass , @xmath473 : @xmath474    this ensures conservation of total energy at the expense of consistent remapping of internal energy . whichever is desirable depends upon the problem . for example , in flows with large kinetic energies and small internal energies , the discrepancy in kinetic energy remapping could substantially alter or even dominate the internal energy . consequently , we include a flag in bethe - hydro that determines whether the remapped kinetic energy differences are added to the internal energy . figure [ rhoremap_step ] demonstrates the basic effectiveness of the remapping algorithm . we remap a 1d step function in density many times . from @xmath475 to @xmath476 cm , the density is @xmath477 g @xmath181 , and from @xmath478 to @xmath479 cm , the density is @xmath480 g @xmath181 . this test has 50 cells and @xmath481 nodes . indexing each node by @xmath14 , the positions of the nodes are @xmath482 where @xmath483 and the remapping step is @xmath59 . as a result , the grid completes two full cycles in this remapping test . figure [ rhoremap_step ] shows the result of this remapping test where @xmath484 . the top panel displays the density profile for remapping steps 0 to @xmath485 , while the bottom panel shows the profile for steps @xmath485 to @xmath486 . comparison of the first half ( top panel ) with the second half ( bottom panel ) indicates that the remapping process diffuses the discontinuity over a small number ( @xmath14 ) of zones initially , and `` diffusion '' slows substantially after the initial phase , maintaining a somewhat consistent width in the discontinuity .      barring any nuclear or chemical transformations , the composition equation , eq . ( [ eq : advec ] ) , states that @xmath13 is conserved . the lagrangian hydro portion of our algorithm will not change a cell s composition . all alterations in composition are , therefore , a result of advection , and in an ale code advection is handled by the remapping algorithm . equation ( [ eq : advec ] ) may be written in eulerian form : @xmath487 which implies a close dependence of the advection of @xmath13 on @xmath6 and @xmath7 . in practice , if the composition is not advected in a manner entirely consistent with the advection of mass , then the advection of composition will develop peculiarities . since the remapping of density is truly a remapping of the subcell masses , we have designed a scheme for the remapping of composition which operates on an equivalent subcell quantity .    specifically , we define new lagrangian quantities for composition . they are the number of species @xmath14 in the cell , @xmath488 , and the number of species @xmath14 in the subcell , @xmath489 . analogous to the mass density is the number density , @xmath490 and @xmath491 . these new quantities are related to the previously defined quantities by : @xmath492 and @xmath493 or @xmath494 . the remap ( or advection ) of composition follows the scheme outlined for the advection of mass on the subcell level , with @xmath495 replacing @xmath6 and @xmath496 replacing mass . the new compositions are then determined by @xmath497 . the final minor , but crucial , difference between mass and composition remapping occurs during the repair process . while the repair process maintains the bounds on the number density , we also enforce bound preservation of the compositions .    while we do not address specific rate equations in this work , transport and nuclear processes will require consideration of nonzero terms on the rhs of eqs . ( [ eq : advec ] ) and ( [ eq : advec_eulerian ] ) . since our division of composition into subcell compositions has consequences for discrete implementations with rates , we include here some discussion .    normally , the discrete form of eq . ( [ eq : advec ] ) with a nonzero rhs would be designed to operate at the cell level . in other words , it would involve @xmath498 and @xmath499 . however , the fundamental lagrangian subunit is the subcell . therefore , we have developed an algorithm to handle the composition changes , @xmath500 , at the subcell level due to changes at the cell level . irrespective of the scheme employed , a condition which must be satisfied is that @xmath501 we d like to convert the statement of number conservation into the more useful relationship : @xmath502 when the change in composition due to the rates is applied in operator - split form to the discrete hydro equations , we have the following relations : @xmath503 and @xmath504 our dilemma is that the rate equations will determine @xmath505 , but they put no constraint on @xmath506 . a fairly natural and simple choice is @xmath507 , giving @xmath508 substituting eq . ( [ eq : deltansubcell ] ) into eq . ( [ eq : deltancell ] ) we have @xmath509 hence , by simply stating that @xmath507 , we have developed discrete rate equations that satisfy conservation of species number and operates at the subcell level . the remap of the angular momentum deserves special mention . as in mass remapping , we try to find new subcell angular momenta , @xmath510 , based upon an approximate swept - region approach . in other words , @xmath511 which parallels eq . ( [ eq : swept_eq1 ] ) in form . a notable difference , however , is the expression for the swept angular momentum . it no longer involves a simple volume integral , but an integral weighted by @xmath512 ( see appendix [ section : integrals ] for calculating the discrete analog of this integral ) : @xmath513 after finding the new subcell angular momentum we determine the new cell angular momentum , @xmath514 and node angular momentum , @xmath515 and in turn determine the new angular velocity ; @xmath516 in this section , we characterize bethe - hydro s performance using several test problems . first , we demonstrate that this code produces 2@xmath0-order accurate solutions for self - gravitating flows . to assess the accuracy of high mach - number simulations , we use the sod shock tube problem , sedov blast wave , and noh implosion problem , which all have analytic solutions . furthermore , we simulate the saltzman and dukowicz piston problems to test the code s ability to simulate piston - driven shocks using oblique meshes . in simulating two important hydrodynamic instabilities , the rayleigh - taylor and kelvin - helmholtz instabilities , we further demonstrate this code s strengths and limitations . demonstrating bethe - hydro s ability to simulate astrophysical phenomena , we conclude with a core - collapse supernova simulation .      to verify the 2@xmath517-order character of bethe - hydro , a smooth hydrodynamics flow is required . the goldreich - weber self - similar collapse ( see  [ section : gravity_tests ] and fig . [ gwplot ] ) satisfies this requirement and is ideal to check convergence of the hydrodynamic and gravity solvers and their coupling . we use @xmath518-norms of the error : @xmath519 where the error is @xmath520 , @xmath358 is the analytic density at @xmath521 ms , @xmath522 is the zone size , and @xmath523 is 1 for 1d and 2 for 2d . strictly speaking , the simulations are lagrangian and have time - varying zone sizes . fortunately , this collapse problem is self - similar , implying a direct correlation between the starting resolution and the resolution at a later time . therefore , we use the initial zone size in eq . ( [ eq : l1norm ] ) and in fig . [ gw_resstudy ] . the @xmath518-norm as a function of @xmath524 ( crosses ) is plotted in fig . [ gw_resstudy ] . as the figure demonstrates , both 1d simulations ( top panel ) and 2d simulations ( bottom panel ) converge with roughly 2@xmath517-order accuracy . the sod shock tube problem is a standard analytic test that assesses the code s ability to simulate three characteristic waves : a shock , a rarefaction wave , and a contact discontinuity . a simple gamma - law eos is employed with @xmath525 . initially , the computational domain is divided into left and right static regions with different densities and pressures . specifically , the left and right regions have densities of 1.0 g @xmath181 and @xmath526 g @xmath181 and pressures of 1.0 erg @xmath181 and 0.1 erg @xmath181 , respectively . this gives rise to a self - similar solution involving a shock propagating to the right , a rarefaction wave propagating to the left , and a contact discontinuity in between .    in fig . [ sodplot ] , we display the sod shock tube test results for 1d lagrangian , 1d eulerian , 2d lagrangian , and 2d eulerian configurations . cell - centered densities and locations are marked with plus signs , while the analytic results are denoted by solid dark lines . the 1d lagrangian result shows the appropriate density profile , while the other profiles have been shifted vertically so that distinguishing features are more easily compared . in addition , the profiles are further distinguished by displaying them at different times : 1d lagrangian ( @xmath527 s ) , 1d eulerian ( @xmath528 s ) , 2d lagrangian ( @xmath529 s ) , and 2d eulerian ( @xmath530 s ) . the 1d calculations are resolved with 400 zones . similarly , the 2d tests are resolved along the direction of shock propagation with 400 zones , and they are resolved in the perpendicular direction by 10 zones .    the overall features of the shock , post - shock material , contact discontinuity , and rarefaction wave are reproduced . for all scenarios , the shock is resolved within a few zones . for the 1d eulerian and lagrangian calculations the post - shock density is good to @xmath531% and @xmath532% , respectively . upon viewing the profiles in greater detail , there is a noticeable departure from the analytic solution at the tail of the rarefaction wave where the density dips below the expected value . this error in density at the tail of the rarefaction wave is @xmath533% for the lagrangian simulation and @xmath389% for the eulerian simulation . since the contact discontinuity moves with the flow speed , both lagrangian calculations resolve the contact discontinuity exactly from one zone to the next and maintain this resolution throughout the simulation . the eulerian calculations , not surprisingly , distribute the contact discontinuity over several ( @xmath14 ) zones .      a classic test , the sedov blast wave problem provides a quantitative measure of a code s ability to simulate spherical explosions . initial conditions are set so that the total energy of the sedov blast is 0.244816 ergs , @xmath534 g @xmath181 , @xmath535 ergs g@xmath186 , and the gamma - law eos has @xmath345 . we compare the simulations with the analytic result ( solid lines ) for the following scenarios : 1d lagrangian , 1d eulerian , 2d lagrangian using the butterfly mesh , and 2d lagrangian using the spiderweb mesh . results of the sedov explosion are plotted in fig . [ sedovplot ] . the top panel compares the analytic and numerical density profiles , while the bottom panel shows the relative differences between the numerical solutions and the analytic profile . to easily distinguish different runs and details , we plot the 1d lagrangian calculation at @xmath536 s , the 1d eulerian at @xmath537 s , the 2d lagrangian using the butterfly mesh at @xmath538 s , and the 2d lagrangian using the spiderweb mesh at @xmath539 s. the 1d calculations are resolved with 400 zones . the spiderweb test has a total of 12,381 zones with 200 radial zones and a maximum of 64 angular zones , while the butterfly mesh has a total of 35,000 zones with effectively 200 radial and 200 angular zones . qualitatively , all simulations reproduce the overall structure and position of the shock and post - shock flows .    there are some practical issues about formulating the sedov runs that are worth mentioning . for the 1d simulations , we found that simply placing the initial explosion energy in a small number of inner zones was adequate . on the other hand , the 2d simulations using non - spherical grids required more care . simply depositing all the energy within a small number of zones near the center led to severe grid tangling and distortions . we remedied this by initiating all profiles with the analytic solution at @xmath540 s.    the bottom panel of fig . [ sedovplot ] emphasizes the quantitative accuracy of the post - shock solutions . plotted are the relative errors of the density , @xmath541 , versus radius , where @xmath6 is the simulated density profile , @xmath358 is the analytic profile , and @xmath542 is the maximum density of the analytic profile . the 1d lagrangian simulation gives the best results with a maximum relative error near the shock of @xmath543% . in comparison , the 1d eulerian test gives @xmath390% deviation near the shock . the 2d lagrangian simulation using the spiderweb mesh has a maximum deviation similar to the 1d lagrangian simulation , even though the 1d simulation has radial zones with half the zone size . the simulation using the spiderweb mesh shows some slight departure from spherical symmetry . specifically , for most of the post - shock region , the peak - to - peak variation of density is less than @xmath389% , and near the shock the peak - to - peak variation of density reaches @xmath544% . the 2d lagrangian simulation using the butterfly mesh has a maximum density deviation of @xmath390% near the shock and a deviation from spherical symmetry of similar magnitude . initial conditions for the noh problem are uniform density @xmath316 g @xmath181 , zero ( or very small ) internal energy @xmath545 ergs , a convergent velocity field with magnitude @xmath546 cm s@xmath186 , and a gamma - law eos with @xmath345 . subsequent evolution produces a symmetric self - similar flow including supersonic accretion , an accretion shock , and stationary post - shock matter in which kinetic energy has been converted into internal energy . the analytic solution for this problem is @xmath547 where @xmath548 is the velocity magnitude , the shock position is @xmath549 , the shock velocity is @xmath550 , and @xmath523 is 2 for 2d cartesian , 3 for 2d simulations using cylindrical coordinates , and 3 for 1d spherically symmetric simulations .    in fig . [ noh1dres ] , we present the density profiles at @xmath527 s for 1d , spherically symmetric simulations of the noh problem using four resolutions . the initial grid spans the range @xmath551 cm and is evenly divided into 200 , 400 , 800 , and 1600 zones . the solid line is the analytic solution for @xmath552 . higher resolution simulations more accurately capture the shock position and the post - shock density profile . however , all resolutions depart significantly from the analytic solution near the center . this is `` wall heating '' and is a common problem for lagrangian schemes @xcite . the four panels of fig . [ nohplot_2d ] present the density profiles for 2d simulations . three of the four panels show the results using cartesian coordinates . the top - left panel shows the results using a cartesian grid with 100@xmath553200 zones , the top - right panel shows the results using the butterfly mesh with 22,400 zones , and the lower - left panel shows the results using the spiderweb mesh . the fourth panel , lower - right , shows the results using 2d cylindrical coordinates and a cartesian mesh with 100@xmath553200 zones . obvious is the fact that the mesh employed has consequences for the solution . both the top - left and bottom - right panels indicate that using the cartesian mesh for this problem produces fairly smooth results , with some asymmetry ( @xmath17% ) in the post - shock region . the lower - left panel shows that using the spiderweb mesh produces perfectly symmetric solutions except near the center where the deviation from symmetry is as large as @xmath125% . finally , simulations using the butterfly mesh , top - right panel , shows a similarly mixed capacity to preserve symmetry . in this light , it is important to choose a grid that minimizes numerical artifacts for the problem at hand . a task easily accomplished with the use of ale methods .      a standard test for arbitrary grid codes , the saltzman piston problem @xcite addresses the ability of a code to simulate a simple piston - driven shock using a grid with mesh lines oblique to the shock normal . the top panel of fig . [ saltzman ] shows the grid with @xmath554 zones . for a grid with @xmath555 nodes within a domain defined by @xmath556 and @xmath557 , where @xmath558 and @xmath559 , the @xmath19 positions of the nodes are given by @xmath560 where @xmath561 and @xmath562 . at the piston , the left wall is moving at a constant velocity , 1.0 cm s@xmath186 , to the right . initially , the density and internal energy are set equal to 1.0 g @xmath181 and 0.0 ergs , respectively , and we use a gamma - law eos with @xmath345 .    in the bottom panel of fig . [ saltzman ] , we show the grid and the density colormap at @xmath563 s after the shock has traversed the domain twice , reflecting off the right and left walls once . in this snapshot , the shock is traveling to the right . our results are to be compared with figs . 15 and 16 of @xcite . figure 15 of @xcite depicts a simulation with severe grid buckling , which we do not observe in our simulations . instead , our fig . [ saltzman ] shows reduced grid buckling and appropriate densities in accordance with the results of fig . 16 of @xcite . the dukowicz piston problem @xcite is another test using an oblique mesh . the initial setup involves two regions . region 1 has a density of 1 g @xmath181 and is resolved with @xmath564 zones . in the vertical domain , @xmath565 cm , and the mesh lines evenly partition the space into 120 sections . dividing region 1 horizontally involves mesh lines with changing orientation . the leftmost mesh line is parallel to the vertical , while the rightmost mesh line is oriented 60@xmath566 relative to the vertical . the mesh lines in between smoothly transition from 0@xmath566 to 60@xmath566 . region 2 has a density of 1.5 g @xmath181 and is gridded with a @xmath567 mesh , with the vertical mesh lines uniformly slanted at 60@xmath566 . including region 1 and region 2 , the bottom boundary spans the range @xmath568 cm and is evenly divided into 304 segments . initially , both regions are in equilibrium with @xmath569 erg @xmath181 . the top , bottom , and right boundaries are reflecting , and the left boundary is a piston with a velocity in the positive @xmath19 direction and a magnitude of 1.48 cm s@xmath186 ( see the top panel of fig . [ dukowicz ] for a low resolution example of this grid ) .    a piston - driven shock travels from left to right , and encounters the density jump at an angle of 60@xmath566 , producing a rich set of phenomena . the incident shock continues into the lower density region , a transmitted / refracted shock propagates into the higher density region , a vortex sheet develops behind the transmitted shock , and a reflected shock propagates into the incident shock s post - shock flow ( see the labels in the bottom plot of fig . [ dukowicz ] for visual reference ) . the results are to be compared with the semi - analytic shock - polar analysis presented by @xcite ( see figure 13 and table i of @xcite ) . in their paper , angles subtended by the five regions are presented . in table [ table : dukowicz ] , we recast this information as the angles that the transmitted shock , vortex sheet , reflected shock , and incident shock have with @xmath19-axis . the first row gives the analytic values , which should be compared with the simulated orientations in the second row . strikingly , despite the fact that the incident shock has traversed a grid with an oblique mesh , the simulated and analytic orientations differ very little . the simulated and analytic reflected - shock orientations agree to within @xmath570% , and the orientations of the transmitted shock and vortex sheet agree to within 2% .      here , we simulate the growth of a single mode of the rayleigh - taylor instability . a heavy fluid is placed on top of a lighter fluid in the presence of a constant gravitational acceleration . the top and bottom densities are @xmath571 g @xmath181 and @xmath572 g @xmath181 , respectively , and the gravitational acceleration points downward with magnitude @xmath573 cm s@xmath574 . the domain is a rectangle with @xmath575 cm and @xmath576 cm and @xmath577 grid zones . the top and bottom boundaries are reflecting while the left and right boundaries are periodic . for such configurations , small perturbations of the interface between the heavy and light fluids are unstable to exponential growth . assuming that the boundaries are far from the interface , the exponential growth rate of a perturbation with wavenumber @xmath578 is @xmath579 for all single - mode rayleigh - taylor simulations we initiate the perturbation by setting the vertical component of the velocity equal to @xmath580 , where the wavelength , @xmath581 , is @xmath582 cm . therefore , we simulate one wavelength of the mode , and the exponential growth rate ( @xmath583 ) should be 0.65 s@xmath186 . figure [ rt_stills_res ] shows the evolution of a single - mode rayleigh - taylor instability at @xmath394 s for four resolutions . from left to right , the grid sizes are @xmath584 , @xmath585 , @xmath577 , and @xmath586 . gross features compare well , with all the resolutions differing by only a few percent in the maximum and minimum position of the interface . however , higher resolution simulations manifest greater complexity for the kelvin - helmholtz rolls . one can compare the third panel to the results of fig . 4.5 of @xcite . in a general sense , these authors conclude that fewer features imply more dissipation . however , it could be that some of the kelvin - helmholtz rolls are seeded by grid noise in some schemes . next , we discuss the effects of artificial viscosity on the single - mode rayleigh - taylor flow . as stated in  [ section : artificial_viscosity ] , artificial viscosity is a requirement for ale algorithms in order to simulate shocks . in the current formulation , there are two parameters of the artificial viscosity scheme . one parameter , @xmath587 , is the coefficient for @xmath588 , which is largest in shocks . effectively , this term provides shock resolution . the second parameter , @xmath370 , is the coefficient of the term that is proportional to @xmath589 and is designed to reduce the amount of post - shock ringing in the solution . typical values suggested for both are 1.0 @xcite . for the single - mode rayleigh - taylor test , the flows are subsonic , so the term multiplied by @xmath370 has the greatest impact on the magnitude of the artificial viscosity forces . each panel of fig . [ rt_stills_visc ] presents the nonlinear rayleigh - taylor flow after 12.75 s for different values of the artificial viscosity parameter , @xmath370 . clearly , @xmath590 ( left panel ) reproduces the expected results for this low - mach - number flow . on the other hand , the @xmath591 run ( center panel ) displays significant departures for the kelvin - helmholtz rolls , while the overall progression of the plumes remains similar . unfortunately , the model with @xmath592 ( right panel ) completely suppresses the kelvin - helmholtz rolls on these scales and plume progression is severely retarded .    in fig . [ rt_linear ] , the interface perturbation amplitude is plotted as a function of time ( dashed lines ) . the solid line is the analytic exponential growth rate scaled to the simulation results . the dashed lines show the simulation results for viscosity parameters , @xmath370 , of 0.01 , 0.1 , and 1.0 . three distinct phases are apparent : an early transient phase , a phase in which the slope most closely matches the exponential growth rate , and the subsequent nonlinear phase . the simulations with @xmath590 and 0.1 manifest exponential growth for several e - folding times . the run with @xmath592 , on the other hand , seems to follow the linear phase for only 1 s ( @xmath1 1/2 e - folding ) , if at all . around 5 s , the evolution of the interface amplitude enters the nonlinear phase .    for the artificial viscosity scheme that we employ , the rayleigh - taylor instability test indicates that lower values of @xmath370 are preferred . however , tests of the sod shock - tube problem including a parameter study of @xmath370 indicate that unwanted post - shock ringing is diminished only for values above @xmath593 . this represents the primary weakness of bethe - hydro to simulate flows with both shocks and rayleigh - taylor instabilities . to be clear , this does not represent a weakness of ale methods in general , but of the tensor artificial viscosity algorithm designed to mitigate the hourglass instability that we employ . other artificial viscosity schemes such as edge viscosity ( see @xcite for references ) allow for proper development of hydrodynamic instabilities , but do little to suppress the hourglass instability ( milan kucharik , private communication ) . of great interest to users of ale is a methodology that suppresses the hourglass instability and post - shock ringing while enabling proper evolution of hydrodynamic instabilities . another important phenomenon we explore is the kelvin - helmholtz shear instability . @xcite have shown that sph has trouble simulating the kelvin - helmholtz instability when extreme density contrasts are involved . we find that this instability is reasonably well handled in bethe - hydro , and that the evolution during the small amplitude regime is accurately characterized by analytic linear analysis . the calculational domain covers the square region bounded by @xmath594 cm and @xmath595 cm and has @xmath596 zones . the top and bottom boundaries are reflecting , while the left and right boundaries are periodic . for @xmath597 cm , @xmath598 g @xmath181 , and for @xmath599 cm , @xmath600 , where @xmath601 . these regions are in pressure equilibrium with @xmath602 erg @xmath181 . the shearing velocity , @xmath603 is scaled with respect to the slowest sound speed ( sound speed in the bottom region , @xmath604 ) . this relative shearing velocity is split between the top region , which flows to the left with speed @xmath605 , and the bottom region , which flows to the right with the same speed . for this test , the linear coefficient in the viscosity , @xmath370 , is set to 0.01 . a gamma - law eos is used with @xmath345 . the initial perturbation ( see agertz et al . 2007 ) is placed in a small band centered on the interface and is a perturbation in velocity given by @xmath606 where @xmath607 cm . it should be noted that this perturbation is not an eigenmode of the instability . therefore , simulations have a transient phase at the beginning in which this perturbation settles into one or more modes of the instability . we have found that using amplitudes suggested by @xcite , @xmath608 and 1/40 , produces strong transients that complicate the interpretation of the linear regime . to avoid strong long - lasting transients , we set @xmath609 . these initial conditions should produce a perturbation of the interface that grows exponentially in magnitude with an e - folding time given by @xmath610 for the simulations presented here , we consider two shearing velocities : @xmath611 cm s@xmath186 and @xmath612 cm s@xmath186 . hence , @xmath613 is 0.262 s and 0.523 s , respectively . the top panel of fig . [ kh_still ] shows the evolution at @xmath614 s for @xmath615 . the first set of nonlinear kelvin - helmholtz rolls have appeared . qualitatively , the morphology of the rolls is similar to the results presented in figure 13 . of @xcite labeled by `` grid 1 '' at @xmath616 ( there is a factor of @xmath617 difference in the definition of @xmath613 between our work and theirs ) . there are two main differences . for one , we simulate with a factor two larger wavelength to adequately resolve the wavelength for linear analysis . secondly , the time at which we present the results in the top panel of fig . [ kh_still ] corresponds to @xmath618 , not @xmath619 . we have noticed similar discrepancies in the time required to achieve similar evolution using @xmath620 and @xmath621 . additionally , we analyze the growth rate of the interface during the linear regime . we determine the interface amplitude by generating a contour for @xmath622 , measuring the peak to peak amplitude , and dividing by two . the bottom plot of fig . [ kh_still ] shows this amplitude ( solid line ) versus time and compares to the expected exponential growth ( dashed line ) for a simulation with @xmath623 ( green ) and @xmath624 ( blue ) . there are three distinct phases in the log - linear plot : an early transient phase , a phase in which the slope most closely matches the exponential growth rate , and the subsequent nonlinear phase . while the growth rate during the linear regime differs slightly ( @xmath110% ) from theory , the bottom panel of fig . [ kh_still ] demonstrates that the correct dependence of the growth rate on @xmath603 is obtained . incorporating all aspects of bethe - hydro , we simulate 1d and 2d hydrodynamic core - collapse of a 15 m@xmath347 star . we use the s15s7b2 model ( s15 ) of @xcite and the shen eos @xcite and initiate collapse using a @xmath625-@xmath6 parameterization @xcite . while there are no analytic solutions for such a test , we test to see whether the density profiles , timescales , and shock radii , etc . all match experience with other codes and results published @xcite . for 2d simulations , the grid is composed of a butterfly mesh in the interior with a minimum cell size of @xmath10.5 km and extends to 50 km where a spherical grid carries the domain out to 4000 km . in total , there are 23,750 cells , with an effective resolution of @xmath1250 radial and @xmath1100 angular zones . for the best comparison , the 1d grid has 250 zones , mimicking the effective radial resolution of the 2d simulation . figure [ cc_rhoplot ] depicts the density vs. radius for 1d ( lines ) and 2d ( crosses ) at times 0 , 70 , 110 , 130 , 140 , and 150 ms after the start of the calculation . core bounce occurs at 148 ms . other than a @xmath110% difference in the shock radii at 150 ms , 1d and 2d calculations track one another quite well . furthermore , fig . [ cc_gaccplot ] shows an exceptional correspondence between the 1d and 2d gravitational accelerations .    using this core - collapse test to best represent the conditions during astrophysical simulations , we describe some timing results of this problem . a standard measure is the average cpu time spent per cell per cycle . using one core of a dual - core amd opteron2.8 ghz processor for this test , the average time spent is @xmath626 cpu seconds / cycle / cell . 80% of which is spent in amg1r6 , the multigrid solver . for this problem , the iterative multigrid solver usually takes @xmath15 to @xmath110 cycles to achieve a fractional residual of @xmath1@xmath627 to @xmath1@xmath628 , where the fractional residual of the linear system @xmath629 is @xmath630 . we re - simulate the collapse of the s15 model , but with an angular velocity profile of the form @xmath631 , where @xmath632 km and @xmath633 radians s@xmath186 . the @xmath188 vs. @xmath21 plot is shown in fig . [ cc_angvelplot ] . core bounce occurs at 151 ms . first of all , total angular momentum is conserved to machine accuracy . since there are no analytic descriptions for the evolution of angular velocity in core collapse scenarios , we can not validate the numerical results via analytic theory . however , the central angular velocity , @xmath634 is proportional to @xmath635 , where @xmath439 is the central density . since the central density compresses from @xmath110@xmath636 g @xmath181 at @xmath637 ms to @xmath12.2 @xmath638 g @xmath181 at @xmath639 ms , @xmath634 should be @xmath11600 radians s@xmath186 at @xmath639 ms . this is consistent with results shown in fig . [ cc_angvelplot ] . furthermore , the angular velocity evolves smoothly with no evidence of axis effects . on the other hand , there is a slight , but noticeable , glitch at the location of the shock . in this paper , we have presented the algorithms employed in bethe - hydro , a new code for 1d and 2d astrophysical hydrodynamic simulations . the hydrodynamic core is an ale algorithm , and its most striking feature is the ability to use arbitrary , unstructured grids . with finite - differencing based upon the support - operator method @xcite of @xcite and @xcite , energy is conserved to roundoff error in the absence of rotation and gravity , and momentum is strictly conserved using cartesian coordinates . for all other circumstances , energy and momentum are conserved accurately , if not precisely . we use a subcell remapping scheme that conservatively remaps mass , momentum , energy , and number density . for 2d calculations using cylindrical coordinates , we include rotational terms in the lagrangian solver , and develop a remapping algorithm that conservatively remaps angular momentum while minimizing unwanted features in the angular velocity near the axis . to provide shock resolution and grid stability , we use the tensor artificial viscosity of @xcite , and to minimize hourglass instabilities , we have developed a subcell pressure method that is a close derivative of the scheme developed by @xcite , but avoids pathological problems when used in conjunction with the subcell remapping algorithm . finally , we have developed a gravity solver for arbitrary grids that uses a support - operator technique for elliptic equations @xcite and an iterative multigrid - preconditioned conjugate - gradient method @xcite to solve the system of linear equations . overall , bethe - hydro offers many unique and useful features for astrophysical simulations . for one , by using ale techniques , the structure of bethe - hydro is straightforward , enabling simple inclusion of a variety of additional physics packages . examples , which will be discussed in future papers , are nuclear networks and time - dependent radiation transport . in contrast with other techniques , such as higher - order godunov methods , no assumptions are made in ale techniques about characteristic waves nor the relationships among important thermodynamic variables . hence , one of its useful features is an ability to use a general eos . most important among bethe - hydro s strengths is the ability to solve self - gravitating hydrodynamic flows on arbitrary grids . this is achieved primarily because the foundation of the lagrangian hydrodynamics solver is an arbitrary , unstructured polygonal grid . furthermore , grids may be time - dependent since the hydrodynamic flow from one timestep is remapped to another arbitrary grid for subsequent evolution . consequently , simulations may be executed using a purely lagrangian , purely eulerian , or an arbitrarily defined time - dependent grid . with bethe - hydro , simulations have great flexibility , tailoring the grid to minimize numerical error and suiting the grid to the computational challenge . ironically , this flexibility leads to bethe - hydro s most prominent weakness , which is shared among all ale codes , the hourglass instability and grid buckling . we use subcell pressure and tensor artificial viscosity algorithms to mitigate these numerical artifacts , but the resolution is imperfect . in  [ section : hourglass ] , we present a subcell pressure algorithm that is compatible with the subcell remapping algorithm , but the efficacy of hourglass elimination is slightly compromised . although the tensor artificial viscosity does well to mitigate grid buckling , it can be more resistive to the proper development of hydrodynamic instabilities compared to other artificial viscosity schemes used in ale ( milan kucharik , private communication ) . hence , we diminish the effects of the hourglass instability , but with some unwanted side effects . while mitigation in 2d is tractable , the instability in 3d has many more modes and is not as easily eliminated ( guglielmo scovazzi , private communication ) , making long 3d ale simulations a challenge .    throughout this paper , we have not only demonstrated bethe - hydro s flexibility , but have shown that it produces accurate and 2@xmath0-order convergent solutions . with density distributions having analytic potentials , we have shown that the 2d gravity solver gives accurate spherically symmetric potentials when a non - spherical grid is used , it produces accurate non - spherical potentials , and solutions converge with 2@xmath0-order accuracy . further tests demonstrated accurate solutions for self - gravitating hydrostatic and dynamic problems . we have shown that our hourglass elimination algorithm minimizes the hourglass instability and does not present problems when used in conjunction with subcell remapping . in addition , we have quantified the accuracy of hydrodynamic simulations by simulating problems with analytic solutions . simulating piston - driven shocks using oblique meshes , we confirmed we can obtain accurate solutions in the context of arbitrary grids . verifying the code s ability to capture basic hydrodynamic instabilities , we simulate the rayleigh - taylor and kelvin - helmholtz instabilities . concluding the tests , we simulated a supernova core collapse , which demonstrates the ability to simulate complex astrophysical phenomena .    simulating hydrodynamic flow is fundamental to understanding most astrophysical objects , and despite the long tradition of hydrodynamic simulations many puzzles remain . this is due primarily to the need to address time - dependent gravitational potentials , complicated equations of state ( eoss ) , flexible grids , multi - d shock structures , and chaotic and turbulent flows . therefore , with bethe - hydro , we introduce a uniquely flexible and functional tool for advancing the theory of complex astrophysical phenomena . we would like to thank mikhail shashkov , raphael loubre , milan kucharik , and burton wendroff for valuable conversations about ale techniques . discussions concerning the 2d gravity solver with ivan hubeny , jim morel , david moulton , and david keyes of tops were very fruitful . we acknowledge support for this work from the scientific discovery through advanced computing ( scidac ) program of the doe , under grant numbers de - fc02 - 01er41184 and de - fc02 - 06er41452 , and from the nsf under grant number ast-0504947 . thanks the joint institute for nuclear astrophysics ( jina ) for support under nsf grant phy0216783 . we thank jeff fookson and neal lauber of the steward computer support group for their invaluable help with the local beowulf cluster , grendel . in eulerian form , the equations for conservation of mass , momentum , and energy are @xmath640 @xmath641 and @xmath642 = - \rho \vec{\nabla } \phi \cdot \vec{v } \ , .\ ] ] in this appendix , we give the exact analytic volumes and weighted - volume integrals in discrete form . since we are dealing with 2d simulations all integrals are 2d integrals , and can be further reduced using green s formula to 1d boundary integrals . for example , the volume of zone @xmath24 in cartesian coordinates is @xmath643 or alternatively , @xmath644 where the direction of the boundary integral is clockwise , @xmath207 indicates an edge of the cell , and subscripts 1 and 2 represent the endpoints of edge @xmath207 . in cylindrical coordinates , the volume integral is @xmath645    throughout bethe - hydro , integrals of linear functions produce volume integrals weighted by @xmath19 or @xmath20 . the discrete form of these integrals are @xmath646 and @xmath647 using cylindrical coordinates these are @xmath648 and @xmath649 ( z_2 - z_1 ) \ , . \end{array}\ ] ]        , o. , moore , b. , stadel , j. , potter , d. , miniati , f. , read , j. , mayer , l. , gawryszczak , a. , kravtsov , a. , nordlund ,  . , pearce , f. , quilis , v. , rudd , d. , springel , v. , stone , j. , tasker , e. , teyssier , r. , wadsley , j. , & walder , r. 2007 , , 380 , 963      , g. , dearborn , d.  s.  p. , dossa , d.  d. , eggleton , p.  p. , taylor , a. , castor , j.  i. , murray , s. , cook , k.  h. , eltgroth , p.  g. , cavallo , r.  m. , turcotte , s. , keller , s.  c. , & pudliner , b.  s. 2003 , in astronomical society of the pacific conference series , vol . 293 , 3d stellar evolution , ed . s.  turcotte , s.  c. keller , & r.  m. cavallo , 158381                                                                                lll 0 & @xmath360 & @xmath362 + 20 & @xmath669 & @xmath670 + 40 & @xmath671 & @xmath672 + 60 & @xmath673 & @xmath674 + 80 & @xmath675 & @xmath676 + 100 & @xmath677 & @xmath678 + 120 & @xmath679 & @xmath680 + 130 & @xmath681 & @xmath363 +
Abstract:

Answer: in this paper , we describe a new hydrodynamics code for 1d and 2d astrophysical simulations , bethe - hydro , that uses time - dependent , arbitrary , unstructured grids . the core of the hydrodynamics algorithm is an arbitrary lagrangian - eulerian ( ale ) approach , in which the gradient and divergence operators are made compatible using the support - operator method . we present 1d and 2d gravity solvers that are finite differenced using the support - operator technique , and the resulting system of linear equations are solved using the tridiagonal method for 1d simulations and an iterative multigrid - preconditioned conjugate - gradient method for 2d simulations . rotational terms are included for 2d calculations using cylindrical coordinates . we document an incompatibility between a subcell pressure algorithm to suppress hourglass motions and the subcell remapping algorithm and present a modified subcell pressure scheme that avoids this problem . strengths of this code include a straightforward structure , enabling simple inclusion of additional physics packages , the ability to use a general equation of state , and most importantly , the ability to solve self - gravitating hydrodynamic flows on time - dependent , arbitrary grids . in what follows , we describe in detail the numerical techniques employed and , with a large suite of tests , demonstrate that bethe - hydro finds accurate solutions with 2@xmath0-order convergence .