adaptivity for 3D

Asked by Susanne Støle-Hentschel

When extending a working problem with adaptivity from 2D to 3D, problem.solve(...) fails after the first iteration with:

Unable to create Function Space missing entities of dimension 1

I suppose the mesh.init function is not called within the solve function. Any suggestions?

Have you tested adaptivity in 3D? Do you have any examples available?

Best wishes,

Susanne Støle-Hentschel

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marie Rognes (meg-simula) said :
#1

On 06/21/11 13:06, Susanne Støle-Hentschel wrote:
> New question #162201 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/162201
>
> When extending a working problem with adaptivity from 2D to 3D, problem.solve(...) fails after the first iteration with:
>
> Unable to create Function Space missing entities of dimension 1
>
> I suppose the mesh.init function is not called within the solve function. Any suggestions?
>
> Have you tested adaptivity in 3D? Do you have any examples available?
>

We have tested adaptivity in 3D, but not as extensively. Please file a
bug report, include a minimal running example and the DOLFIN version.

--
Marie

Revision history for this message
Susanne Støle-Hentschel (susanne-stole-hentschel) said :
#2

I attached the 3D problem case and the output log.

Susanne

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Marie Rognes
Sent: 21. juni 2011 14:02
To: Støle-Hentschel, Susanne
Subject: Re: [Question #162201]: adaptivity for 3D

Your question #162201 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/162201

    Status: Open => Answered

Marie Rognes proposed the following answer:
On 06/21/11 13:06, Susanne Støle-Hentschel wrote:
> New question #162201 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/162201
>
> When extending a working problem with adaptivity from 2D to 3D, problem.solve(...) fails after the first iteration with:
>
> Unable to create Function Space missing entities of dimension 1
>
> I suppose the mesh.init function is not called within the solve function. Any suggestions?
>
> Have you tested adaptivity in 3D? Do you have any examples available?
>

We have tested adaptivity in 3D, but not as extensively. Please file a bug report, include a minimal running example and the DOLFIN version.

--
Marie

--
If this answers your question, please go to the following page to let us know that it is solved:
https://answers.launchpad.net/dolfin/+question/162201/+confirm?answer_id=0

If you still need help, you can reply to this email or go to the following page to enter your feedback:
https://answers.launchpad.net/dolfin/+question/162201

You received this question notification because you asked the question.

**************************************************************************************
The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. If you have received this transmission in error, please immediately notify the sender by return e-mail and delete this message and its attachments. Any unauthorized use, copying or dissemination of this transmission is prohibited. Neither the confidentiality nor the integrity of this message can be vouched for following transmission on the Internet.
**************************************************************************************

Revision history for this message
Marie Rognes (meg-simula) said :
#3

On 06/21/11 14:15, Susanne Støle-Hentschel wrote:
> Question #162201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/162201
>
> Status: Answered => Open
>
> Susanne Støle-Hentschel is still having a problem:
> I attached the 3D problem case and the output log.
>

Attached where?

--
Marie

> Susanne
>
> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Marie Rognes
> Sent: 21. juni 2011 14:02
> To: Støle-Hentschel, Susanne
> Subject: Re: [Question #162201]: adaptivity for 3D
>
> Your question #162201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/162201
>
> Status: Open => Answered
>
> Marie Rognes proposed the following answer:
> On 06/21/11 13:06, Susanne Støle-Hentschel wrote:
>> New question #162201 on DOLFIN:
>> https://answers.launchpad.net/dolfin/+question/162201
>>
>> When extending a working problem with adaptivity from 2D to 3D, problem.solve(...) fails after the first iteration with:
>>
>> Unable to create Function Space missing entities of dimension 1
>>
>> I suppose the mesh.init function is not called within the solve function. Any suggestions?
>>
>> Have you tested adaptivity in 3D? Do you have any examples available?
>>
>
> We have tested adaptivity in 3D, but not as extensively. Please file a bug report, include a minimal running example and the DOLFIN version.
>
> --
> Marie
>
> --
> If this answers your question, please go to the following page to let us know that it is solved:
> https://answers.launchpad.net/dolfin/+question/162201/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the following page to enter your feedback:
> https://answers.launchpad.net/dolfin/+question/162201
>
> You received this question notification because you asked the question.
>
>
> **************************************************************************************
> The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. If you have received this transmission in error, please immediately notify the sender by return e-mail and delete this message and its attachments. Any unauthorized use, copying or dissemination of this transmission is prohibited. Neither the confidentiality nor the integrity of this message can be vouched for following transmission on the Internet.
> **************************************************************************************
>

Revision history for this message
Andre Massing (massing) said :
#4

On 06/23/2011 12:41 PM, Marie Rognes wrote:
> Question #162201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/162201
>
> Status: Open => Answered
>
> Marie Rognes proposed the following answer:
> On 06/21/11 14:15, Susanne Støle-Hentschel wrote:
>> Question #162201 on DOLFIN changed:
>> https://answers.launchpad.net/dolfin/+question/162201
>>
>> Status: Answered => Open
>>
>> Susanne Støle-Hentschel is still having a problem:
>> I attached the 3D problem case and the output log.
>>
>
> Attached where?

That might the usual problem with launchpad questions. IIRC attachments
are filtered out when you attach them to a reply to a launchpad question.

Andre

>
> --
> Marie
>
>
>> Susanne
>>
>> -----Original Message-----
>> From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Marie Rognes
>> Sent: 21. juni 2011 14:02
>> To: Støle-Hentschel, Susanne
>> Subject: Re: [Question #162201]: adaptivity for 3D
>>
>> Your question #162201 on DOLFIN changed:
>> https://answers.launchpad.net/dolfin/+question/162201
>>
>> Status: Open => Answered
>>
>> Marie Rognes proposed the following answer:
>> On 06/21/11 13:06, Susanne Støle-Hentschel wrote:
>>> New question #162201 on DOLFIN:
>>> https://answers.launchpad.net/dolfin/+question/162201
>>>
>>> When extending a working problem with adaptivity from 2D to 3D, problem.solve(...) fails after the first iteration with:
>>>
>>> Unable to create Function Space missing entities of dimension 1
>>>
>>> I suppose the mesh.init function is not called within the solve function. Any suggestions?
>>>
>>> Have you tested adaptivity in 3D? Do you have any examples available?
>>>
>>
>> We have tested adaptivity in 3D, but not as extensively. Please file a bug report, include a minimal running example and the DOLFIN version.
>>
>> --
>> Marie
>>
>> --
>> If this answers your question, please go to the following page to let us know that it is solved:
>> https://answers.launchpad.net/dolfin/+question/162201/+confirm?answer_id=0
>>
>> If you still need help, you can reply to this email or go to the following page to enter your feedback:
>> https://answers.launchpad.net/dolfin/+question/162201
>>
>> You received this question notification because you asked the question.
>>
>>
>> **************************************************************************************
>> The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. If you have received this transmission in error, please immediately notify the sender by return e-mail and delete this message and its attachments. Any unauthorized use, copying or dissemination of this transmission is prohibited. Neither the confidentiality nor the integrity of this message can be vouched for following transmission on the Internet.
>> **************************************************************************************
>>
>

Revision history for this message
Susanne Støle-Hentschel (susanne-stole-hentschel) said :
#5

Yes, I replied with attachments. I will paste the examples here:

the working 2D example:

______________________________________________________________________________________

from dolfin import *

# Form compiler options
parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["optimize"] = True

parameters["linear_algebra_backend"] = "PETSc";

set_log_level(0)

# PETSc
K = PETScMatrix()
M = PETScMatrix()
R = PETScVector()

# Load mesh and define function space
ou = 2
mesh = Rectangle(0,-6,48,6,4,1)
mesh.order()
V = VectorFunctionSpace(mesh, "Lagrange", ou)

# Sub domain for clamp at left end
def left(x, on_boundary):
 tol = 1.0e-14
 return abs(x[0]) < tol and on_boundary

# Sub domain for shear at right end
class RightBoundary(SubDomain):
 def inside(self, x, on_boundary):
  tol = 1.0e-14
  return abs(x[0]-48) < tol and on_boundary

# Mark boundary parts
domain_parts = MeshFunction("uint",mesh,mesh.topology().dim())
boundary_parts = MeshFunction("uint",mesh,mesh.topology().dim()-1)
dOmega_t = RightBoundary()
dOmega_t.mark(boundary_parts,0)

# Define variational problem
v = TestFunction(V)
u = TrialFunction(V)
f = Constant((0.0, 0.0))
tg = Expression(('0.0','-40.0/288.0*(x[1]+6.0)*(x[1]-6.0)'))

E = 30000.0
nu = 0.25
rho = 1

mu = E / (2.0*(1.0 + nu))
lmbda = E*nu / ((1.0 - nu*nu))

def sigma(v):
    return 2.0*mu*sym(grad(v)) + lmbda*tr(sym(grad(v)))*Identity(v.cell().d)

a = inner(grad(v), sigma(u))*dx
b = inner(rho*v,u)*dx
L = inner(v,f)*dx+inner(v,tg)*ds(0)

# Define goal
u = Function(V)
#g = u[1]*dx
g = u[1]*ds(0)
g.exterior_facet_domains = boundary_parts

u.name = "Displacements"
# Set up boundary condition at left end
c = Constant((0.0, 0.0))
bcl = DirichletBC(V, c, left)

# Set up PDE and solve
eps = 1.e-2
problem = VariationalProblem(a, L, bcl)
problem.solve(u,eps,g)
#u = problem.solve()
#assemble(a, tensor=K, exterior_facet_domains=boundary_parts)
#assemble(L, tensor=R, exterior_facet_domains=boundary_parts)
#bcl.apply(K,R)
#u = Function(V)
#solve(K,u.vector(),R)

print "Max displacement ::", u.fine().vector().max()

# Solve for the gradients
gradu = project(grad(u[0]),VectorFunctionSpace(mesh,"Lagrange",ou))

# Save solution to VTK format
ufile = File("elasticity.pvd")
ufile << u.fine()
ufile << gradu.fine()

# Plot solution
plot(u, mode="displacement", interactive=True)
plot(mesh, interactive=True)

______________________________________________________________________________________

the extended 3D example:
______________________________________________________________________________________

from dolfin import *

# Form compiler options
parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["optimize"] = True

parameters["linear_algebra_backend"] = "PETSc";

set_log_level(1)

# Load mesh and define function space
ou = 1
mesh = Box(0,-6,-6,48,6,6,8,2,2)
mesh.order()
mesh.init(2)
V = VectorFunctionSpace(mesh, "Lagrange", ou)

# Sub domain for clamp at left end
def left(x, on_boundary):
 tol = 1.0e-14
 return abs(x[0]) < tol and on_boundary

# Sub domain for shear at right end
class RightBoundary(SubDomain):
 def inside(self, x, on_boundary):
  tol = 1.0e-14
  return abs(x[0]-48) < tol and on_boundary

# Mark boundary parts
domain_parts = MeshFunction("uint",mesh,mesh.topology().dim())
boundary_parts = MeshFunction("uint",mesh,mesh.topology().dim()-1)
dOmega_t = RightBoundary()
dOmega_t.mark(boundary_parts,0)

# Define variational problem
v = TestFunction(V)
u = TrialFunction(V)
f = Constant((0.0, 0.0, 0.0))
tg = Expression(('0.0','-40.0/288.0*1.0/12*(x[1]+6.0)*(x[1]-6.0)','0.0'))

E = 30000.0
nu = 0.25
rho = 1

mu = E / (2.0*(1.0 + nu))
lmbda = E*nu / ((1+nu)*(1.0 - 2*nu))

def sigma(v):
    return 2.0*mu*sym(grad(v)) + lmbda*tr(sym(grad(v)))*Identity(v.cell().d)

a = inner(grad(v), sigma(u))*dx
b = inner(rho*v,u)*dx
L = inner(v,f)*dx+inner(v,tg)*ds(0)
L.exterior_facet_domains = boundary_parts

# Define goal
u = Function(V)
g = u[1]*ds(0)
g.exterior_facet_domains = boundary_parts

u.name = "Displacements"
# Set up boundary condition at left end
c = Constant((0.0, 0.0, 0.0))
bcl = DirichletBC(V, c, left)

# Set up PDE and solve
eps = 1.e-2
problem = VariationalProblem(a, L, bcl)
problem.solve(u,eps,g)
#u=problem.solve()

#K = PETScMatrix();
#R = PETScVector();
#assemble(a, tensor=K, exterior_facet_domains=boundary_parts)
#assemble(L, tensor=R, exterior_facet_domains=boundary_parts)
#bcl.apply(K,R)
#u = Function(V)
#solve(K,u.vector(),R)

print "Max displacement ::", u.vector().max()

# Solve for the gradients
gradu = project(grad(u[0]),VectorFunctionSpace(mesh,"Lagrange",ou))

# Save solution to VTK format
ufile = File("elasticity3D.pvd")
ufile << u.fine()
ufile << gradu

# Plot solution
#plot(u, mode="displacement", interactive=True)
#plot(mesh, interactive=True)

______________________________________________________________________________________

the output when running the 3D case:
______________________________________________________________________________________

Ordering mesh.
Ordering mesh.
Requesting connectivity 3 - 3.
Requesting connectivity 3 - 0.
Requesting connectivity 0 - 3.
Requesting connectivity 3 - 0.
Computing mesh connectivity 0 - 3 from transpose.
Elapsed time: 2.5034e-05 (compute connectivity 0 - 3)
Computing mesh connectivity 3 - 3 from intersection 3 - 0 - 3.
Elapsed time: 0.000360012 (compute connectivity 3 - 3)
Elapsed time: 0.001194 (compute entities dim = 2)
Elapsed time: 7.00951e-05 (Init dofmap)
Elapsed time: 3.38554e-05 (Init dofmap)
Computing sub domain markers for sub domain 0.
Requesting connectivity 2 - 3.
Requesting connectivity 3 - 2.
Computing mesh connectivity 2 - 3 from transpose.
Elapsed time: 4.81606e-05 (compute connectivity 2 - 3)
Debug: Automatic selection of expression element: <Lagrange vector element of degree ? on a <? cell in ?>: 3 x <CG? on a <? cell in ?>>> [at /usr/lib/python2.6/dist-packages/dolfin/functions/expression.py:683 in _auto_select_element_from_shape()]
Initializing PETSc (ignoring command-line arguments).
Computing sub domain markers for sub domain 0.
Generating forms required for error control.
Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
Requesting connectivity 3 - 3.
Elapsed time: 0.00130296 (compute entities dim = 1)
Elapsed time: 3.60012e-05 (Init dofmap)
Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
Elapsed time: 3.50475e-05 (Init dofmap)
Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
Elapsed time: 3.50475e-05 (Init dofmap)
Elapsed time: 5.00679e-05 (Init dofmap)
Elapsed time: 3.69549e-05 (Init dofmap)
Elapsed time: 3.29018e-05 (Init dofmap)
Elapsed time: 3.00407e-05 (Init dofmap)
Elapsed time: 3.91006e-05 (Init dofmap)
Elapsed time: 3.8147e-05 (Init dofmap)
Elapsed time: 4.3869e-05 (Init dofmap)
Elapsed time: 3.60012e-05 (Init dofmap)

Stage 0.0: Solving primal problem...
  Solving linear variational problem.
    Matrix of size 243 x 243 has 6921 nonzero entries.
    Elapsed time: 0.00113201 (Build sparsity)
    Elapsed time: 0.015172 (Init tensor)
    Elapsed time: 9.53674e-07 (Delete sparsity)
    Elapsed time: 0.000921011 (Assemble cells)
    Elapsed time: 4.05312e-06 (Build sparsity)
    Elapsed time: 0.000138998 (Init tensor)
    Elapsed time: 2.14577e-06 (Delete sparsity)
    Elapsed time: 0.000333071 (Assemble cells)
    Elapsed time: 0.000164032 (Assemble exterior facets)
    Applying boundary conditions to linear system.
    Solving linear system of size 243 x 243 (PETSc LU solver, umfpack).
    Elapsed time: 0.00184608 (LU solver)
Stage 0.1: Computing error estimate...
  Solving linear variational problem.
    Matrix of size 243 x 243 has 6921 nonzero entries.
    Elapsed time: 0.000922918 (Build sparsity)
    Elapsed time: 2.90871e-05 (Init tensor)
    Elapsed time: 9.53674e-07 (Delete sparsity)
    Elapsed time: 0.000906944 (Assemble cells)
    Elapsed time: 3.09944e-06 (Build sparsity)
    Elapsed time: 0.000120163 (Init tensor)
    Elapsed time: 1.19209e-06 (Delete sparsity)
    Elapsed time: 3.00407e-05 (Assemble exterior facets)
    Applying boundary conditions to linear system.
    Solving linear system of size 243 x 243 (PETSc LU solver, umfpack).
    Elapsed time: 0.00142384 (LU solver)
  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 2, None)
  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 2, None)
  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 2, None)
  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
  Applying boundary conditions to linear system.
  Elapsed time: 6.91414e-06 (Build sparsity)
  Elapsed time: 0 (Init tensor)
  Elapsed time: 9.53674e-07 (Delete sparsity)
  Elapsed time: 0.000838995 (Assemble cells)
  Elapsed time: 0.000334024 (Assemble exterior facets)
  Elapsed time: 1.90735e-06 (Build sparsity)
  Elapsed time: 0 (Init tensor)
  Elapsed time: 9.53674e-07 (Delete sparsity)
  Elapsed time: 2.90871e-05 (Assemble exterior facets)
  Estimated error (16.077) does not satisfy tolerance (0.01).

