Comments (3)
So there are two things here:
- Computation of the size of the vector to scatter into in petsc was wrong
- Assembling matrices on mixed spaces that are composed of VFSes doesn't work yet.
Here's a patch for 1.
diff --git a/pyop2/petsc_base.py b/pyop2/petsc_base.py
index 8264de3..3233953 100644
--- a/pyop2/petsc_base.py
+++ b/pyop2/petsc_base.py
@@ -130,7 +130,11 @@ class MixedDat(base.MixedDat):
# contexts and stash them on the object for later reuse
if not (hasattr(self, '_vec') and hasattr(self, '_sctxs')):
self._vec = PETSc.Vec().create()
- self._vec.setSizes((self.dataset.set.size, None))
+ sz = 0
+ # Size of flattened vector is product of size and cdim of each dat
+ for d in self._dats:
+ sz += d.dataset.size * d.dataset.cdim
+ self._vec.setSizes((sz, None))
self._vec.setUp()
self._sctxs = []
offset = 0
@@ -138,7 +142,7 @@ class MixedDat(base.MixedDat):
# scattered to the appropriate contiguous chunk of memory in the
# full vector
for d in self._dats:
- sz = d.dataset.set.size
+ sz = d.dataset.size * d.dataset.cdim
with acc(d) as v:
vscat = PETSc.Scatter().create(v, None, self._vec,
PETSc.IS().createStride(sz, offset, 1))
- is more difficult.
from firedrake.
OP2/PyOP2#272 is merged, fixing 1. VFSes as part of a MFS are still a ways off, sorry.
from firedrake.
This works now, I think, hence closing.
from firedrake.
Related Issues (20)
- BUG: Cofunction object has no attribute '_ufl_class_' HOT 1
- BUG: install script fails to install recursivenodes dependency of fiat HOT 5
- BUG: adj_value for Constants is not computed, but it used to work and works with FEniCS adjoint HOT 9
- INSTALL: HOT 3
- BUG: MeshHierarchy with ref_per_level=3 fails
- BUG: Multigrid doesn't work with a `MixedFunctionSpace` and a `Cofunction` right hand side. HOT 4
- BUG: failing to assemble expression HCurl element on a tensor product mesh when part of a mixed functionspace HOT 3
- BUG: failing to project into vector function space (Hdiv in horizontal and broken in vertical) on extruded mesh HOT 3
- BUG: Pyadjoint tests are silently failing on CI HOT 11
- BUG: trace space doesn't have the correct embedded_superdegree property HOT 5
- DOCS: Documentation is broken
- INSTALL: HOT 5
- Refined Error HOT 6
- Interpolation from a `DG0` space on a `VertexOnlyMesh` HOT 3
- BUG: BDM elements cannot be projected on different meshes HOT 2
- BUG: Mesh parallel error HOT 2
- BUG: Comparing a `Cofunction` to itself via `!=` returns `True` HOT 2
- Docker error: [0]PETSC ERROR: Caught signal number 11 SEGV HOT 11
- Proposal: Diffussion Equation Example HOT 2
- Zenodo release HOT 2
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.