### How to use quads in FEniCS 2017.2?

973

views

3

Hi,

According to

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

3

`UnitSquareMesh.create( 6, 6, CellType.Type_quadrilateral)`

ipython3 with tab-completion helps with things like this.

1

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

1

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.

Cf. https://www.allanswered.com/post/nqqzl/dg-quad-elements-do-not-converge/

Cf. https://www.allanswered.com/post/nqqzl/dg-quad-elements-do-not-converge/

written
8 months ago by
Nate

2

Now fixed https://bitbucket.org/fenics-project/ffc/pull-requests/93. Unfortunately there is still DOLFIN issue https://bitbucket.org/fenics-project/dolfin/issues/997.

written
4 months ago by
Jan Blechta

Please login to add an answer/comment or follow this question.