Current adaptive data

  Level | M(u_h) M(u) TOL Error estimate #cells #dofs
  -----------------------------------------------------------
  0 | 22.839 N/A 0.01 16.077 192 243

Stage 0.2: Computing error indicators...
  Computing residual representation
    Computing cell residual representation
    Computing facet residual representation
    Elapsed time: 0.0210009 (Computation of residual representation)
  Elapsed time: 5.00679e-06 (Build sparsity)
  Elapsed time: 1.21593e-05 (Init tensor)
  Elapsed time: 1.19209e-06 (Delete sparsity)
  Elapsed time: 0.000319958 (Assemble cells)
  Elapsed time: 0.00295496 (Assemble exterior facets)
  Elapsed time: 0.012701 (Assemble interior facets)
Stage 0.3: Marking mesh for refinement...
  Marking 22 cells out of 192 (11.5%) for refinement
Stage 0.4: Refining mesh...
  22 cells out of 192 marked for refinement (11.5%).
  Refining simplicial mesh by recursive Rivara bisection.
  Storing parent cell information
  Storing parent facet information
  Requesting connectivity 3 - 3.
  Requesting connectivity 3 - 0.
  Requesting connectivity 0 - 3.
  Requesting connectivity 3 - 0.
  Computing mesh connectivity 0 - 3 from transpose.
  Elapsed time: 4.50611e-05 (compute connectivity 0 - 3)
  Computing mesh connectivity 3 - 3 from intersection 3 - 0 - 3.
  Elapsed time: 0.000455856 (compute connectivity 3 - 3)
  Elapsed time: 0.00156212 (compute entities dim = 2)
  Requesting connectivity 2 - 3.
  Requesting connectivity 3 - 2.
  Computing mesh connectivity 2 - 3 from transpose.
  Elapsed time: 2.5034e-05 (compute connectivity 2 - 3)
  Number of cells increased from 192 to 240 (25.0% increase).
  Plotting mesh (DOLFIN mesh), press 'q' to continue...
