Comments (2)
You can do this by remapping the function to the enclosing DG space and transferring that, then remapping back to BDM.
from firedrake.
You can do this by remapping the function to the enclosing DG space and transferring that, then remapping back to BDM.
Thanks. @colinjcotter It works. But there also seemed to be new issues with reading the mesh when running in parallel on multiple cores.
Here is my code:
from firedrake import *
num_refs = 3
Lx = 2
Ly = 2
mesh_table = []
for i in range(num_refs):
Nx = 4*2**(i)
Ny = Nx
mesh_1 = RectangleMesh(Nx, Ny, Lx, Ly)
V_1 = VectorFunctionSpace(mesh_1, "DG", 1)
u_1 = Function(V_1)
mesh_table.append(mesh_1)
V_DG = VectorFunctionSpace(mesh_table[0], "DG", 1)
u_2 = project(u_1, V_DG)
Here is the report:
Traceback (most recent call last):
File "/home/text_1.py", line 31, in <module>
Traceback (most recent call last):
File "/home/text_1.py", line 31, in <module>
u_2 = project(u_1, V_DG)
File "petsc4py/PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
u_2 = project(u_1, V_DG)
File "petsc4py/PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "/home/firedrake/firedrake/src/firedrake/firedrake/adjoint/projection.py", line 34, in wrapper
File "/home/firedrake/firedrake/src/firedrake/firedrake/adjoint/projection.py", line 34, in wrapper
output = project(*args, **kwargs)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 78, in project
output = project(*args, **kwargs)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 78, in project
use_slate_for_inverse=use_slate_for_inverse).project()
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 181, in projecTraceback (most recent call last):
File "/home/text_1.py", line 19, in <module>
Traceback (most recent call last):
File "/home/text_1.py", line 19, in <module>
u_2 = project(u_1, V_DG)
File "petsc4py/PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
u_2 = project(u_1, V_DG)
File "petsc4py/PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "/home/firedrake/firedrake/src/firedrake/firedrake/adjoint/projection.py", line 34, in wrapper
File "/home/firedrake/firedrake/src/firedrake/firedrake/adjoint/projection.py", line 34, in wrapper
output = project(*args, **kwargs)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 78, in project
output = project(*args, **kwargs)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 78, in project
use_slate_for_inverse=use_slate_for_inverse).project()
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 181, in project
use_slate_for_inverse=use_slate_for_inverse).project()
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 181, in project
self.apply_massinv(self.target, self.rhs)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 240, in rhs
self.apply_massinv(self.target, self.rhs)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 240, in rhs
self.mixed_mass.mult(u, v)
File "/home/firedrake/firedrake/src/PyOP2/pyop2/utils.py", line 62, in __get__
self.mixed_mass.mult(u, v)
File "/home/firedrake/firedrake/src/PyOP2/pyop2/utils.py", line 62, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 234, in mixed_mass
obj.__dict__[self.__name__] = result = self.fget(obj)
File "/home/firedrake/firedrake/src/firedrake/firedrake/projection.py", line 234, in mixed_mass
return assemble_mixed_mass_matrix(self.source.function_space(),
File "petsc4py/PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
return assemble_mixed_mass_matrix(self.source.function_space(),
File "petsc4py/PETSc/Log.pyx", line 115, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 116, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "/home/firedrake/firedrake/src/firedrake/firedrake/supermeshing.py", line 97, in assemble_mixed_mass_matrix
File "/home/firedrake/firedrake/src/firedrake/firedrake/supermeshing.py", line 97, in assemble_mixed_mass_matrix
intersections = intersection_finder(mesh_A, mesh_B)
File "firedrake/cython/supermeshimpl.pyx", line 132, in firedrake.cython.supermeshimpl.intersection_finder
intersections = intersection_finder(mesh_A, mesh_B)
File "firedrake/cython/supermeshimpl.pyx", line 132, in firedrake.cython.supermeshimpl.intersection_finder
AssertionError: Whoever made mesh_B should explicitly mark mesh_A as having a compatible parallel layout.
application called MPI_Abort(PYOP2_COMM_WORLD, 1) - process 0
AssertionError: Whoever made mesh_B should explicitly mark mesh_A as having a compatible parallel layout.
application called MPI_Abort(PYOP2_COMM_WORLD, 1) - process 1
from firedrake.
Related Issues (20)
- BUG: Solving the Stokes equations defined with TrialFunction returns an error HOT 1
- BUG: Greater error than expected in quadrilateral GLL elements HOT 4
- Compute norm of assembled derivative HOT 5
- "Too many indices for sum factorisation!" for calculating radius on extruded CubedSphereMesh. HOT 1
- INSTALL: ImportError when running firedrake-update on Linux HOT 2
- INSTALL: Linux (Ubuntu 22.04.4 LTS) HOT 12
- Tests for `to_petsc_local_numbering`
- BUG: firedrake-install is now failing with --petsc-int-type=int64 HOT 3
- Buckling problem HOT 2
- Flake8 for demos HOT 2
- Zenodo release
- Labelling of Internal Facets in Mesh Generated with Netgen HOT 3
- Zenodo release request
- Error on interpolation using --petsc-int-type int64 HOT 1
- BUG: Adjoint inconsistency with self-assignment via projection HOT 1
- BUG: Many tests fail with 64-bit indices
- Zenodo release please. HOT 1
- BUG: mesh.locate_cell not returning what is expected for points outside the mesh (--petsc-int-type=int64) HOT 2
- Interpolation on two different meshes doesn't work on parallel
- BUG: restricted mode in Lineareigenproblem for mixed problems.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firedrake.