Assembly time
Hello,
Here is a very simple case that consists in imposing a
displacement on the top of a cube.
I want to measure the assembly phase time.
But depending on how I proceed I have different values.
If I use the method assemble_systeme(), I get:
(1)
Summary of timings | Average time Total time Reps
-----
Assemble system | 0.74892 0.74892 1
With the method solve and the option "symmetric=True", I get:
(2)
Summary of timings | Average time Total time Reps
-----
Assemble system | 0.59774 0.59774 1
Finally with the method solve and without the option "symmetric=True", I get:
(3)
Summary of timings | Average time Total time Reps
-----
Assemble cells | 0.1642 0.3284 2
Here I would have 2 questions:
1- why do I get different times in case (1) and (2) ?
2- what is "Assemble cells" compare to "Assemble system" ?
Why not the "Assemble system" time here too ?
Also I noticed that there is no diffence if I use or not
the -O2 compilation option.
I was expecting a "big" difference.
I am using ubuntu 12.04
Thank a lot for any help.
*******
*******
from dolfin import *
# Form compiler options
parameters[
#parameters[
ffc_options = {"optimize": True,
parameters ["form_
# Create mesh and define function space
mesh = UnitCube(20,20,20)
V = VectorFunctionS
# Sub domain for DBC
up, down = compile_
origine = compile_
unit = compile_
# Define Dirichlet boundary
e_zero = Expression("0.0",)
e_deltaZ = Expression(
bcXorigine = DirichletBC(
bcYorigine = DirichletBC(
bcXunit = DirichletBC(
bcZd = DirichletBC(
bcZu = DirichletBC(
# Define variational problem
v = TestFunction(V)
u = TrialFunction(V)
f = Constant((0.0, 0.0, 0.0))
# Material constants
Em = 100000.000000
nu = 0.300000
mu = Constant(Em / (2*(1 + nu))) # Lame's constants
lmbda = Constant(Em * nu / ((1 + nu) * (1 - 2 * nu)))
def sigma(v):
return 2.0*mu*sym(grad(v)) + lmbda*tr(
a = inner(grad(v), sigma(u))*dx
L = inner(v, f)*dx
# Set up boundary conditions
bcs = [bcXorigine, bcYorigine, bcXunit, bcZd, bcZu]
# Compute solution
assembling_only = True
A, b = None, None
if assembling_only:
A, b = assemble_system(a, L, bcs, )
#A.str(True)
else:
solver_
solver_
u = Function(V)
solve(a == L, u, bcs, solver_
# Save solution to VTK format
#ofile_name = os.path.
#vtk_file = File(ofile_name)
#vtk_file << u
# times
list_timings()
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 Dupront for more information if necessary.