Plot active, press 'q' to continue.
Stage 0.5: Updating forms...
  Elapsed time: 6.8903e-05 (Init dofmap)
  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
  Debug: Function has already been refined, returning child function. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:159 in adapt()]
  Debug: MeshFunction has already been refined, returning child [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:404 in adapt()]
  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
  Elapsed time: 4.00543e-05 (Init dofmap)
  Debug: MeshFunction has already been refined, returning child [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:404 in adapt()]
  Debug: Function has already been refined, returning child function. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:159 in adapt()]
Traceback (most recent call last):
  File "cantilever3D_adaptive.py", line 79, in <module>
    problem.solve(u,eps,g)
  File "/usr/lib/python2.6/dist-packages/dolfin/fem/variationalproblem.py", line 99, in solve
    self.adaptive_solve(u, tolerance, goal)
  File "/usr/lib/python2.6/dist-packages/dolfin/fem/variationalproblem.py", line 122, in adaptive_solve
    cpp.VariationalProblem.solve(self, u, tolerance, M, ec)
RuntimeError: *** Error: Unable to create function space, missing entities of dimension 1. Try calling mesh.init(1).

______________________________________________________________________________________

Thank you for your help!

Susanne

Revision history for this message
Martin Sandve Alnæs (martinal) said :
#6

