Flow past a bump

Asked by Patrick Farrell

Hi!

I came across your paper on cbc.rans/cbc.pdesys:

http://dx.doi.org/10.1016/j.advwatres.2011.02.013

and thought I'd try to reproduce the results of your
second example (6.2).

a) I think that example corresponds to
cbc/cfd/ransmodels/demo/turbulent_apbl.py, is that correct?

b) When I try to run it, it appears to try to load data
that isn't there:
No such file or directory: '../../data/channel_OriginalV2F_395.0.ius'

c) From grepping, it seems that file is supposed to be written
by turbulent_channel.py, is that correct?

d) When I try to run turbulent_channel.py to generate the data,
the Eikonal equation fails to solve:

  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
    self.bc = self.create_BCs(self.boundaries)
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 36, in create_BCs
    bcu = V2F.create_BCs(self, bcs)
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F.py", line 78, in create_BCs
    self.distance = Eikonal(self.mesh, self.boundaries)
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Eikonal.py", line 31, in __init__
    solve(A1, self.y_.vector(), b1, self.prm['linear_solver'], self.prm['precond'])
  File "/home/pef/src/dolfin/trunk/local/lib/python2.7/site-packages/dolfin/fem/solving.py", line 260, in solve
    return cpp.la_solve(*args)
  File "/home/pef/src/dolfin/trunk/local/lib/python2.7/site-packages/dolfin/cpp/la.py", line 4154, in la_solve
    return _la.la_solve(*args)
TypeError: in method 'la_solve', argument 4 of type 'std::string'

When I print out self.prm['linear_solver'] and self.prm['precond'], I
get:

defaultdict(<function <lambda> at 0x38e97d0>, {})
defaultdict(<function <lambda> at 0x38e9848>, {})

e) Anyway, if I set those to be 'gmres', 'ilu', I get a crash
later with

  File "turbulent_channel.py", line 95, in <module>
    model=problem_parameters['turbulence_model'])
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 23, in __init__
    parameters=parameters)
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 20, in __init__
    PDESystem.__init__(self, system_composition, problem, parameters)
  File "/data/pfarrell/src/cbcpdesys/cbc/pdesys/PDESystem.py", line 109, in __init__
    self.setup()
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
    self.bc = self.create_BCs(self.boundaries)
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 40, in create_BCs
    bcu['ke'].append(QWall['ke'](bc, self.y, self.nu(0)))
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 236, in __init__
    Wallfunction.__init__(self, y.function_space(), bc)
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 30, in __init__
    self.v2c, self.c2v = v2c, c2v = self.map_cells_and_vertices(V)
  File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 128, in map_cells_and_vertices
    dofmap.tabulate_dofs(a, c)
AttributeError: 'GenericDofMap' object has no attribute 'tabulate_dofs'

This is both with the package from the fenics-dev PPA, and with
a recent trunk build of dolfin.

Any suggestions? Is it possible to still run these examples?

Question information

Language:
English Edit question
Status:
Answered
For:
CBC.PDESys Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mikael Mortensen (mikael-mortensen) said :
#1

Hi Patrick,

Thanks for pointing this error out. Seems like the Eikonal solver is broken by the new solve interface of Fenics. I have committed a fix.

Den Oct 2, 2012 kl. 2:20 PM skrev Patrick Farrell:

> New question #210144 on CBC.PDESys:
> https://answers.launchpad.net/cbcpdesys/+question/210144
>
> Hi!
>
> I came across your paper on cbc.rans/cbc.pdesys:
>
> http://dx.doi.org/10.1016/j.advwatres.2011.02.013
>
> and thought I'd try to reproduce the results of your
> second example (6.2).
>
> a) I think that example corresponds to
> cbc/cfd/ransmodels/demo/turbulent_apbl.py, is that correct?

That is correct.
>
> b) When I try to run it, it appears to try to load data
> that isn't there:
> No such file or directory: '../../data/channel_OriginalV2F_395.0.ius'
>
> c) From grepping, it seems that file is supposed to be written
> by turbulent_channel.py, is that correct?

