mathcomp.assemble
Class LagrangeLinearAssembler

java.lang.Object
  extended by mathcomp.monitor.DefaultReportable
      extended by mathcomp.monitor.DefaultAlgorithm
          extended by mathcomp.assemble.Assembler
              extended by mathcomp.assemble.LagrangeLinearAssembler
All Implemented Interfaces:
java.lang.Runnable, Algorithm, Reportable
Direct Known Subclasses:
AbstractCDA, LaplaceAssembler, MinimalSurfaceAssembler

public abstract class LagrangeLinearAssembler
extends Assembler

An Assembler class for piecewise linear lagrange basis-functions.

Author:
pht

Field Summary
 Vector[] gradVector
          Because the gradient of a linear basis function is constant, we can calculate this gradient for every element once in a pre-processing way.
 
Fields inherited from class mathcomp.assemble.Assembler
dirichletBoundaryValues, solScale
 
Constructor Summary
LagrangeLinearAssembler()
           
 
Method Summary
 void createDof(Grid grid, java.util.Set dof)
          All global Objects, that represent a degreeOfFreedom are added to dof.
 void createDofExport(Triangle t, java.lang.Object[] result)
           
 double[] evalApproxGradient(Node n, Triangle t, Vector x)
          For linear functions we add the gradients of the scaled basisfunction on real
 double evalApproxSolution(Node n, Triangle t, Vector x)
          Evaluates the FEM solution in a Node.
 double evalBasisFuncOnRef(Node u, int localBasisNumber)
          Returns the value of the linear basis function with the local number localBasisNumber at the Node u on the standart-triangle.
 double evalGradXBasisFuncOnRef(Node n, int localBasisNumber)
          Returns the value of the partial derivation of the basis function with the local number localBasisNumber by x at the Node u on the standart-triangle.
 double evalGradYBasisFuncOnRef(Node n, int localBasisNumber)
          Returns the value of the partial derivation of the basis function with the local number localBasisNumber by y at the Node u on the standart-triangle.
 
Methods inherited from class mathcomp.assemble.Assembler
addDirichletNodes, assembleGlobal, calcDirichletBoundary, createSurfaces, createSurfaces, evalExactGradient, evalExactSolution, evalF, getDof, getElementMatrix, getEpsilon, getErrorCalculator, getExactPartialX, getExactPartialY, getGrid, getInfoUrl, getM, getPreferredGridFileName, getSolScale, getY, report, run, setEpsilon, setGrid, setM, setTauIndex, setY, toString
 
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
 

Field Detail

gradVector

public Vector[] gradVector
Because the gradient of a linear basis function is constant, we can calculate this gradient for every element once in a pre-processing way.

Constructor Detail

LagrangeLinearAssembler

public LagrangeLinearAssembler()
Method Detail

createDof

public void createDof(Grid grid,
                      java.util.Set dof)
Description copied from class: Assembler
All global Objects, that represent a degreeOfFreedom are added to dof.

Specified by:
createDof in class Assembler
Parameters:
grid - the current grid
dof - the Set where the DOFs have to be put in

createDofExport

public void createDofExport(Triangle t,
                            java.lang.Object[] result)

evalBasisFuncOnRef

public double evalBasisFuncOnRef(Node u,
                                 int localBasisNumber)
Returns the value of the linear basis function with the local number localBasisNumber at the Node u on the standart-triangle.


evalGradXBasisFuncOnRef

public double evalGradXBasisFuncOnRef(Node n,
                                      int localBasisNumber)
Returns the value of the partial derivation of the basis function with the local number localBasisNumber by x at the Node u on the standart-triangle.


evalGradYBasisFuncOnRef

public double evalGradYBasisFuncOnRef(Node n,
                                      int localBasisNumber)
Returns the value of the partial derivation of the basis function with the local number localBasisNumber by y at the Node u on the standart-triangle.


evalApproxSolution

public double evalApproxSolution(Node n,
                                 Triangle t,
                                 Vector x)
Description copied from class: Assembler
Evaluates the FEM solution in a Node. To do that we do need the triangle. We need this method for an easy l2 and l\infty error calculation.

Specified by:
evalApproxSolution in class Assembler
Parameters:
n - Node where the solution has to be evaluated
t - the triangle that contains the Node n
x - the solution vector
Returns:
the value of the solution in n

evalApproxGradient

public double[] evalApproxGradient(Node n,
                                   Triangle t,
                                   Vector x)
For linear functions we add the gradients of the scaled basisfunction on real

Overrides:
evalApproxGradient in class Assembler
Parameters:
n - node where the approximated gradient should be evaluated