mymatrix = assemble(myform, bcs=bcs) mymatrix.assemble() # Force the delayed assembly. mymatrix.M.values # Numpy array. On 2 February 2014 09:04, Cotter, Colin J <colin.cotter@imperial.ac.uk>wrote:
OK, next question is whether I can output a numpy matrix for a bilinear form assembled with boundary conditions, i.e. whether I can get the reduced matrix with the boundary rows and columns removed?
I can see that the bcs are postponed until the solve, so if this exists it would just be a utility for testing. If it doesn't I can remove them myself.
--cjc ------------------------------ *From:* firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Cotter, Colin J [colin.cotter@imperial.ac.uk] *Sent:* 02 February 2014 08:54
*To:* firedrake *Subject:* Re: [firedrake] Boundary conditions
Ah good, works, thanks.
--cjc ------------------------------ *From:* firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of David Ham [David.Ham@imperial.ac.uk] *Sent:* 01 February 2014 22:12 *To:* firedrake *Subject:* Re: [firedrake] Boundary conditions
Standard GMSH problem: if you have a physical line you also need a physical surface or GMSH will drop all the interior elements from the output.
On Saturday, February 1, 2014, Cotter, Colin J < colin.cotter@imperial.ac.uk> wrote:
Dear Firedrakers, I decided to create another set of cohomology tests, this time with Dirichlet boundary conditions, since there is a nice result relating the kernels of the operators with and without Dirichlet boundary conditions (for the maths-curious, it's Poincare duality).
However, I can't get the boundary tags into Firedrake from gmsh. If I attempt to tag the boundary using "Physical Line" in gmsh (see bottom of this email for the .geo file), the line
mesh = Mesh("annulus.msh") produces: *** ERROR *** Error message: Unsupported mixture of face/element types
Removing the physical line makes the error message go away, so there is something wrong with that line.
What have I done wrong?
all the best --Colin
Point(1) = {0, 0, 0, 1.0}; Point(2) = {1, 0, 0, 1.0}; Point(3) = {1, 1, 0, 1.0}; Point(4) = {0, 1, 0, 1.0}; Point(5) = {0.3333333333333, 0.3333333333333, 0, 1.0}; Point(6) = {0.66666666666666, 0.3333333333333, 0, 1.0}; Point(7) = {0.66666666666666, 0.66666666666666, 0, 1.0}; Point(8) = {0.3333333333333, 0.66666666666666, 0, 1.0}; Line(1) = {1, 2}; Line(2) = {2, 3}; Line(3) = {3, 4}; Line(4) = {4, 1}; Line(5) = {5, 6}; Line(6) = {6, 7}; Line(7) = {7, 8}; Line(8) = {8, 5}; Line Loop(1) = {1, 2, 3, 4}; Line Loop(2) = {5, 6, 7, 8}; Plane Surface(1) = {1,2}; Physical Line(9) = {2, 3, 4, 1, 6, 7, 8, 5};
-- Dr David Ham Departments of Mathematics and Computing Imperial College London
-- Dr David Ham Departments of Mathematics and Computing Imperial College London http://www.imperial.ac.uk/people/david.ham