Exemple #1
0
 public FlowTile(int gridSize)
 {
     Flux                   = new Flux(0, 0, 0, 0);
     CornerVelocities       = new CornerVelocities(new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0));
     GridSize               = gridSize;
     StreamFunctionGridSize = GridSize + 1;
     StreamFunctionGrid     = new float[StreamFunctionGridSize, StreamFunctionGridSize];
     VelocityGrid           = new Vector2[GridSize, GridSize];
     ControlPoints          = new Vector3[4, 4];
     GenerateStreamFunctionGrid();
     GenerateVelocityGrid();
 }
Exemple #2
0
 public FlowTile(int gridSize, Flux flux, CornerVelocities cornerVelocities)
 {
     /*
      * if (flux.LeftEdge + flux.BottomEdge != flux.RightEdge + flux.TopEdge)
      * {
      *  throw new ArgumentException("The net flux in and out a flow tile must be zero");
      * }
      */
     GridSize = gridSize;
     StreamFunctionGridSize = GridSize + 1;
     StreamFunctionGrid     = new float[StreamFunctionGridSize, StreamFunctionGridSize];
     Flux             = flux;
     CornerVelocities = cornerVelocities;
     VelocityGrid     = new Vector2[GridSize, GridSize];
     ControlPoints    = new Vector3[4, 4];
     GenerateStreamFunctionGrid();
     GenerateVelocityGrid();
 }