Correct again. Run a plain channel to generate inlet conditions for a complex channel.

>
> d) When I try to run turbulent_channel.py to generate the data,
> the Eikonal equation fails to solve:
>
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
> self.bc = self.create_BCs(self.boundaries)
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 36, in create_BCs
> bcu = V2F.create_BCs(self, bcs)
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F.py", line 78, in create_BCs
> self.distance = Eikonal(self.mesh, self.boundaries)
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Eikonal.py", line 31, in __init__
> solve(A1, self.y_.vector(), b1, self.prm['linear_solver'], self.prm['precond'])
> File "/home/pef/src/dolfin/trunk/local/lib/python2.7/site-packages/dolfin/fem/solving.py", line 260, in solve
> return cpp.la_solve(*args)
> File "/home/pef/src/dolfin/trunk/local/lib/python2.7/site-packages/dolfin/cpp/la.py", line 4154, in la_solve
> return _la.la_solve(*args)
> TypeError: in method 'la_solve', argument 4 of type 'std::string'
>
> When I print out self.prm['linear_solver'] and self.prm['precond'], I
> get:

Try again, it works now for me.

Best regards

Mikael

>
> defaultdict(<function <lambda> at 0x38e97d0>, {})
> defaultdict(<function <lambda> at 0x38e9848>, {})
>
> e) Anyway, if I set those to be 'gmres', 'ilu', I get a crash
> later with
>
> File "turbulent_channel.py", line 95, in <module>
> model=problem_parameters['turbulence_model'])
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 23, in __init__
> parameters=parameters)
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 20, in __init__
> PDESystem.__init__(self, system_composition, problem, parameters)
> File "/data/pfarrell/src/cbcpdesys/cbc/pdesys/PDESystem.py", line 109, in __init__
> self.setup()
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
> self.bc = self.create_BCs(self.boundaries)
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 40, in create_BCs
> bcu['ke'].append(QWall['ke'](bc, self.y, self.nu(0)))
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 236, in __init__
> Wallfunction.__init__(self, y.function_space(), bc)
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 30, in __init__
> self.v2c, self.c2v = v2c, c2v = self.map_cells_and_vertices(V)
> File "/data/pfarrell/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 128, in map_cells_and_vertices
> dofmap.tabulate_dofs(a, c)
> AttributeError: 'GenericDofMap' object has no attribute 'tabulate_dofs'
>
> This is both with the package from the fenics-dev PPA, and with
> a recent trunk build of dolfin.
>
> Any suggestions? Is it possible to still run these examples?
>
> --
> You received this question notification because you are an answer
> contact for CBC.PDESys.

Revision history for this message
Patrick Farrell (pefarrell) said :
#2

Hi,

I still get the crash about GenericDofMap:

[pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$ bzr status -V
[pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$
[pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$ python turbulent_channel.py
Building mapping between periodic degrees of freedom.
Extracting matching degrees of freedom for sub space 0.
Extracting matching degrees of freedom for sub space 0.
Extracting matching degrees of freedom for sub space 1.
Extracting matching degrees of freedom for sub space 1.
Creating new work vector for up
Adding PDESubSystem: Steady_Coupled_1
Adding ['linear_solver']['up'] = lu to pdesubsystem up
Adding ['iteration_type'] = Picard to pdesubsystem up
Adding stabilization for constant nu
Setting parameters for OriginalV2F V2F model
Solving linear variational problem.
Creating new work vector for y
Adding PDESubSystem: Eikonal_1
Adding ['linear_solver']['y'] = lu to pdesubsystem y
Adding ['iteration_type'] = Newton to pdesubsystem y
Adding ['omega']['y'] = 1.0 to pdesubsystem y
    Iter 1 error | y | 4.7003e-06 4.9094e+00 |
    Iter 2 error | y | 6.8683e-10 1.0555e-04 |
    Iter 3 error | y | 5.1340e-10 6.5099e-09 |
Building mapping between periodic degrees of freedom.
Extracting matching degrees of freedom for sub space 0.
Extracting matching degrees of freedom for sub space 1.
Building mapping between periodic degrees of freedom.
Extracting matching degrees of freedom for sub space 0.
Extracting matching degrees of freedom for sub space 1.
Traceback (most recent call last):
  File "turbulent_channel.py", line 95, in <module>
    model=problem_parameters['turbulence_model'])
  File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 23, in __init__
    parameters=parameters)
  File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 20, in __init__
    PDESystem.__init__(self, system_composition, problem, parameters)
  File "/home/pef/src/cbcpdesys/cbc/pdesys/PDESystem.py", line 109, in __init__
    self.setup()
  File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
    self.bc = self.create_BCs(self.boundaries)
  File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 40, in create_BCs
    bcu['ke'].append(QWall['ke'](bc, self.y, self.nu(0)))
  File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 236, in __init__
    Wallfunction.__init__(self, y.function_space(), bc)
  File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 30, in __init__
    self.v2c, self.c2v = v2c, c2v = self.map_cells_and_vertices(V)
  File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 128, in map_cells_and_vertices
    dofmap.tabulate_dofs(a, c)
AttributeError: 'GenericDofMap' object has no attribute 'tabulate_dofs'

This is with the latest dolfin trunk (r6948). I can't use the fenics-dev packages because
they are built without PETSc, but PDESubSystems.py hardcodes
parameters["linear_algebra_backend"] = "PETSc" .

Thanks!

Patrick

Revision history for this message
Mikael Mortensen (mikael-mortensen) said :
#3

Hi,

Looks like tabulate_dofs has been removed from the dolfin dofmap. I'm on dolfin revision 6831 and I still have it. I'll see if I can find out what has happened.

You can always overload the PETSc choice by the way, just put

parameters["linear_algebra_backend"] = "Epetra"

just after from cbc.pdesys import * or just after if __name__=='__main__': in turbulent_channel.py. Not really sure why I put it in PDESubSystems.

Best regards

Mikael

Den Oct 2, 2012 kl. 4:15 PM skrev Patrick Farrell:

> Question #210144 on CBC.PDESys changed:
> https://answers.launchpad.net/cbcpdesys/+question/210144
>
> Status: Answered => Open
>
> Patrick Farrell is still having a problem:
> Hi,
>
> I still get the crash about GenericDofMap:
>
> [pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$ bzr status -V
> [pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$
> [pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$ python turbulent_channel.py
> Building mapping between periodic degrees of freedom.
> Extracting matching degrees of freedom for sub space 0.
> Extracting matching degrees of freedom for sub space 0.
> Extracting matching degrees of freedom for sub space 1.
> Extracting matching degrees of freedom for sub space 1.
> Creating new work vector for up
> Adding PDESubSystem: Steady_Coupled_1
> Adding ['linear_solver']['up'] = lu to pdesubsystem up
> Adding ['iteration_type'] = Picard to pdesubsystem up
> Adding stabilization for constant nu
> Setting parameters for OriginalV2F V2F model
> Solving linear variational problem.
> Creating new work vector for y
> Adding PDESubSystem: Eikonal_1
> Adding ['linear_solver']['y'] = lu to pdesubsystem y
> Adding ['iteration_type'] = Newton to pdesubsystem y
> Adding ['omega']['y'] = 1.0 to pdesubsystem y
> Iter 1 error | y | 4.7003e-06 4.9094e+00 |
> Iter 2 error | y | 6.8683e-10 1.0555e-04 |
> Iter 3 error | y | 5.1340e-10 6.5099e-09 |
> Building mapping between periodic degrees of freedom.
> Extracting matching degrees of freedom for sub space 0.
> Extracting matching degrees of freedom for sub space 1.
> Building mapping between periodic degrees of freedom.
> Extracting matching degrees of freedom for sub space 0.
> Extracting matching degrees of freedom for sub space 1.
> Traceback (most recent call last):
> File "turbulent_channel.py", line 95, in <module>
> model=problem_parameters['turbulence_model'])
> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 23, in __init__
> parameters=parameters)
> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 20, in __init__
> PDESystem.__init__(self, system_composition, problem, parameters)
> File "/home/pef/src/cbcpdesys/cbc/pdesys/PDESystem.py", line 109, in __init__
> self.setup()
> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
> self.bc = self.create_BCs(self.boundaries)
> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 40, in create_BCs
> bcu['ke'].append(QWall['ke'](bc, self.y, self.nu(0)))
> File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 236, in __init__
> Wallfunction.__init__(self, y.function_space(), bc)
> File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 30, in __init__
> self.v2c, self.c2v = v2c, c2v = self.map_cells_and_vertices(V)
> File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 128, in map_cells_and_vertices
> dofmap.tabulate_dofs(a, c)
> AttributeError: 'GenericDofMap' object has no attribute 'tabulate_dofs'
>
> This is with the latest dolfin trunk (r6948). I can't use the fenics-dev packages because
> they are built without PETSc, but PDESubSystems.py hardcodes
> parameters["linear_algebra_backend"] = "PETSc" .
>
> Thanks!
>
> Patrick
>
> --
> You received this question notification because you are an answer
> contact for CBC.PDESys.

Revision history for this message
Mikael Mortensen (mikael-mortensen) said :
#4

Hi,

Fix committed!

Mikael

Den Oct 2, 2012 kl. 4:45 PM skrev Mikael Mortensen:

> Question #210144 on CBC.PDESys changed:
> https://answers.launchpad.net/cbcpdesys/+question/210144
>
> Status: Open => Answered
>
> Mikael Mortensen proposed the following answer:
> Hi,
>
> Looks like tabulate_dofs has been removed from the dolfin dofmap. I'm on
> dolfin revision 6831 and I still have it. I'll see if I can find out
> what has happened.
>
> You can always overload the PETSc choice by the way, just put
>
> parameters["linear_algebra_backend"] = "Epetra"
>
> just after from cbc.pdesys import * or just after if
> __name__=='__main__': in turbulent_channel.py. Not really sure why I put
> it in PDESubSystems.
>
> Best regards
>
> Mikael
>
>
> Den Oct 2, 2012 kl. 4:15 PM skrev Patrick Farrell:
>
>> Question #210144 on CBC.PDESys changed:
>> https://answers.launchpad.net/cbcpdesys/+question/210144
>>
>> Status: Answered => Open
>>
>> Patrick Farrell is still having a problem:
>> Hi,
>>
>> I still get the crash about GenericDofMap:
>>
>> [pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$ bzr status -V
>> [pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$
>> [pef@aislinn:~/src/cbcpdesys/cbc/cfd/ransmodels/demo]$ python turbulent_channel.py
>> Building mapping between periodic degrees of freedom.
>> Extracting matching degrees of freedom for sub space 0.
>> Extracting matching degrees of freedom for sub space 0.
>> Extracting matching degrees of freedom for sub space 1.
>> Extracting matching degrees of freedom for sub space 1.
>> Creating new work vector for up
>> Adding PDESubSystem: Steady_Coupled_1
>> Adding ['linear_solver']['up'] = lu to pdesubsystem up
>> Adding ['iteration_type'] = Picard to pdesubsystem up
>> Adding stabilization for constant nu
>> Setting parameters for OriginalV2F V2F model
>> Solving linear variational problem.
>> Creating new work vector for y
>> Adding PDESubSystem: Eikonal_1
>> Adding ['linear_solver']['y'] = lu to pdesubsystem y
>> Adding ['iteration_type'] = Newton to pdesubsystem y
>> Adding ['omega']['y'] = 1.0 to pdesubsystem y
>> Iter 1 error | y | 4.7003e-06 4.9094e+00 |
>> Iter 2 error | y | 6.8683e-10 1.0555e-04 |
>> Iter 3 error | y | 5.1340e-10 6.5099e-09 |
>> Building mapping between periodic degrees of freedom.
>> Extracting matching degrees of freedom for sub space 0.
>> Extracting matching degrees of freedom for sub space 1.
>> Building mapping between periodic degrees of freedom.
>> Extracting matching degrees of freedom for sub space 0.
>> Extracting matching degrees of freedom for sub space 1.
>> Traceback (most recent call last):
>> File "turbulent_channel.py", line 95, in <module>
>> model=problem_parameters['turbulence_model'])
>> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 23, in __init__
>> parameters=parameters)
>> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 20, in __init__
>> PDESystem.__init__(self, system_composition, problem, parameters)
>> File "/home/pef/src/cbcpdesys/cbc/pdesys/PDESystem.py", line 109, in __init__
>> self.setup()
>> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
>> self.bc = self.create_BCs(self.boundaries)
>> File "/home/pef/src/cbcpdesys/cbc/cfd/ransmodels/V2F_2Coupled.py", line 40, in create_BCs
>> bcu['ke'].append(QWall['ke'](bc, self.y, self.nu(0)))
>> File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 236, in __init__
>> Wallfunction.__init__(self, y.function_space(), bc)
>> File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 30, in __init__
>> self.v2c, self.c2v = v2c, c2v = self.map_cells_and_vertices(V)
>> File "/home/pef/src/cbcpdesys/cbc/cfd/tools/Wall.py", line 128, in map_cells_and_vertices
>> dofmap.tabulate_dofs(a, c)
>> AttributeError: 'GenericDofMap' object has no attribute 'tabulate_dofs'
>>
>> This is with the latest dolfin trunk (r6948). I can't use the fenics-dev packages because
>> they are built without PETSc, but PDESubSystems.py hardcodes
>> parameters["linear_algebra_backend"] = "PETSc" .
>>
>> Thanks!
>>
>> Patrick
>>
>> --
>> You received this question notification because you are an answer
>> contact for CBC.PDESys.
>
> --
> You received this question notification because you are an answer
> contact for CBC.PDESys.

Revision history for this message
Patrick Farrell (pefarrell) said :
#5

Sorry to be a pest.

When I run this (r73 of cbcpdesys, r6949 of dolfin, ubuntu precise), I get the following error message:

Building mapping between periodic degrees of freedom.
ESC[1;37;32mDerived Quantity: Ce1ESC[0m
ESC[1;37;32mAdding ['linear_solver']['Ce1'] = lu to pdesubsystem Ce1ESC[0m
ESC[1;37;32mAdding ['apply']['Ce1'] = project to pdesubsystem Ce1ESC[0m
ESC[1;37;32mAdding ['omega']['Ce1'] = 0.7 to pdesubsystem Ce1ESC[0m
Building mapping between periodic degrees of freedom.
[0]PETSC ERROR: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: Floating point exception!
[0]PETSC ERROR: Infinite or not-a-number generated in norm!
[0]PETSC ERROR: ------------------------------------------------------------------------

The backtrace on the call to PetscError doesn't yield very much, unfortunately:

#0 0x00007fffe7146c7c in PetscError () from /usr/lib/petscdir/3.2/linux-gnu-c-opt/lib/libpetsc.so.3.2
#1 0x00007fffe73a0a75 in VecNorm () from /usr/lib/petscdir/3.2/linux-gnu-c-opt/lib/libpetsc.so.3.2
#2 0x00007fffec10ab27 in dolfin::PETScVector::norm (this=0x31c49a0, norm_type=...) at /home/pef/src/dolfin/trunk/dolfin/la/PETScVector.cpp:582
#3 0x00007fffec12580b in dolfin::residual (A=..., x=..., b=...) at /home/pef/src/dolfin/trunk/dolfin/la/solve.cpp:187
#4 0x00007fffcc520c5b in _wrap_residual (args=<optimised out>) at /home/pef/src/dolfin/trunk/build/dolfin/swig/modules/la/modulePYTHON_wrap.cxx:32582
#5 0x000000000049c4d8 in PyEval_EvalFrameEx ()

Any ideas what might be going wrong?

Revision history for this message
Mikael Mortensen (mikael-mortensen) said :
#6

Den Oct 2, 2012 kl. 9:31 PM skrev Patrick Farrell:

> Question #210144 on CBC.PDESys changed:
> https://answers.launchpad.net/cbcpdesys/+question/210144
>
> Status: Answered => Open
>
> Patrick Farrell is still having a problem:
> Sorry to be a pest.

Not at all.

>
> When I run this (r73 of cbcpdesys, r6949 of dolfin, ubuntu precise), I
> get the following error message:
>
> Building mapping between periodic degrees of freedom.
> ESC[1;37;32mDerived Quantity: Ce1ESC[0m
> ESC[1;37;32mAdding ['linear_solver']['Ce1'] = lu to pdesubsystem Ce1ESC[0m
> ESC[1;37;32mAdding ['apply']['Ce1'] = project to pdesubsystem Ce1ESC[0m
> ESC[1;37;32mAdding ['omega']['Ce1'] = 0.7 to pdesubsystem Ce1ESC[0m
> Building mapping between periodic degrees of freedom.
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------
> [0]PETSC ERROR: Floating point exception!
> [0]PETSC ERROR: Infinite or not-a-number generated in norm!
> [0]PETSC ERROR: ------------------------------------------------------------------------
>
> The backtrace on the call to PetscError doesn't yield very much,
> unfortunately:
>
> #0 0x00007fffe7146c7c in PetscError () from /usr/lib/petscdir/3.2/linux-gnu-c-opt/lib/libpetsc.so.3.2
> #1 0x00007fffe73a0a75 in VecNorm () from /usr/lib/petscdir/3.2/linux-gnu-c-opt/lib/libpetsc.so.3.2
> #2 0x00007fffec10ab27 in dolfin::PETScVector::norm (this=0x31c49a0, norm_type=...) at /home/pef/src/dolfin/trunk/dolfin/la/PETScVector.cpp:582
> #3 0x00007fffec12580b in dolfin::residual (A=..., x=..., b=...) at /home/pef/src/dolfin/trunk/dolfin/la/solve.cpp:187
> #4 0x00007fffcc520c5b in _wrap_residual (args=<optimised out>) at /home/pef/src/dolfin/trunk/build/dolfin/swig/modules/la/modulePYTHON_wrap.cxx:32582
> #5 0x000000000049c4d8 in PyEval_EvalFrameEx ()
>
> Any ideas what might be going wrong?

Ah, this is probably because of the Periodic boundary conditions issues of lately. Could you please try this change to line 32 of ransmodels/V2F.py

#Ce1(ns, 'Ce1', V, "1.4*(1. + Ced*sqrt(k_/v2_))"),
DQ_NoBC(ns, 'Ce1', V, "1.4*(1. + Ced*sqrt(k_/v2_))"),

You will now probably get a little further before there are some new problems with the periodic boundaries. I have implemented a fix for periodic boundary conditions in my own branch at lp:~mikael-mortensen/dolfin/dolfin. As of now I think periodic boundary conditions can only be used through the LinearVariationalSolver (like solve(A == L) etc). In my branch I have implemented periodic boundary conditions such that I can have more than one periodic direction, I can use it from python in regular forms and I eliminate slave dofs to obtain a coefficient matrix that is much better conditioned than with the regular PeriodicBC, where you get some bad master/slave rows the Krylov solvers don't like.

Please let me know if I'm wrong and the periodic boundary conditions actually work.

There is currently a plan to incorporate periodic boundary conditions in the dofmaps, so I don't think there will be a fix of the regular PeriodicBC.

Best regards

Mikael

>
> --
> You received this question notification because you are an answer
> contact for CBC.PDESys.

Revision history for this message
Mikael Mortensen (mikael-mortensen) said :
#7

Hi Patrick,

I've added the inlet profile you need to run turbulent_apbl, so that you don't have to run the channel first. Could you please let me know if the demo works now?

Best regards

Mikael

Den Oct 2, 2012 kl. 10:11 PM skrev Mikael Mortensen:

> Question #210144 on CBC.PDESys changed:
> https://answers.launchpad.net/cbcpdesys/+question/210144
>
> Status: Open => Answered
>
> Mikael Mortensen proposed the following answer:
>
> Den Oct 2, 2012 kl. 9:31 PM skrev Patrick Farrell:
>
>> Question #210144 on CBC.PDESys changed:
>> https://answers.launchpad.net/cbcpdesys/+question/210144
>>
>> Status: Answered => Open
>>
>> Patrick Farrell is still having a problem:
>> Sorry to be a pest.
>
> Not at all.
>
>>
>> When I run this (r73 of cbcpdesys, r6949 of dolfin, ubuntu precise), I
>> get the following error message:
>>
>> Building mapping between periodic degrees of freedom.
>> ESC[1;37;32mDerived Quantity: Ce1ESC[0m
>> ESC[1;37;32mAdding ['linear_solver']['Ce1'] = lu to pdesubsystem Ce1ESC[0m
>> ESC[1;37;32mAdding ['apply']['Ce1'] = project to pdesubsystem Ce1ESC[0m
>> ESC[1;37;32mAdding ['omega']['Ce1'] = 0.7 to pdesubsystem Ce1ESC[0m
>> Building mapping between periodic degrees of freedom.
>> [0]PETSC ERROR: --------------------- Error Message ------------------------------------
>> [0]PETSC ERROR: Floating point exception!
>> [0]PETSC ERROR: Infinite or not-a-number generated in norm!
>> [0]PETSC ERROR: ------------------------------------------------------------------------
>>
>> The backtrace on the call to PetscError doesn't yield very much,
>> unfortunately:
>>
>> #0 0x00007fffe7146c7c in PetscError () from /usr/lib/petscdir/3.2/linux-gnu-c-opt/lib/libpetsc.so.3.2
>> #1 0x00007fffe73a0a75 in VecNorm () from /usr/lib/petscdir/3.2/linux-gnu-c-opt/lib/libpetsc.so.3.2
>> #2 0x00007fffec10ab27 in dolfin::PETScVector::norm (this=0x31c49a0, norm_type=...) at /home/pef/src/dolfin/trunk/dolfin/la/PETScVector.cpp:582
>> #3 0x00007fffec12580b in dolfin::residual (A=..., x=..., b=...) at /home/pef/src/dolfin/trunk/dolfin/la/solve.cpp:187
>> #4 0x00007fffcc520c5b in _wrap_residual (args=<optimised out>) at /home/pef/src/dolfin/trunk/build/dolfin/swig/modules/la/modulePYTHON_wrap.cxx:32582
>> #5 0x000000000049c4d8 in PyEval_EvalFrameEx ()
>>
>> Any ideas what might be going wrong?
>
> Ah, this is probably because of the Periodic boundary conditions issues
> of lately. Could you please try this change to line 32 of
> ransmodels/V2F.py
>
> #Ce1(ns, 'Ce1', V, "1.4*(1. + Ced*sqrt(k_/v2_))"),
> DQ_NoBC(ns, 'Ce1', V, "1.4*(1. + Ced*sqrt(k_/v2_))"),
>
> You will now probably get a little further before there are some new
> problems with the periodic boundaries. I have implemented a fix for
> periodic boundary conditions in my own branch at lp:~mikael-
> mortensen/dolfin/dolfin. As of now I think periodic boundary conditions
> can only be used through the LinearVariationalSolver (like solve(A == L)
> etc). In my branch I have implemented periodic boundary conditions such
> that I can have more than one periodic direction, I can use it from
> python in regular forms and I eliminate slave dofs to obtain a
> coefficient matrix that is much better conditioned than with the regular
> PeriodicBC, where you get some bad master/slave rows the Krylov solvers
> don't like.
>
> Please let me know if I'm wrong and the periodic boundary conditions
> actually work.
>
> There is currently a plan to incorporate periodic boundary conditions in
> the dofmaps, so I don't think there will be a fix of the regular
> PeriodicBC.
>
> Best regards
>
> Mikael
>
>
>>
>> --
>> You received this question notification because you are an answer
>> contact for CBC.PDESys.
>
> --
> You received this question notification because you are an answer
> contact for CBC.PDESys.

Revision history for this message
Patrick Farrell (pefarrell) said :
#8

Hi!

Thanks for committing the data file.

The apbl example doesn't work with the dolfin trunk, so I tried to compile your branch. Your branch doesn't compile, with the following error:

/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp: In member function ‘void dolfin::PeriodicBC::apply(dolfin::GenericMatrix*, dolfin::GenericVector*, const dolfin::GenericVector*) const’:
/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:348:18: error: unused variable ‘A_norm’ [-Werror=unused-variable]
/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp: In member function ‘void dolfin::PeriodicBC::parallel_apply(dolfin::GenericMatrix*, dolfin::GenericVector*, const dolfin::GenericVector*) const’:
/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:668:18: error: unused variable ‘A_norm’ [-Werror=unused-variable]
/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp: In member function ‘void dolfin::PeriodicBC::pre_solve_elimination(std::vector<std::pair<std::pair<unsigned int, unsigned int>, std::pair<unsigned int, unsigned int> > >, dolfin::GenericMatrix*)’:
/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:825:8: error: unused variable ‘found’ [-Werror=unused-variable]
/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:826:8: error: unused variable ‘slave_found’ [-Werror=unused-variable]
/data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:827:8: error: unused variable ‘slave_row’ [-Werror=unused-variable]

I'm not immediately sure how to turn of -Werror=unused-variable, but I'm sure it's not too hard to get rid of the unused variables.

Revision history for this message
Mikael Mortensen (mikael-mortensen) said :
#9

Hi,

Sorry for the inconvenience and thanks for the effort. Looks like the previous warnings have become errors. I removed the unused variables and now it should work. It still doesn't work with trunk for me, though, but I'm looking into it.

Best regards

Mikael

Den Oct 4, 2012 kl. 12:35 AM skrev Patrick Farrell:

> Question #210144 on CBC.PDESys changed:
> https://answers.launchpad.net/cbcpdesys/+question/210144
>
> Patrick Farrell posted a new comment:
> Hi!
>
> Thanks for committing the data file.
>
> The apbl example doesn't work with the dolfin trunk, so I tried to
> compile your branch. Your branch doesn't compile, with the following
> error:
>
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp: In member function ‘void dolfin::PeriodicBC::apply(dolfin::GenericMatrix*, dolfin::GenericVector*, const dolfin::GenericVector*) const’:
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:348:18: error: unused variable ‘A_norm’ [-Werror=unused-variable]
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp: In member function ‘void dolfin::PeriodicBC::parallel_apply(dolfin::GenericMatrix*, dolfin::GenericVector*, const dolfin::GenericVector*) const’:
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:668:18: error: unused variable ‘A_norm’ [-Werror=unused-variable]
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp: In member function ‘void dolfin::PeriodicBC::pre_solve_elimination(std::vector<std::pair<std::pair<unsigned int, unsigned int>, std::pair<unsigned int, unsigned int> > >, dolfin::GenericMatrix*)’:
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:825:8: error: unused variable ‘found’ [-Werror=unused-variable]
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:826:8: error: unused variable ‘slave_found’ [-Werror=unused-variable]
> /data/pfarrell/src/dolfin/mortensen/dolfin/fem/PeriodicBC.cpp:827:8: error: unused variable ‘slave_row’ [-Werror=unused-variable]
>
> I'm not immediately sure how to turn of -Werror=unused-variable, but I'm
> sure it's not too hard to get rid of the unused variables.
>
> --
> You received this question notification because you are an answer
> contact for CBC.PDESys.

Can you help with this problem?

Provide an answer of your own, or ask Patrick Farrell for more information if necessary.

To post a message you must log in.