FEJDMath
Class Refinement

java.lang.Object
  extended byjava.lang.Thread
      extended byFEJDMath.Refinement
All Implemented Interfaces:
java.lang.Runnable

public class Refinement
extends java.lang.Thread

This class is used to refine a mesh so that all the temperature differences do not exceed a given value


Field Summary
private  int border_NB
          The global number of the next border which will be created
private  int elem_NB
          The global number of the next element which will be created
private  Mesh m
          The mesh which we are refining
private  double maxDiff
          The maximum allowed temperatue difference
private  int node_NB
          The global number of the next node which will be created
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Refinement(Mesh m, double maxDiff)
          Constructs a new refinement object, which will refine the mesh m so that no temperature diffrence excedes maxDiff
 
Method Summary
private  double cosABC(Node A, Node B, Node C)
          Returns the cosinus of the angle (ABC)
private  void createNeighbours(Mesh m)
          Creates the lists of the neighbours of each elements
private  int getBorder(Mesh m, Node n1, Node n2)
          Returns the index of the Border (n1, n2).
private static int getBorderDomain(Mesh m, MeshBorder e)
          Returns the index of the Domain Border which contains the MeshBorder e
private  int getDomain(Mesh m, Triangle e)
          Returns the index of the Domain which contains the element e
private  int getIndex(Mesh m, double x, double y)
          Returns the index of the Node, whose coordinates are (x,y)
private  int indexInBorderDomain(BorderDomain db, MeshBorder e)
          Returns the index of the MeshBorder e in the Domain Border db
private  int indexInDomain(Domain d, Triangle e)
          Returns the index of the element e in the Domain d
 void run()
          Refines the mesh m in order for the difference of temperatures between every neighbour Nodes not to be higher than maxDiff
private  Mesh saveAndReload(Mesh m, java.lang.String netName, java.lang.String datName, double maxDiff)
          Saves the .net and .dat files with a name which contains maxDiff and loads them
private  void splitInFour(Mesh m, int i)
          Split the triangle which is indexed with i in four triangles
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

node_NB

private int node_NB
The global number of the next node which will be created


border_NB

private int border_NB
The global number of the next border which will be created


elem_NB

private int elem_NB
The global number of the next element which will be created


m

private Mesh m
The mesh which we are refining


maxDiff

private double maxDiff
The maximum allowed temperatue difference

Constructor Detail

Refinement

public Refinement(Mesh m,
                  double maxDiff)
Constructs a new refinement object, which will refine the mesh m so that no temperature diffrence excedes maxDiff

Method Detail

createNeighbours

private void createNeighbours(Mesh m)
Creates the lists of the neighbours of each elements


cosABC

private double cosABC(Node A,
                      Node B,
                      Node C)
Returns the cosinus of the angle (ABC)


getIndex

private int getIndex(Mesh m,
                     double x,
                     double y)
Returns the index of the Node, whose coordinates are (x,y)


getDomain

private int getDomain(Mesh m,
                      Triangle e)
Returns the index of the Domain which contains the element e


indexInDomain

private int indexInDomain(Domain d,
                          Triangle e)
Returns the index of the element e in the Domain d


getBorder

private int getBorder(Mesh m,
                      Node n1,
                      Node n2)
Returns the index of the Border (n1, n2). If it isn't a Border, returns -1


getBorderDomain

private static int getBorderDomain(Mesh m,
                                   MeshBorder e)
Returns the index of the Domain Border which contains the MeshBorder e


indexInBorderDomain

private int indexInBorderDomain(BorderDomain db,
                                MeshBorder e)
Returns the index of the MeshBorder e in the Domain Border db


saveAndReload

private Mesh saveAndReload(Mesh m,
                           java.lang.String netName,
                           java.lang.String datName,
                           double maxDiff)
Saves the .net and .dat files with a name which contains maxDiff and loads them


splitInFour

private void splitInFour(Mesh m,
                         int i)
Split the triangle which is indexed with i in four triangles


run

public void run()
Refines the mesh m in order for the difference of temperatures between every neighbour Nodes not to be higher than maxDiff