PETSC ERROR with mpirun (reformulated question)
Dear all,
I wonder how I can use parallel computing for codes where I use piecewise functions, ie how I can avoid indexing into array to define them? Eg running the program at the end of the post with mpirun I get the following error, which I can't solve. Running without mpi, everything works fine.
Process 0: Number of global vertices: 10201
Process 0: Number of global cells: 20000
Process 1: Partitioned mesh, edge cut is 231.
Process 2: Partitioned mesh, edge cut is 231.
Process 3: Partitioned mesh, edge cut is 231.
Process 0: Partitioned mesh, edge cut is 231.
Traceback (most recent call last):
File "temp2.py", line 26, in <module>
Traceback (most recent call last):
File "temp2.py", line 26, in <module>
Traceback (most recent call last):
File "temp2.py", line 26, in <module>
Traceback (most recent call last):
File "temp2.py", line 26, in <module>
k.vector()[:] = numpy.choose(help, k_values)
File "/usr/local/
k.vector()[:] = numpy.choose(help, k_values)
k.vector()[:] = numpy.choose(help, k_values)
File "/usr/local/
File "/usr/local/
k.vector()[:] = numpy.choose(help, k_values)
File "/usr/local/
self.
File "/usr/local/
self.
File "/usr/local/
self.
File "/usr/local/
self.
File "/usr/local/
_set_
RuntimeError: non matching dimensions on input
_set_
RuntimeError: non matching dimensions on input
_set_
RuntimeError: _set_vector_
RuntimeError: non matching dimensions on input
non matching dimensions on input
The code is the following:
from dolfin import *
import numpy
tol = 1E-14
mesh = UnitSquare(100, 100)
class Omega0(SubDomain):
def inside(self, x, on_boundary):
class Omega1(SubDomain):
def inside(self, x, on_boundary):
subdomains = MeshFunction(
subdomain0 = Omega0()
subdomain0.
subdomain1 = Omega1()
subdomain1.
V0 = FunctionSpace(mesh, 'DG', 0)
k = Function(V0)
k_values = [1.5, 5.0]
help = numpy.asarray(
k.vector()[:] = numpy.choose(help, k_values)
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Jacopo Lanzoni for more information if necessary.