Have you tried calling mesh.init(1) as suggested? As far as I can see,
you only call mesh.init(2).

Martin

2011/6/23 Susanne Støle-Hentschel <email address hidden>:
> Question #162201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/162201
>
>    Status: Answered => Open
>
> Susanne Støle-Hentschel is still having a problem:
> Yes, I replied with attachments. I will paste the examples here:
>
> the working 2D example:
>
> ______________________________________________________________________________________
>
> from dolfin import *
>
> # Form compiler options
> parameters["form_compiler"]["cpp_optimize"] = True
> parameters["form_compiler"]["optimize"] = True
>
> parameters["linear_algebra_backend"] = "PETSc";
>
> set_log_level(0)
>
>
> # PETSc
> K = PETScMatrix()
> M = PETScMatrix()
> R = PETScVector()
>
> # Load mesh and define function space
> ou = 2
> mesh = Rectangle(0,-6,48,6,4,1)
> mesh.order()
> V = VectorFunctionSpace(mesh, "Lagrange", ou)
>
> # Sub domain for clamp at left end
> def left(x, on_boundary):
>        tol = 1.0e-14
>        return abs(x[0]) < tol and on_boundary
>
> # Sub domain for shear at right end
> class RightBoundary(SubDomain):
>        def inside(self, x, on_boundary):
>                tol = 1.0e-14
>                return abs(x[0]-48) < tol and on_boundary
>
> # Mark boundary parts
> domain_parts = MeshFunction("uint",mesh,mesh.topology().dim())
> boundary_parts = MeshFunction("uint",mesh,mesh.topology().dim()-1)
> dOmega_t = RightBoundary()
> dOmega_t.mark(boundary_parts,0)
>
> # Define variational problem
> v = TestFunction(V)
> u = TrialFunction(V)
> f = Constant((0.0, 0.0))
> tg = Expression(('0.0','-40.0/288.0*(x[1]+6.0)*(x[1]-6.0)'))
>
>
> E  = 30000.0
> nu = 0.25
> rho = 1
>
> mu    = E / (2.0*(1.0 + nu))
> lmbda = E*nu / ((1.0 - nu*nu))
>
> def sigma(v):
>    return 2.0*mu*sym(grad(v)) + lmbda*tr(sym(grad(v)))*Identity(v.cell().d)
>
> a = inner(grad(v), sigma(u))*dx
> b = inner(rho*v,u)*dx
> L = inner(v,f)*dx+inner(v,tg)*ds(0)
>
> # Define goal
> u = Function(V)
> #g = u[1]*dx
> g = u[1]*ds(0)
> g.exterior_facet_domains = boundary_parts
>
> u.name = "Displacements"
> # Set up boundary condition at left end
> c   = Constant((0.0, 0.0))
> bcl = DirichletBC(V, c, left)
>
> # Set up PDE and solve
> eps = 1.e-2
> problem = VariationalProblem(a, L, bcl)
> problem.solve(u,eps,g)
> #u = problem.solve()
> #assemble(a, tensor=K, exterior_facet_domains=boundary_parts)
> #assemble(L, tensor=R, exterior_facet_domains=boundary_parts)
> #bcl.apply(K,R)
> #u = Function(V)
> #solve(K,u.vector(),R)
>
>
> print "Max displacement ::", u.fine().vector().max()
>
> # Solve for the gradients
> gradu = project(grad(u[0]),VectorFunctionSpace(mesh,"Lagrange",ou))
>
> # Save solution to VTK format
> ufile = File("elasticity.pvd")
> ufile << u.fine()
> ufile << gradu.fine()
>
> # Plot solution
> plot(u, mode="displacement", interactive=True)
> plot(mesh, interactive=True)
>
>
> ______________________________________________________________________________________
>
> the extended 3D example:
> ______________________________________________________________________________________
>
> from dolfin import *
>
> # Form compiler options
> parameters["form_compiler"]["cpp_optimize"] = True
> parameters["form_compiler"]["optimize"] = True
>
> parameters["linear_algebra_backend"] = "PETSc";
>
> set_log_level(1)
>
>
> # Load mesh and define function space
> ou = 1
> mesh = Box(0,-6,-6,48,6,6,8,2,2)
> mesh.order()
> mesh.init(2)
> V = VectorFunctionSpace(mesh, "Lagrange", ou)
>
> # Sub domain for clamp at left end
> def left(x, on_boundary):
>        tol = 1.0e-14
>        return abs(x[0]) < tol and on_boundary
>
> # Sub domain for shear at right end
> class RightBoundary(SubDomain):
>        def inside(self, x, on_boundary):
>                tol = 1.0e-14
>                return abs(x[0]-48) < tol and on_boundary
>
> # Mark boundary parts
> domain_parts   = MeshFunction("uint",mesh,mesh.topology().dim())
> boundary_parts = MeshFunction("uint",mesh,mesh.topology().dim()-1)
> dOmega_t = RightBoundary()
> dOmega_t.mark(boundary_parts,0)
>
> # Define variational problem
> v = TestFunction(V)
> u = TrialFunction(V)
> f = Constant((0.0, 0.0, 0.0))
> tg = Expression(('0.0','-40.0/288.0*1.0/12*(x[1]+6.0)*(x[1]-6.0)','0.0'))
>
>
> E   = 30000.0
> nu  = 0.25
> rho = 1
>
> mu    = E / (2.0*(1.0 + nu))
> lmbda = E*nu / ((1+nu)*(1.0 - 2*nu))
>
> def sigma(v):
>    return 2.0*mu*sym(grad(v)) + lmbda*tr(sym(grad(v)))*Identity(v.cell().d)
>
> a = inner(grad(v), sigma(u))*dx
> b = inner(rho*v,u)*dx
> L = inner(v,f)*dx+inner(v,tg)*ds(0)
> L.exterior_facet_domains = boundary_parts
>
> # Define goal
> u = Function(V)
> g = u[1]*ds(0)
> g.exterior_facet_domains = boundary_parts
>
> u.name = "Displacements"
> # Set up boundary condition at left end
> c   = Constant((0.0, 0.0, 0.0))
> bcl = DirichletBC(V, c, left)
>
> # Set up PDE and solve
> eps = 1.e-2
> problem = VariationalProblem(a, L, bcl)
> problem.solve(u,eps,g)
> #u=problem.solve()
>
>
> #K = PETScMatrix();
> #R = PETScVector();
> #assemble(a, tensor=K, exterior_facet_domains=boundary_parts)
> #assemble(L, tensor=R, exterior_facet_domains=boundary_parts)
> #bcl.apply(K,R)
> #u = Function(V)
> #solve(K,u.vector(),R)
>
> print "Max displacement ::", u.vector().max()
>
> # Solve for the gradients
> gradu = project(grad(u[0]),VectorFunctionSpace(mesh,"Lagrange",ou))
>
> # Save solution to VTK format
> ufile = File("elasticity3D.pvd")
> ufile << u.fine()
> ufile << gradu
>
> # Plot solution
> #plot(u, mode="displacement", interactive=True)
> #plot(mesh, interactive=True)
>
>
> ______________________________________________________________________________________
>
>
> the output when running the 3D case:
> ______________________________________________________________________________________
>
> Ordering mesh.
> Ordering mesh.
> Requesting connectivity 3 - 3.
> Requesting connectivity 3 - 0.
> Requesting connectivity 0 - 3.
> Requesting connectivity 3 - 0.
> Computing mesh connectivity 0 - 3 from transpose.
> Elapsed time: 2.5034e-05 (compute connectivity 0 - 3)
> Computing mesh connectivity 3 - 3 from intersection 3 - 0 - 3.
> Elapsed time: 0.000360012 (compute connectivity 3 - 3)
> Elapsed time: 0.001194 (compute entities dim = 2)
> Elapsed time: 7.00951e-05 (Init dofmap)
> Elapsed time: 3.38554e-05 (Init dofmap)
> Computing sub domain markers for sub domain 0.
> Requesting connectivity 2 - 3.
> Requesting connectivity 3 - 2.
> Computing mesh connectivity 2 - 3 from transpose.
> Elapsed time: 4.81606e-05 (compute connectivity 2 - 3)
> Debug: Automatic selection of expression element: <Lagrange vector element of degree ? on a <? cell in ?>: 3 x <CG? on a <? cell in ?>>> [at /usr/lib/python2.6/dist-packages/dolfin/functions/expression.py:683 in _auto_select_element_from_shape()]
> Initializing PETSc (ignoring command-line arguments).
> Computing sub domain markers for sub domain 0.
> Generating forms required for error control.
> Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
> Requesting connectivity 3 - 3.
> Elapsed time: 0.00130296 (compute entities dim = 1)
> Elapsed time: 3.60012e-05 (Init dofmap)
> Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
> Elapsed time: 3.50475e-05 (Init dofmap)
> Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
> Elapsed time: 3.50475e-05 (Init dofmap)
> Elapsed time: 5.00679e-05 (Init dofmap)
> Elapsed time: 3.69549e-05 (Init dofmap)
> Elapsed time: 3.29018e-05 (Init dofmap)
> Elapsed time: 3.00407e-05 (Init dofmap)
> Elapsed time: 3.91006e-05 (Init dofmap)
> Elapsed time: 3.8147e-05 (Init dofmap)
> Elapsed time: 4.3869e-05 (Init dofmap)
> Elapsed time: 3.60012e-05 (Init dofmap)
>
> Stage 0.0: Solving primal problem...
>  Solving linear variational problem.
>    Matrix of size 243 x 243 has 6921 nonzero entries.
>    Elapsed time: 0.00113201 (Build sparsity)
>    Elapsed time: 0.015172 (Init tensor)
>    Elapsed time: 9.53674e-07 (Delete sparsity)
>    Elapsed time: 0.000921011 (Assemble cells)
>    Elapsed time: 4.05312e-06 (Build sparsity)
>    Elapsed time: 0.000138998 (Init tensor)
>    Elapsed time: 2.14577e-06 (Delete sparsity)
>    Elapsed time: 0.000333071 (Assemble cells)
>    Elapsed time: 0.000164032 (Assemble exterior facets)
>    Applying boundary conditions to linear system.
>    Solving linear system of size 243 x 243 (PETSc LU solver, umfpack).
>    Elapsed time: 0.00184608 (LU solver)
> Stage 0.1: Computing error estimate...
>  Solving linear variational problem.
>    Matrix of size 243 x 243 has 6921 nonzero entries.
>    Elapsed time: 0.000922918 (Build sparsity)
>    Elapsed time: 2.90871e-05 (Init tensor)
>    Elapsed time: 9.53674e-07 (Delete sparsity)
>    Elapsed time: 0.000906944 (Assemble cells)
>    Elapsed time: 3.09944e-06 (Build sparsity)
>    Elapsed time: 0.000120163 (Init tensor)
>    Elapsed time: 1.19209e-06 (Delete sparsity)
>    Elapsed time: 3.00407e-05 (Assemble exterior facets)
>    Applying boundary conditions to linear system.
>    Solving linear system of size 243 x 243 (PETSc LU solver, umfpack).
>    Elapsed time: 0.00142384 (LU solver)
>  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 2, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 2, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 2, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
>  Applying boundary conditions to linear system.
>  Elapsed time: 6.91414e-06 (Build sparsity)
>  Elapsed time: 0 (Init tensor)
>  Elapsed time: 9.53674e-07 (Delete sparsity)
>  Elapsed time: 0.000838995 (Assemble cells)
>  Elapsed time: 0.000334024 (Assemble exterior facets)
>  Elapsed time: 1.90735e-06 (Build sparsity)
>  Elapsed time: 0 (Init tensor)
>  Elapsed time: 9.53674e-07 (Delete sparsity)
>  Elapsed time: 2.90871e-05 (Assemble exterior facets)
>  Estimated error (16.077) does not satisfy tolerance (0.01).
>
> Current adaptive data
>
>  Level  |  M(u_h)  M(u)   TOL  Error estimate  #cells  #dofs
>  -----------------------------------------------------------
>  0      |  22.839   N/A  0.01          16.077     192    243
>
> Stage 0.2: Computing error indicators...
>  Computing residual representation
>    Computing cell residual representation
>    Computing facet residual representation
>    Elapsed time: 0.0210009 (Computation of residual representation)
>  Elapsed time: 5.00679e-06 (Build sparsity)
>  Elapsed time: 1.21593e-05 (Init tensor)
>  Elapsed time: 1.19209e-06 (Delete sparsity)
>  Elapsed time: 0.000319958 (Assemble cells)
>  Elapsed time: 0.00295496 (Assemble exterior facets)
>  Elapsed time: 0.012701 (Assemble interior facets)
> Stage 0.3: Marking mesh for refinement...
>  Marking 22 cells out of 192 (11.5%) for refinement
> Stage 0.4: Refining mesh...
>  22 cells out of 192 marked for refinement (11.5%).
>  Refining simplicial mesh by recursive Rivara bisection.
>  Storing parent cell information
>  Storing parent facet information
>  Requesting connectivity 3 - 3.
>  Requesting connectivity 3 - 0.
>  Requesting connectivity 0 - 3.
>  Requesting connectivity 3 - 0.
>  Computing mesh connectivity 0 - 3 from transpose.
>  Elapsed time: 4.50611e-05 (compute connectivity 0 - 3)
>  Computing mesh connectivity 3 - 3 from intersection 3 - 0 - 3.
>  Elapsed time: 0.000455856 (compute connectivity 3 - 3)
>  Elapsed time: 0.00156212 (compute entities dim = 2)
>  Requesting connectivity 2 - 3.
>  Requesting connectivity 3 - 2.
>  Computing mesh connectivity 2 - 3 from transpose.
>  Elapsed time: 2.5034e-05 (compute connectivity 2 - 3)
>  Number of cells increased from 192 to 240 (25.0% increase).
>  Plotting mesh (DOLFIN mesh), press 'q' to continue...
> Plot active, press 'q' to continue.
> Stage 0.5: Updating forms...
>  Elapsed time: 6.8903e-05 (Init dofmap)
>  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
>  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
>  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
>  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
>  Debug: Function has already been refined, returning child function. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:159 in adapt()]
>  Debug: MeshFunction has already been refined, returning child [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:404 in adapt()]
>  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
>  Debug: Function space has already been refined, returning child space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133 in adapt()]
>  Elapsed time: 4.00543e-05 (Init dofmap)
>  Debug: MeshFunction has already been refined, returning child [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:404 in adapt()]
>  Debug: Function has already been refined, returning child function. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:159 in adapt()]
> Traceback (most recent call last):
>  File "cantilever3D_adaptive.py", line 79, in <module>
>    problem.solve(u,eps,g)
>  File "/usr/lib/python2.6/dist-packages/dolfin/fem/variationalproblem.py", line 99, in solve
>    self.adaptive_solve(u, tolerance, goal)
>  File "/usr/lib/python2.6/dist-packages/dolfin/fem/variationalproblem.py", line 122, in adaptive_solve
>    cpp.VariationalProblem.solve(self, u, tolerance, M, ec)
> RuntimeError: *** Error: Unable to create function space, missing entities of dimension 1. Try calling mesh.init(1).
>
> ______________________________________________________________________________________
>
> Thank you for your help!
>
> Susanne
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>

