mathcomp.assemble
Class LagrangeSquareAssembler

java.lang.Object
  extended by mathcomp.monitor.DefaultReportable
      extended by mathcomp.monitor.DefaultAlgorithm
          extended by mathcomp.assemble.Assembler
              extended by mathcomp.assemble.LagrangeSquareAssembler
All Implemented Interfaces:
java.lang.Runnable, Algorithm, Reportable
Direct Known Subclasses:
AbstractCDA_Square, SquareLaplaceAssembler

public abstract class LagrangeSquareAssembler
extends Assembler

An Assembler class for piecewise quadratic lagrange basis-functions.

Author:
pht

Field Summary
 
Fields inherited from class mathcomp.assemble.Assembler
dirichletBoundaryValues, solScale
 
Constructor Summary
LagrangeSquareAssembler()
           
 
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 gaussRef, Triangle t, Vector x)
          For H1 error calculations we need to know the gradient of the approximated solution in a node n.
 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 Node u on the quadratic Basisfunktion with the local number localBasisNumber on the standart-triangle.
 double evalGradXBasisFuncOnRef(Node u, int localBasisNumber)
           
 double evalGradYBasisFuncOnRef(Node u, int localBasisNumber)
           
 java.util.List getLdof(Triangle t, java.util.List ldof)
          Every Assambler has to define the local DOFs for an element.
 int getLocalNodeNumber(Triangle t, Node n)
          Gets the local Node number to a Node on a quadratic triangle element.
 
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
 

Constructor Detail

LagrangeSquareAssembler

public LagrangeSquareAssembler()
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

getLdof

public java.util.List getLdof(Triangle t,
                              java.util.List ldof)
Description copied from class: Assembler
Every Assambler has to define the local DOFs for an element. Depending on what FE-space you choose the local DOFs vary

Returns:
the List containing the local DOFs

createDofExport

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

getLocalNodeNumber

public int getLocalNodeNumber(Triangle t,
                              Node n)
Gets the local Node number to a Node on a quadratic triangle element. By convention corner nodes have the local numbers 0,1 and 2 then the opposite edge middle node of corner node 0 is 3, and so on, so the edge middle nodes have local numbers 3,4 and 5. If the node is no local dof on this element we return -1.

Parameters:
t - the current triangle
n - the node to find the local number of
Returns:
the local node number on this element

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

evalBasisFuncOnRef

public double evalBasisFuncOnRef(Node u,
                                 int localBasisNumber)
Returns the value of the Node u on the quadratic Basisfunktion with the local number localBasisNumber on the standart-triangle.


evalGradXBasisFuncOnRef

public double evalGradXBasisFuncOnRef(Node u,
                                      int localBasisNumber)

evalGradYBasisFuncOnRef

public double evalGradYBasisFuncOnRef(Node u,
                                      int localBasisNumber)

evalApproxGradient

public double[] evalApproxGradient(Node gaussRef,
                                   Triangle t,
                                   Vector x)
Description copied from class: Assembler
For H1 error calculations we need to know the gradient of the approximated solution in a node n. If we don't know that, return [0.0,0.0] for every node n. TODO this should become abstract.

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