mathcomp.assemble
Class ErrorCalculator

java.lang.Object
  extended by mathcomp.monitor.DefaultReportable
      extended by mathcomp.assemble.ErrorCalculator
All Implemented Interfaces:
Reportable
Direct Known Subclasses:
DGErrorCalculator, ErrorCalculatorCompare, ErrorCalculatorOverkill, ErrorCalculatorStep, MSErrorCalculator

public class ErrorCalculator
extends DefaultReportable

A class to calculate errors for a given FEM solution. If we are able to evaluate the solutions at any Node, the error calculation routine remains the same for any elements. If thats proper enough...?

Author:
ch.wust

Constructor Summary
ErrorCalculator()
           
ErrorCalculator(Assembler assembler)
           
 
Method Summary
 Triangle findTriangle(Node n)
           
 double getH1Error()
           
 double getL2Error()
          Returns the L2 error to the FEM solution x.
 double getMaxError()
          Gets the pointwise maximal error compared to the exact solution.
 void printSol()
           
 void report()
           
 void setAssembler(Assembler assembler)
           
 void setFineSolution(Vector fineSolution)
           
 void setSolution(Vector solution)
          Sets a solution to this ErrorCalculator.
 
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
 

Constructor Detail

ErrorCalculator

public ErrorCalculator(Assembler assembler)

ErrorCalculator

public ErrorCalculator()
Method Detail

setAssembler

public void setAssembler(Assembler assembler)

setSolution

public void setSolution(Vector solution)
Sets a solution to this ErrorCalculator.

Parameters:
solution - the solution to be set (adds the Dirichlet Nodes to that solution)

getMaxError

public double getMaxError()
Gets the pointwise maximal error compared to the exact solution. The points that are considered here are all the global dofs and all boundary nodes (we really would not need them, but I used the paintNodes for this, and they're in here. Remember that the getExactValue mathod has to be implemented correctly for this.

Parameters:
x - the solution vector
Returns:

getL2Error

public double getL2Error()
Returns the L2 error to the FEM solution x. Remember that the getExactValue mathod has to be implemented correctly for this.

Parameters:
x - the solution vector
Returns:
the L2 error

getH1Error

public double getH1Error()

report

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

printSol

public void printSol()

findTriangle

public Triangle findTriangle(Node n)

setFineSolution

public void setFineSolution(Vector fineSolution)