mathcomp.assemble.minimalsurface
Class NewtonAssembler

java.lang.Object
  extended by mathcomp.monitor.DefaultReportable
      extended by mathcomp.monitor.DefaultAlgorithm
          extended by mathcomp.assemble.Assembler
              extended by mathcomp.assemble.LagrangeLinearAssembler
                  extended by mathcomp.assemble.minimalsurface.MinimalSurfaceAssembler
                      extended by mathcomp.assemble.minimalsurface.NewtonAssembler
All Implemented Interfaces:
java.lang.Runnable, Algorithm, Reportable, IteratedAssembler

public class NewtonAssembler
extends MinimalSurfaceAssembler
implements IteratedAssembler

This assembler is used to solve the minimal suface problem using Newtons's iterative method.


Field Summary
 
Fields inherited from class mathcomp.assemble.LagrangeLinearAssembler
gradVector
 
Fields inherited from class mathcomp.assemble.Assembler
dirichletBoundaryValues, solScale
 
Fields inherited from interface mathcomp.run.IteratedAssembler
tolerance
 
Constructor Summary
NewtonAssembler()
           
 
Method Summary
 void assembleGlobal()
          The main assemble method generally called from outside.
 ErrorCalculator getErrorCalculator()
           
 double getIt()
          if x(k+1)=x(k)+g(x(k)) returns 0 (NewtonAssembler), if x(k+1)=g(x(k)) returns -1 (FixedPointAssembler);
 double getOldArea()
           
 void init()
           
 int initializeFP()
          this method is used to decide if some iterations should be done using fixed point iteration before using the Newton's method, since this one only converges if the first iteration is enough close to the exact solution.
 boolean isDamped()
           
 boolean isToContinue(Vector x)
          this method defines if the iterative solver stops or continues.
 void setOldSolution(Vector x, Vector yy)
          This method is used to set the previous iteration that is used to calculate the new iteration
 java.lang.String toString()
          Set the name of your assembler by overwriting this method in your assembler class.
 
Methods inherited from class mathcomp.assemble.minimalsurface.MinimalSurfaceAssembler
evalApproxGradient, evalExactGradient, evalExactInitial, evalExactSolution, evalF, getPreferredGridFileName
 
Methods inherited from class mathcomp.assemble.LagrangeLinearAssembler
createDof, createDofExport, evalApproxGradient, evalApproxSolution, evalBasisFuncOnRef, evalGradXBasisFuncOnRef, evalGradYBasisFuncOnRef
 
Methods inherited from class mathcomp.assemble.Assembler
addDirichletNodes, calcDirichletBoundary, createSurfaces, createSurfaces, getDof, getElementMatrix, getEpsilon, getExactPartialX, getExactPartialY, getGrid, getInfoUrl, getM, getSolScale, getY, report, run, setEpsilon, setGrid, setM, setTauIndex, setY
 
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, wait, wait, wait
 
Methods inherited from interface mathcomp.monitor.Reportable
getReport, setReport
 

Constructor Detail

NewtonAssembler

public NewtonAssembler()
Method Detail

assembleGlobal

public void assembleGlobal()
Description copied from class: Assembler
The main assemble method generally called from outside. It once calculates the boundary, the global DOFs and the Dirichlet values. Then Matrix m and right side Vector y are created. Finally an iteration over all elements calls assemble(Grid g, Triangle t, Matrix m) for each element.

Overrides:
assembleGlobal in class Assembler

init

public void init()
Specified by:
init in interface IteratedAssembler

setOldSolution

public void setOldSolution(Vector x,
                           Vector yy)
Description copied from interface: IteratedAssembler
This method is used to set the previous iteration that is used to calculate the new iteration

Specified by:
setOldSolution in interface IteratedAssembler
Parameters:
x - the previous iteration
yy - it's only used in damped Newton's method

getOldArea

public double getOldArea()
Specified by:
getOldArea in interface IteratedAssembler

toString

public java.lang.String toString()
Description copied from class: Assembler
Set the name of your assembler by overwriting this method in your assembler class.

Specified by:
toString in class Assembler
Returns:
the name of the assembler

isToContinue

public boolean isToContinue(Vector x)
Description copied from interface: IteratedAssembler
this method defines if the iterative solver stops or continues. The tolerance is used in this method

Specified by:
isToContinue in interface IteratedAssembler
Parameters:
x - solution of the system of linear equations
Returns:
true if it should contine or false if it should stop

getIt

public double getIt()
Description copied from interface: IteratedAssembler
if x(k+1)=x(k)+g(x(k)) returns 0 (NewtonAssembler), if x(k+1)=g(x(k)) returns -1 (FixedPointAssembler);

Specified by:
getIt in interface IteratedAssembler

isDamped

public boolean isDamped()
Specified by:
isDamped in interface IteratedAssembler
Returns:
true if the iterative solver is damped and false if is not

initializeFP

public int initializeFP()
Description copied from interface: IteratedAssembler
this method is used to decide if some iterations should be done using fixed point iteration before using the Newton's method, since this one only converges if the first iteration is enough close to the exact solution.

Specified by:
initializeFP in interface IteratedAssembler
Returns:
0 (if no iterations should be done using fixed point iteration) or the number of iterations that should be done to initialize the iterative solver

getErrorCalculator

public ErrorCalculator getErrorCalculator()
Overrides:
getErrorCalculator in class Assembler