mathcomp.gridgeom
Class GridRefiner

java.lang.Object
  extended by mathcomp.monitor.DefaultReportable
      extended by mathcomp.monitor.DefaultAlgorithm
          extended by mathcomp.gridgeom.GridRefiner
All Implemented Interfaces:
java.lang.Runnable, Algorithm, Reportable

public class GridRefiner
extends DefaultAlgorithm
implements java.lang.Runnable

A GridRefiner refines a grid. Each triangle has an state, either RED or GREEN. There are only three green refinements, one for each possible edge in a triangle.

Author:
pht
See Also:
refine()

Nested Class Summary
static class GridRefiner.AllRefinementList
          Marks all elements red.
static class GridRefiner.GreenRefinement
          Seperates an Triangle through a line from node i to the middle of edge i.
static class GridRefiner.ListRefinementList
          Marks all elements red in list.
static class GridRefiner.NodeRefinementList
          Marks all elements red that contain the node k.
static class GridRefiner.PointRefinementList
          Marks the triangle, that contains pnt.
static class GridRefiner.RandomRefinementList
          Marks elements at random.
static class GridRefiner.RectRefinementList
          Marks all elements red inside rect.
static class GridRefiner.RedRefinement
          Refines an element into four congruent elements.
static class GridRefiner.RefinementListCreator
          Lists which elements should be refined.
static class GridRefiner.YellowRefinement
          Just for marking yellow Refinement.
static class GridRefiner.YellowRefinementListCreator
           
 
Field Summary
static GridRefiner.AllRefinementList ALL
          Singelton for GridRefiner.AllRefinementList
static GridRefiner.GreenRefinement[] GREEN
          The singletons for green refinement.
static GridRefiner.RedRefinement RED
          The singleton for red refinement.
 boolean shouldMarkGreens
           
 boolean shouldMoveBoundary
           
static GridRefiner.YellowRefinement YELLOW
           
 
Constructor Summary
GridRefiner()
           
 
Method Summary
 java.util.List createRefinementList()
           
 Grid getGrid()
          Returns the grid.
 Grid getNewGrid()
           
 GridRefiner.RefinementListCreator getRefinementListCreator()
           
 RefinerDesc getRefinerDesc()
           
 mathcomp.gridgeom.GridRefiner.TriangleRefiner getState(Triangle t)
           
 java.util.Set getStatesKeys()
           
 void move(Node k, Triangle t, int i)
           
 Grid refine()
          First the RefinementListCreator is used to mark some triangles RED.
 void report()
           
 void run()
           
 void setGrid(Grid grid)
          Sets the grid.
 void setRefinementListCreator(GridRefiner.RefinementListCreator refinementListCreator)
           
 void setRefinerDesc(RefinerDesc refinerDesc)
           
 mathcomp.gridgeom.GridRefiner.TriangleRefiner setState(Triangle t, mathcomp.gridgeom.GridRefiner.TriangleRefiner state)
           
 
Methods inherited from class mathcomp.monitor.DefaultAlgorithm
algoAbortIfNeeded, algoCancel, algoClear, algoCount, algoIncrement, algoMax, isAlgoCancel, setAlgoCount, setAlgoMax
 
Methods inherited from class mathcomp.monitor.DefaultReportable
getReport, setReport
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mathcomp.monitor.Reportable
getReport, setReport
 

Field Detail

ALL

public static final GridRefiner.AllRefinementList ALL
Singelton for GridRefiner.AllRefinementList


RED

public static final GridRefiner.RedRefinement RED
The singleton for red refinement.


GREEN

public static final GridRefiner.GreenRefinement[] GREEN
The singletons for green refinement.


YELLOW

public static final GridRefiner.YellowRefinement YELLOW

shouldMarkGreens

public boolean shouldMarkGreens

shouldMoveBoundary

public boolean shouldMoveBoundary
Constructor Detail

GridRefiner

public GridRefiner()
Method Detail

refine

public Grid refine()
First the RefinementListCreator is used to mark some triangles RED. Then a GreenClosure is performed. Finally the refined grid is created by createRefinedGrid()

Returns:
new, refined Grid
See Also:
GreenClosure, createRefinedGrid()

createRefinementList

public java.util.List createRefinementList()

getState

public mathcomp.gridgeom.GridRefiner.TriangleRefiner getState(Triangle t)

setState

public mathcomp.gridgeom.GridRefiner.TriangleRefiner setState(Triangle t,
                                                              mathcomp.gridgeom.GridRefiner.TriangleRefiner state)

getGrid

public Grid getGrid()
Returns the grid.

Returns:
Grid

setGrid

public void setGrid(Grid grid)
Sets the grid.

Parameters:
grid - The grid to set

getRefinementListCreator

public GridRefiner.RefinementListCreator getRefinementListCreator()

setRefinementListCreator

public void setRefinementListCreator(GridRefiner.RefinementListCreator refinementListCreator)

move

public void move(Node k,
                 Triangle t,
                 int i)

getNewGrid

public Grid getNewGrid()
Returns:
the new grid

run

public void run()
Specified by:
run in interface java.lang.Runnable

report

public void report()
Specified by:
report in interface Reportable
Overrides:
report in class DefaultReportable

getRefinerDesc

public RefinerDesc getRefinerDesc()

setRefinerDesc

public void setRefinerDesc(RefinerDesc refinerDesc)

getStatesKeys

public java.util.Set getStatesKeys()