Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting magnetisation on a df.IntervalMesh with Dolfin causes Segmentation Fault #2

Open
mvousden opened this issue May 20, 2015 · 2 comments
Labels

Comments

@mvousden
Copy link
Contributor

Using a RectangleMesh appears to work as expected, but IntervalMesh Segmentation Faults. Here is a minimum broken example:

import dolfin as df
import finmag

# This works.
sim = finmag.Simulation(df.RectangleMesh(-10, -10, 10, 10, 10, 10), 1e5)
sim.set_m([0., 0., 1.])
sim.m_field.plot_with_dolfin()

# This doesn't work.
sim = finmag.Simulation(df.IntervalMesh(100, -20, 20), 1e5)
sim.set_m([0., 0., 1.])
sim.m_field.plot_with_dolfin()

This outputs the following:

[2015-05-20 12:33:07] INFO: Finmag logging output will be appended to file: '/home/mark/.finmag/global.log'
[2015-05-20 12:33:07] DEBUG: Building modules in 'native'...
[2015-05-20 12:33:07] DEBUG: FinMag          5911:518cd3246eb27af41093eedd8ecf347c8b07c67e
[2015-05-20 12:33:07] DEBUG: Dolfin          1.4.0                Matplotlib      lazily loaded       
[2015-05-20 12:33:07] DEBUG: Numpy           1.8.1                Scipy           0.13.3              
[2015-05-20 12:33:07] DEBUG: IPython         3.1.0                Python          2.7.6               
[2015-05-20 12:33:07] DEBUG: Paraview        4.0.1-1ubuntu1       Sundials        2.5.0               
[2015-05-20 12:33:07] DEBUG: Boost-Python    <unknown>            Linux           Ubuntu 14.04.1 LTS  
[2015-05-20 12:33:07] DEBUG: Registering debug signal handler. Press Ctrl-Z any time to stop execution and jump into the debugger.
[2015-05-20 12:33:07] INFO: Finmag logging output will be written to file: '/home/mark/Desktop/unnamed.log' (any old content will be overwritten).
[2015-05-20 12:33:07] DEBUG: Creating DataWriter for file 'unnamed.ndt'
[2015-05-20 12:33:07] INFO: Creating Sim object name='unnamed', instance_id=0 (rank=0/1).
[2015-05-20 12:33:07] DEBUG:    Total number of Sim objects in this session: 1
[2015-05-20 12:33:07] INFO: <Mesh of topological dimension 2 (triangles) with 121 vertices and 200 cells, ordered>
[2015-05-20 12:33:07] WARNING: The mesh is dozens of meters large.
[2015-05-20 12:33:07] WARNING: unit_length is set to 1. Are you sure this is correct?
/usr/local/lib/python2.7/dist-packages/aeon/timer.py:35: UserWarning: You are nesting measurements in __init__::LLG.
  warnings.warn("You are nesting measurements in {}::{}.".format(name, group))
[2015-05-20 12:33:07] DEBUG: Creating LLG object.
[2015-05-20 12:33:08] INFO: Finmag logging output will be written to file: '/home/mark/Desktop/unnamed.log' (any old content will be overwritten).
[2015-05-20 12:33:08] DEBUG: Creating DataWriter for file 'unnamed.ndt'
[2015-05-20 12:33:08] INFO: Creating Sim object name='unnamed', instance_id=1 (rank=0/1).
[2015-05-20 12:33:08] DEBUG:    Total number of Sim objects in this session: 2
[2015-05-20 12:33:08] INFO: <Mesh of topological dimension 1 (intervals) with 101 vertices and 100 cells, ordered>
[2015-05-20 12:33:08] WARNING: The mesh is dozens of meters large.
[2015-05-20 12:33:08] WARNING: unit_length is set to 1. Are you sure this is correct?
[2015-05-20 12:33:08] DEBUG: Creating LLG object.
Segmentation Fault
@mvousden mvousden added the bug label May 20, 2015
@marijanbeg
Copy link
Collaborator

Hi Mark,

Yes, this is a known bug and it is dolfin related. It either causes Segmentation Fault or plots something meaningless. Maybe if you rewrite this example in dolphin only and ask on Fenics Q&A?

Example:

