Element Spaces

Currently the only finite element spaces we have are piecewise linear.  We want to have some more choices.  The key to thinking about the spaces is the connection between a basis for the space (which we can consider in a reference if it is convenient) and the nodal (hopefully physical) values we want to use.

The trick is to make sure that there is a one to one mapping.  This means that we need to think about invertibility of mappings to do anything more complicated than piecewise linear.

We are going to revisit the piecewise linear example from this new perspective

Piecewise Linear: 1D.  
Reference set 0≤X≤1.

On the reference set the set of linear functions is the span of the set {(Subscript[f, 1]),(Subscript[f, 2])}={1,X}.  In other words, the set {1,X} is a basis and every linear function is a unique linear combination of the functions f[X]=(Subscript[α, 1])(Subscript[f, 1])[X]+(Subscript[α, 2])(Subscript[f, 2])[X].  We get the nodal values (which we will call (Subscript[v, 1]) and (Subscript[v, 2])) by plugging in X=0 and X=1.  So we get
	({{(Subscript[α, 1])(Subscript[f, 1])[0]+(Subscript[α, 2])(Subscript[f, 2])[0], =, (Subscript[v, 1])}, {(Subscript[α, 1])(Subscript[f, 1])[1]+(Subscript[α, 2])(Subscript[f, 2])[1], =, (Subscript[v, 2])}})
which simplifies to
	(({{1, 0}, {1, 1}}))(OverVector[α])=(OverVector[v])
We can go backwards and forwards between the nodal values (OverVector[v]) and the coefficients (OverVector[α]) because the matrix (({{1, 0}, {1, 1}})) is invertible because Det[(({{1, 0}, {1, 1}}))]=1≠0.

Piecewise Linear: 2D.  
Reference set 0≤(Subscript[X, 1])≤1 and 0≤(Subscript[X, 2])≤1-(Subscript[X, 1]).

On the reference set the set of linear functions is the span of the set {(Subscript[f, 1]),(Subscript[f, 2]),(Subscript[f, 3])}={1,(Subscript[X, 1]),(Subscript[X, 2])}.  If we label the corners of the references set (Subscript[(OverVector[p]), 1])={0,0}, (Subscript[(OverVector[p]), 2])={1,0}, (Subscript[(OverVector[p]), 3])={0,1} with nodal values  (OverVector[v]) we get
	({{(Subscript[α, 1])(Subscript[f, 1])[(Subscript[p, 1])]+(Subscript[α, 2])(Subscript[f, 2])[(Subscript[p, 1])]+(Subscript[α, 3])(Subscript[f, 3])[(Subscript[p, 1])], =, (Subscript[v, 1])}, {(Subscript[α, 1])(Subscript[f, 1])[(Subscript[p, 2])]+(Subscript[α, 2])(Subscript[f, 2])[(Subscript[p, 2])]+(Subscript[α, 3])(Subscript[f, 3])[(Subscript[p, 2])], =, (Subscript[v, 2])}, {(Subscript[α, 1])(Subscript[f, 1])[(Subscript[p, 3])]+(Subscript[α, 2])(Subscript[f, 2])[(Subscript[p, 3])]+(Subscript[α, 3])(Subscript[f, 3])[(Subscript[p, 3])], =, (Subscript[v, 3])}})
which simplifies to
	(({{1, 0, 0}, {1, 1, 0}, {1, 0, 1}}))(OverVector[α])=(OverVector[v])
We can go backwards and forwards between the nodal values (OverVector[v]) and the coefficients (OverVector[α]) because the matrix (({{1, 0, 0}, {1, 1, 0}, {1, 0, 1}})) is invertible because Det[(({{1, 0, 0}, {1, 1, 0}, {1, 0, 1}}))]=1≠0.

Piecewise Bi-Linear: 2D.  
Reference set 0≤(Subscript[X, 1])≤1 and 0≤(Subscript[X, 2])≤1.

On the reference set the set of linear functions is the span of the set {(Subscript[f, 1]),(Subscript[f, 2]),(Subscript[f, 3]), (Subscript[f, 4])}={1,(Subscript[X, 1]),(Subscript[X, 2]), (Subscript[X, 1])(Subscript[X, 2])}.  If we label the corners of the references set (Subscript[(OverVector[p]), 1])={0,0}, (Subscript[(OverVector[p]), 2])={1,0}, (Subscript[(OverVector[p]), 3])={1,1}, (Subscript[(OverVector[p]), 3])={0,1} with nodal values  (OverVector[v]) we get
	({{(Subscript[α, 1])(Subscript[f, 1])[(Subscript[(OverVector[p]), 1])]+(Subscript[α, 2])(Subscript[f, 2])[(Subscript[p, 1])]+(Subscript[α, 3])(Subscript[f, 3])[(Subscript[p, 1])]+(Subscript[α, 4])(Subscript[f, 4])[(Subscript[p, 1])], =, (Subscript[v, 1])}, {(Subscript[α, 1])(Subscript[f, 1])[(Subscript[(OverVector[p]), 2])]+(Subscript[α, 2])(Subscript[f, 2])[(Subscript[p, 2])]+(Subscript[α, 3])(Subscript[f, 3])[(Subscript[p, 2])]+(Subscript[α, 4])(Subscript[f, 4])[(Subscript[p, 2])], =, (Subscript[v, 2])}, {(Subscript[α, 1])(Subscript[f, 1])[(Subscript[(OverVector[p]), 3])]+(Subscript[α, 2])(Subscript[f, 2])[(Subscript[p, 3])]+(Subscript[α, 3])(Subscript[f, 3])[(Subscript[p, 3])]+(Subscript[α, 4])(Subscript[f, 4])[(Subscript[p, 4])], =, (Subscript[v, 3])}, {(Subscript[α, 1])(Subscript[f, 1])[(Subscript[(OverVector[p]), 3])]+(Subscript[α, 2])(Subscript[f, 2])[(Subscript[p, 3])]+(Subscript[α, 3])(Subscript[f, 3])[(Subscript[p, 3])]+(Subscript[α, 4])(Subscript[f, 4])[(Subscript[p, 4])], =, (Subscript[v, 3])}})
which simplifies to
	(({{1, 0, 0}, {1, 1, 0}, {1, 0, 1}}))(OverVector[α])=(OverVector[v])
We can go backwards and forwards between the nodal values (OverVector[v]) and the coefficients (OverVector[α]) because the matrix (({{1, 0, 0}, {1, 1, 0}, {1, 0, 1}})) is invertible because Det[(({{1, 0, 0}, {1, 1, 0}, {1, 0, 1}}))]=1≠0.

Piec

A=Import["C:\\Users\\struther\\Desktop\\mcfe.mtx"]

x=RandomReal[{-1,1},765];
Timing[Table[y=A.x,{100}];]
Timing[Table[A.x,{100}];]

Timing[xx=LinearSolve[A,y] ;]

Norm[x-xx]

ByteCount[A]/24382.

AA=Normal[A];
ByteCount[AA]/(765.^2)

Timing[xxx=LinearSolve[AA,y] ;]

Timing[Table[y=AA.x,{100}];]

Timing[xxx=LinearSolve[A,y,
Method->"Multifrontal"] ;]

Timing[xxx=LinearSolve[AA,y,
Method->"Multifrontal"] ;]

ListPlot[Eigenvalues[AA],
PlotRange->All]

MatrixPlot[A]

ListDensityPlot[A]

Data3 = Table[
{n, 12.  (n^3)}, 
{n, 10, 120,10}];

Data2 = Table[
{n, 12.  (n^2)}, 
{n, 10, 120,10}];

ListLogLogPlot[{Data2,Data3},
Frame->True,
GridLines->Automatic]

ListLinePlot