Revision history for this message
Susanne Støle-Hentschel (susanne-stole-hentschel) said :
#7

I tried different numbers for init, also init(1), but it does not help. The output is always suggesting init(1) anyway. The first iteration works fine so I was wondering if the init should be recalled upon the new mesh.

Susanne

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Martin Sandve Alnæs
Sent: 23. juni 2011 14:02
To: Støle-Hentschel, Susanne
Subject: Re: [Question #162201]: adaptivity for 3D

Your question #162201 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/162201

    Status: Open => Answered

Martin Sandve Alnæs proposed the following answer:
Have you tried calling mesh.init(1) as suggested? As far as I can see, you only call mesh.init(2).

Martin

2011/6/23 Susanne Støle-Hentschel <email address hidden>:
> Question #162201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/162201
>
>    Status: Answered => Open
>
> Susanne Støle-Hentschel is still having a problem:
> Yes, I replied with attachments. I will paste the examples here:
>
> the working 2D example:
>
> ______________________________________________________________________
> ________________
>
> from dolfin import *
>
> # Form compiler options
> parameters["form_compiler"]["cpp_optimize"] = True
> parameters["form_compiler"]["optimize"] = True
>
> parameters["linear_algebra_backend"] = "PETSc";
>
> set_log_level(0)
>
>
> # PETSc
> K = PETScMatrix()
> M = PETScMatrix()
> R = PETScVector()
>
> # Load mesh and define function space
> ou = 2
> mesh = Rectangle(0,-6,48,6,4,1)
> mesh.order()
> V = VectorFunctionSpace(mesh, "Lagrange", ou)
>
> # Sub domain for clamp at left end
> def left(x, on_boundary):
>        tol = 1.0e-14
>        return abs(x[0]) < tol and on_boundary
>
> # Sub domain for shear at right end
> class RightBoundary(SubDomain):
>        def inside(self, x, on_boundary):
>                tol = 1.0e-14
>                return abs(x[0]-48) < tol and on_boundary
>
> # Mark boundary parts
> domain_parts = MeshFunction("uint",mesh,mesh.topology().dim())
> boundary_parts = MeshFunction("uint",mesh,mesh.topology().dim()-1)
> dOmega_t = RightBoundary()
> dOmega_t.mark(boundary_parts,0)
>
> # Define variational problem
> v = TestFunction(V)
> u = TrialFunction(V)
> f = Constant((0.0, 0.0))
> tg = Expression(('0.0','-40.0/288.0*(x[1]+6.0)*(x[1]-6.0)'))
>
>
> E  = 30000.0
> nu = 0.25
> rho = 1
>
> mu    = E / (2.0*(1.0 + nu))
> lmbda = E*nu / ((1.0 - nu*nu))
>
> def sigma(v):
>    return 2.0*mu*sym(grad(v)) +
> lmbda*tr(sym(grad(v)))*Identity(v.cell().d)
>
> a = inner(grad(v), sigma(u))*dx
> b = inner(rho*v,u)*dx
> L = inner(v,f)*dx+inner(v,tg)*ds(0)
>
> # Define goal
> u = Function(V)
> #g = u[1]*dx
> g = u[1]*ds(0)
> g.exterior_facet_domains = boundary_parts
>
> u.name = "Displacements"
> # Set up boundary condition at left end c   = Constant((0.0, 0.0)) bcl
> = DirichletBC(V, c, left)
>
> # Set up PDE and solve
> eps = 1.e-2
> problem = VariationalProblem(a, L, bcl)
> problem.solve(u,eps,g)
> #u = problem.solve()
> #assemble(a, tensor=K, exterior_facet_domains=boundary_parts)
> #assemble(L, tensor=R, exterior_facet_domains=boundary_parts)
> #bcl.apply(K,R)
> #u = Function(V)
> #solve(K,u.vector(),R)
>
>
> print "Max displacement ::", u.fine().vector().max()
>
> # Solve for the gradients
> gradu = project(grad(u[0]),VectorFunctionSpace(mesh,"Lagrange",ou))
>
> # Save solution to VTK format
> ufile = File("elasticity.pvd")
> ufile << u.fine()
> ufile << gradu.fine()
>
> # Plot solution
> plot(u, mode="displacement", interactive=True) plot(mesh,
> interactive=True)
>
>
> ______________________________________________________________________
> ________________
>
> the extended 3D example:
> ______________________________________________________________________
> ________________
>
> from dolfin import *
>
> # Form compiler options
> parameters["form_compiler"]["cpp_optimize"] = True
> parameters["form_compiler"]["optimize"] = True
>
> parameters["linear_algebra_backend"] = "PETSc";
>
> set_log_level(1)
>
>
> # Load mesh and define function space
> ou = 1
> mesh = Box(0,-6,-6,48,6,6,8,2,2)
> mesh.order()
> mesh.init(2)
> V = VectorFunctionSpace(mesh, "Lagrange", ou)
>
> # Sub domain for clamp at left end
> def left(x, on_boundary):
>        tol = 1.0e-14
>        return abs(x[0]) < tol and on_boundary
>
> # Sub domain for shear at right end
> class RightBoundary(SubDomain):
>        def inside(self, x, on_boundary):
>                tol = 1.0e-14
>                return abs(x[0]-48) < tol and on_boundary
>
> # Mark boundary parts
> domain_parts   = MeshFunction("uint",mesh,mesh.topology().dim())
> boundary_parts = MeshFunction("uint",mesh,mesh.topology().dim()-1)
> dOmega_t = RightBoundary()
> dOmega_t.mark(boundary_parts,0)
>
> # Define variational problem
> v = TestFunction(V)
> u = TrialFunction(V)
> f = Constant((0.0, 0.0, 0.0))
> tg =
> Expression(('0.0','-40.0/288.0*1.0/12*(x[1]+6.0)*(x[1]-6.0)','0.0'))
>
>
> E   = 30000.0
> nu  = 0.25
> rho = 1
>
> mu    = E / (2.0*(1.0 + nu))
> lmbda = E*nu / ((1+nu)*(1.0 - 2*nu))
>
> def sigma(v):
>    return 2.0*mu*sym(grad(v)) +
> lmbda*tr(sym(grad(v)))*Identity(v.cell().d)
>
> a = inner(grad(v), sigma(u))*dx
> b = inner(rho*v,u)*dx
> L = inner(v,f)*dx+inner(v,tg)*ds(0)
> L.exterior_facet_domains = boundary_parts
>
> # Define goal
> u = Function(V)
> g = u[1]*ds(0)
> g.exterior_facet_domains = boundary_parts
>
> u.name = "Displacements"
> # Set up boundary condition at left end c   = Constant((0.0, 0.0,
> 0.0)) bcl = DirichletBC(V, c, left)
>
> # Set up PDE and solve
> eps = 1.e-2
> problem = VariationalProblem(a, L, bcl)
> problem.solve(u,eps,g)
> #u=problem.solve()
>
>
> #K = PETScMatrix();
> #R = PETScVector();
> #assemble(a, tensor=K, exterior_facet_domains=boundary_parts)
> #assemble(L, tensor=R, exterior_facet_domains=boundary_parts)
> #bcl.apply(K,R)
> #u = Function(V)
> #solve(K,u.vector(),R)
>
> print "Max displacement ::", u.vector().max()
>
> # Solve for the gradients
> gradu = project(grad(u[0]),VectorFunctionSpace(mesh,"Lagrange",ou))
>
> # Save solution to VTK format
> ufile = File("elasticity3D.pvd")
> ufile << u.fine()
> ufile << gradu
>
> # Plot solution
> #plot(u, mode="displacement", interactive=True) #plot(mesh,
> interactive=True)
>
>
> ______________________________________________________________________
> ________________
>
>
> the output when running the 3D case:
> ______________________________________________________________________
> ________________
>
> Ordering mesh.
> Ordering mesh.
> Requesting connectivity 3 - 3.
> Requesting connectivity 3 - 0.
> Requesting connectivity 0 - 3.
> Requesting connectivity 3 - 0.
> Computing mesh connectivity 0 - 3 from transpose.
> Elapsed time: 2.5034e-05 (compute connectivity 0 - 3) Computing mesh
> connectivity 3 - 3 from intersection 3 - 0 - 3.
> Elapsed time: 0.000360012 (compute connectivity 3 - 3) Elapsed time:
> 0.001194 (compute entities dim = 2) Elapsed time: 7.00951e-05 (Init
> dofmap) Elapsed time: 3.38554e-05 (Init dofmap) Computing sub domain
> markers for sub domain 0.
> Requesting connectivity 2 - 3.
> Requesting connectivity 3 - 2.
> Computing mesh connectivity 2 - 3 from transpose.
> Elapsed time: 4.81606e-05 (compute connectivity 2 - 3)
> Debug: Automatic selection of expression element: <Lagrange vector
> element of degree ? on a <? cell in ?>: 3 x <CG? on a <? cell in ?>>>
> [at
> /usr/lib/python2.6/dist-packages/dolfin/functions/expression.py:683 in
> _auto_select_element_from_shape()]
> Initializing PETSc (ignoring command-line arguments).
> Computing sub domain markers for sub domain 0.
> Generating forms required for error control.
> Extracted finite element for sub system: FiniteElement('Lagrange',
> Cell('tetrahedron', Space(3)), 1, None) Requesting connectivity 3 - 3.
> Elapsed time: 0.00130296 (compute entities dim = 1) Elapsed time:
> 3.60012e-05 (Init dofmap) Extracted finite element for sub system:
> FiniteElement('Lagrange', Cell('tetrahedron', Space(3)), 1, None)
> Elapsed time: 3.50475e-05 (Init dofmap) Extracted finite element for
> sub system: FiniteElement('Lagrange', Cell('tetrahedron', Space(3)),
> 1, None) Elapsed time: 3.50475e-05 (Init dofmap) Elapsed time:
> 5.00679e-05 (Init dofmap) Elapsed time: 3.69549e-05 (Init dofmap)
> Elapsed time: 3.29018e-05 (Init dofmap) Elapsed time: 3.00407e-05
> (Init dofmap) Elapsed time: 3.91006e-05 (Init dofmap) Elapsed time:
> 3.8147e-05 (Init dofmap) Elapsed time: 4.3869e-05 (Init dofmap)
> Elapsed time: 3.60012e-05 (Init dofmap)
>
> Stage 0.0: Solving primal problem...
>  Solving linear variational problem.
>    Matrix of size 243 x 243 has 6921 nonzero entries.
>    Elapsed time: 0.00113201 (Build sparsity)
>    Elapsed time: 0.015172 (Init tensor)
>    Elapsed time: 9.53674e-07 (Delete sparsity)
>    Elapsed time: 0.000921011 (Assemble cells)
>    Elapsed time: 4.05312e-06 (Build sparsity)
>    Elapsed time: 0.000138998 (Init tensor)
>    Elapsed time: 2.14577e-06 (Delete sparsity)
>    Elapsed time: 0.000333071 (Assemble cells)
>    Elapsed time: 0.000164032 (Assemble exterior facets)
>    Applying boundary conditions to linear system.
>    Solving linear system of size 243 x 243 (PETSc LU solver, umfpack).
>    Elapsed time: 0.00184608 (LU solver) Stage 0.1: Computing error
> estimate...
>  Solving linear variational problem.
>    Matrix of size 243 x 243 has 6921 nonzero entries.
>    Elapsed time: 0.000922918 (Build sparsity)
>    Elapsed time: 2.90871e-05 (Init tensor)
>    Elapsed time: 9.53674e-07 (Delete sparsity)
>    Elapsed time: 0.000906944 (Assemble cells)
>    Elapsed time: 3.09944e-06 (Build sparsity)
>    Elapsed time: 0.000120163 (Init tensor)
>    Elapsed time: 1.19209e-06 (Delete sparsity)
>    Elapsed time: 3.00407e-05 (Assemble exterior facets)
>    Applying boundary conditions to linear system.
>    Solving linear system of size 243 x 243 (PETSc LU solver, umfpack).
>    Elapsed time: 0.00142384 (LU solver)
>  Extracted finite element for sub system: FiniteElement('Lagrange',
> Cell('tetrahedron', Space(3)), 2, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange',
> Cell('tetrahedron', Space(3)), 1, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange',
> Cell('tetrahedron', Space(3)), 2, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange',
> Cell('tetrahedron', Space(3)), 1, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange',
> Cell('tetrahedron', Space(3)), 2, None)
>  Extracted finite element for sub system: FiniteElement('Lagrange',
> Cell('tetrahedron', Space(3)), 1, None)
>  Applying boundary conditions to linear system.
>  Elapsed time: 6.91414e-06 (Build sparsity)
>  Elapsed time: 0 (Init tensor)
>  Elapsed time: 9.53674e-07 (Delete sparsity)
>  Elapsed time: 0.000838995 (Assemble cells)
>  Elapsed time: 0.000334024 (Assemble exterior facets)
>  Elapsed time: 1.90735e-06 (Build sparsity)
>  Elapsed time: 0 (Init tensor)
>  Elapsed time: 9.53674e-07 (Delete sparsity)
>  Elapsed time: 2.90871e-05 (Assemble exterior facets)
>  Estimated error (16.077) does not satisfy tolerance (0.01).
>
> Current adaptive data
>
>  Level  |  M(u_h)  M(u)   TOL  Error estimate  #cells  #dofs
>  -----------------------------------------------------------
>  0      |  22.839   N/A  0.01          16.077     192    243
>
> Stage 0.2: Computing error indicators...
>  Computing residual representation
>    Computing cell residual representation
>    Computing facet residual representation
>    Elapsed time: 0.0210009 (Computation of residual representation)
>  Elapsed time: 5.00679e-06 (Build sparsity)
>  Elapsed time: 1.21593e-05 (Init tensor)
>  Elapsed time: 1.19209e-06 (Delete sparsity)
>  Elapsed time: 0.000319958 (Assemble cells)
>  Elapsed time: 0.00295496 (Assemble exterior facets)
>  Elapsed time: 0.012701 (Assemble interior facets) Stage 0.3: Marking
> mesh for refinement...
>  Marking 22 cells out of 192 (11.5%) for refinement Stage 0.4:
> Refining mesh...
>  22 cells out of 192 marked for refinement (11.5%).
>  Refining simplicial mesh by recursive Rivara bisection.
>  Storing parent cell information
>  Storing parent facet information
>  Requesting connectivity 3 - 3.
>  Requesting connectivity 3 - 0.
>  Requesting connectivity 0 - 3.
>  Requesting connectivity 3 - 0.
>  Computing mesh connectivity 0 - 3 from transpose.
>  Elapsed time: 4.50611e-05 (compute connectivity 0 - 3)
>  Computing mesh connectivity 3 - 3 from intersection 3 - 0 - 3.
>  Elapsed time: 0.000455856 (compute connectivity 3 - 3)
>  Elapsed time: 0.00156212 (compute entities dim = 2)
>  Requesting connectivity 2 - 3.
>  Requesting connectivity 3 - 2.
>  Computing mesh connectivity 2 - 3 from transpose.
>  Elapsed time: 2.5034e-05 (compute connectivity 2 - 3)
>  Number of cells increased from 192 to 240 (25.0% increase).
>  Plotting mesh (DOLFIN mesh), press 'q' to continue...
> Plot active, press 'q' to continue.
> Stage 0.5: Updating forms...
>  Elapsed time: 6.8903e-05 (Init dofmap)
>  Debug: Function space has already been refined, returning child
> space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133
> in adapt()]
>  Debug: Function space has already been refined, returning child
> space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133
> in adapt()]
>  Debug: Function space has already been refined, returning child
> space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133
> in adapt()]
>  Debug: Function space has already been refined, returning child
> space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133
> in adapt()]
>  Debug: Function has already been refined, returning child function.
> [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:159 in
> adapt()]
>  Debug: MeshFunction has already been refined, returning child [at
> /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:404 in
> adapt()]
>  Debug: Function space has already been refined, returning child
> space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133
> in adapt()]
>  Debug: Function space has already been refined, returning child
> space. [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:133
> in adapt()]
>  Elapsed time: 4.00543e-05 (Init dofmap)
>  Debug: MeshFunction has already been refined, returning child [at
> /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:404 in
> adapt()]
>  Debug: Function has already been refined, returning child function.
> [at /build/buildd/dolfin-0.9.11/dolfin/adaptivity/adapt.cpp:159 in adapt()] Traceback (most recent call last):
>  File "cantilever3D_adaptive.py", line 79, in <module>
>    problem.solve(u,eps,g)
>  File
> "/usr/lib/python2.6/dist-packages/dolfin/fem/variationalproblem.py",
> line 99, in solve
>    self.adaptive_solve(u, tolerance, goal)
>  File
> "/usr/lib/python2.6/dist-packages/dolfin/fem/variationalproblem.py",
> line 122, in adaptive_solve
>    cpp.VariationalProblem.solve(self, u, tolerance, M, ec)
> RuntimeError: *** Error: Unable to create function space, missing entities of dimension 1. Try calling mesh.init(1).
>
> ______________________________________________________________________
> ________________
>
> Thank you for your help!
>
> Susanne
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>