import dolphin as df

mesh = df.IntervalMesh(100, -20, 20)
fs = df.VectorFunctionSpace(mesh, “CG”, 1, 3)
f = df.Function(fs)
f.assign(df.Constant(0, 0, 1))

df.plot(f, interactive=True)

Marijan

On 20 May 2015, at 12:34, Mark Vousden <[email protected]mailto:[email protected]> wrote:

Using a RectangleMesh appears to work as expected, but IntervalMesh Segmentation Faults. Here is a minimum broken example:

import dolfin as df
import finmag

This works.

sim = finmag.Simulation(df.RectangleMesh(-10, -10, 10, 10, 10, 10), 1e5)
sim.set_m([0., 0., 1.])
sim.m_field.plot_with_dolfin()

This doesn't work.

sim = finmag.Simulation(df.IntervalMesh(100, -20, 20), 1e5)
sim.set_m([0., 0., 1.])
sim.m_field.plot_with_dolfin()

This outputs the following:

[2015-05-20 12:33:07] INFO: Finmag logging output will be appended to file: '/home/mark/.finmag/global.log'
[2015-05-20 12:33:07] DEBUG: Building modules in 'native'...
[2015-05-20 12:33:07] DEBUG: FinMag 5911:518cd3246eb27af41093eedd8ecf347c8b07c67e
[2015-05-20 12:33:07] DEBUG: Dolfin 1.4.0 Matplotlib lazily loaded
[2015-05-20 12:33:07] DEBUG: Numpy 1.8.1 Scipy 0.13.3
[2015-05-20 12:33:07] DEBUG: IPython 3.1.0 Python 2.7.6
[2015-05-20 12:33:07] DEBUG: Paraview 4.0.1-1ubuntu1 Sundials 2.5.0
[2015-05-20 12:33:07] DEBUG: Boost-Python Linux Ubuntu 14.04.1 LTS
[2015-05-20 12:33:07] DEBUG: Registering debug signal handler. Press Ctrl-Z any time to stop execution and jump into the debugger.
[2015-05-20 12:33:07] INFO: Finmag logging output will be written to file: '/home/mark/Desktop/unnamed.log' (any old content will be overwritten).
[2015-05-20 12:33:07] DEBUG: Creating DataWriter for file 'unnamed.ndt'
[2015-05-20 12:33:07] INFO: Creating Sim object name='unnamed', instance_id=0 (rank=0/1).
[2015-05-20 12:33:07] DEBUG: Total number of Sim objects in this session: 1
[2015-05-20 12:33:07] INFO: <Mesh of topological dimension 2 (triangles) with 121 vertices and 200 cells, ordered>
[2015-05-20 12:33:07] WARNING: The mesh is dozens of meters large.
[2015-05-20 12:33:07] WARNING: unit_length is set to 1. Are you sure this is correct?

/usr/local/lib/python2.7/dist-packages/aeon/timer.py:35: UserWarning: You are nesting measurements in init::LLG.
warnings.warn("You are nesting measurements in {}::{}.".format(name, group))
[2015-05-20 12:33:07] DEBUG: Creating LLG object.
[2015-05-20 12:33:08] INFO: Finmag logging output will be written to file: '/home/mark/Desktop/unnamed.log' (any old content will be overwritten).
[2015-05-20 12:33:08] DEBUG: Creating DataWriter for file 'unnamed.ndt'
[2015-05-20 12:33:08] INFO: Creating Sim object name='unnamed', instance_id=1 (rank=0/1).
[2015-05-20 12:33:08] DEBUG: Total number of Sim objects in this session: 2
[2015-05-20 12:33:08] INFO:
[2015-05-20 12:33:08] WARNING: The mesh is dozens of meters large.
[2015-05-20 12:33:08] WARNING: unit_length is set to 1. Are you sure this is correct?
[2015-05-20 12:33:08] DEBUG: Creating LLG object.
Segmentation Fault


Reply to this email directly or view it on GitHubhttps://github.com//issues/2.

@mvousden
Copy link
Contributor Author

Thanks Marijan, question has been raised here using dolfin 1.5: http://fenicsproject.org/qa/7199/plot-function-on-intervalmesh-causes-segmentation-fault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants