How to use quads in FEniCS 2017.2?

8 months ago by
According to
help( UnitSquareMesh.create )​

FEniCS 2017.2 supports quadrilateral meshes:

Help on function create in module dolfin.cpp.mesh:

create(*args) -> 'dolfin::Mesh'
    Create a uniform finite element :cpp:any:`Mesh`  over the unit square [0,1] x [0,1].
       auto mesh1 = UnitSquareMesh::create(MPI_COMM_WORLD, 32, 32);
       auto mesh2 = UnitSquareMesh::create(MPI_COMM_WORLD, 32, 32, "crossed");
    :param MPI_Comm comm:  (MPI_Comm) :cpp:any:`MPI`  communicator
    :param std\:\:array< std\:\:size_t, 2 > n:  (std:::array<std::size_t, 2>) Number of cells in each direction.
    :param CellType\:\:Type cell_type:  Triangle or quadrilateral.
    :param std\:\:string diagonal:  (std::string) Optional argument: A std::string indicating the direction of the diagonals.
    :rtype: Mesh

How do I use quads in Python?
I already tried:

UnitSquareMesh.create( 6, 6, "quadrilateral" )
UnitSquareMesh.create( 6, 6, cell_type = "quadrilateral" )
UnitSquareMesh.create( 6, 6, cell = "quadrilateral" )
Community: FEniCS Project

1 Answer

8 months ago by
UnitSquareMesh.create( 6, 6, CellType.Type_quadrilateral)

ipython3 with tab-completion helps with things like this.

Do you know how to use quads in a rectangular mesh? I have tried the below approach but it doesn't work (I think that there exist a more elegant solution than scaling the unit square):

RectangleMesh.create(p0, p1, 6, 6, CellType.Type_quadrilateral)​
written 8 months ago by Hernán Mella  
Did you ever figure that out?
written 4 months ago by Martin Genet  
Is it correct that quads are not yet supported for DG?
written 8 months ago by Philipp O  
That's correct. Sadly there are some issues with orientation of the facets. Hopefully it will be fixed in time for the next release but I'm unsure of what the status is.

written 8 months ago by Nate  
Now fixed Unfortunately there is still DOLFIN issue
written 4 months ago by Jan Blechta  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »