Quadratic Runtime for Creating VectorFunctionSpace( mesh, "DG", 0 )
I have noticed that the creation of a VectorFunctionSpace with piecewise constant functions takes quite long - much longer than a piecewise linear continuous VectorFunctinSpace for the same mesh.
Doing some tests on this I received the impression that there is a quadratic runtime with respect to the meshsize.
Can anybody tell me where the different VectorFunctionS
You can run the following code to see the effect:
import timeit
from dolfin import *
fileCG1 = open( "cg1.txt", "w" )
fileDG0 = open( "dg0.txt", "w" )
for i in range(1,31):
mesh = UnitCubeMesh( 10*i,10,10 )
print "meshsize", 10*i
print "CG 1"
tic = timeit.
V1 = VectorFunctionS
toc = timeit.
time = toc - tic
fileCG1.write( str(time) + " " )
print "done in ", time
print "DG 0"
tic = timeit.
V1 = VectorFunctionS
toc = timeit.
time = toc - tic
fileDG0.write( str(time) + " " )
print "done in ", time
print "\n"
fileCG1.close()
fileDG0.close()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Heinz Zorn for more information if necessary.