--
If this answers your question, please go to the following page to let us know that it is solved:
https://answers.launchpad.net/dolfin/+question/162201/+confirm?answer_id=5

If you still need help, you can reply to this email or go to the following page to enter your feedback:
https://answers.launchpad.net/dolfin/+question/162201

You received this question notification because you asked the question.

**************************************************************************************
The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. If you have received this transmission in error, please immediately notify the sender by return e-mail and delete this message and its attachments. Any unauthorized use, copying or dissemination of this transmission is prohibited. Neither the confidentiality nor the integrity of this message can be vouched for following transmission on the Internet.
**************************************************************************************

Revision history for this message
Marie Rognes (meg-simula) said :
#8

On 06/23/11 13:50, Susanne Støle-Hentschel wrote:
> Question #162201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/162201
>
> Status: Answered => Open
>
> Susanne Støle-Hentschel is still having a problem:
> Yes, I replied with attachments. I will paste the examples here:
>

Thanks.

I've filed this as a bug (https://bugs.launchpad.net/dolfin/+bug/801159)
and will look at it when I get a chance (not today.)

Two comments:

1) Please remove all commented out code and non-essential stuff when
posting code -- then it is easier for us to respond to.

> g = u[1]*ds(0)
> g.exterior_facet_domains = boundary_parts

2) This syntax (g.exterior_facet_domains = ...) is obsolete in the
development branch (and hence in the following releases)

--
Marie

Can you help with this problem?

Provide an answer of your own, or ask Susanne Støle-Hentschel for more information if necessary.

To post a message you must log in.