Hi all,

I am trying to create a 3/4 disc mesh defined by:

r \in [0,1] and \theta \in [0, 3/2\pi]

Could anyone give a clue or some example about how to create such a mesh?

Thanks,

Leon

Hi all,

I am trying to create a 3/4 disc mesh defined by:

r \in [0,1] and \theta \in [0, 3/2\pi]

Could anyone give a clue or some example about how to create such a mesh?

Thanks,

Leon

You can use Gmsh , and the command:

```
Circle ( expression ) = { expression, expression, expression <, ...> };
Creates a circle arc. The three expressions on the right-hand-side define the start point, the center and the end point of the arc. With the built-in geometry kernel the arc should be strictly smaller than Pi. With the OpenCASCADE kernel additional expressions can be provided to define a full circle (4th expression is the radius) or a circle arc between two angles (next 2 expressions).
```

In combination with straight lines. There are many examples on how to use Gmsh on this forum, But consider this example.

1 Like

Hi,

I am trying to create a 2D rectangle with a circle in it. Following your tutorial, I am using OpenCascade. However, the `addCircle`

command there has an issue with 2D circles. Is there any way I can define it?

Below are a work example and the error I get:

import gmsh

import meshio

import numpy as np

```
gmsh.initialize()
gmsh.model.add("channel_sphere")
# Channel parameters
L = 10
H = 1
c = [0.1,0.5,0]
r = 0.1
# Generate channel
channel = gmsh.model.occ.addRectangle(0,0,0,L,H)
# Create circle
cell = gmsh.model.occ.addCircle(c[0],c[1],0,r)
# Fluid in channel and cell suspension
fluid = gmsh.model.occ.cut([(2, channel)], [(2, cell)])
cellSusp = gmsh.model.occ.cut([(2, cell)], [(2,channel)])
gmsh.model.occ.synchronize()
```

`Error : Unknown OpenCASCADE entity of dimension 2 with tag 5`

Many thanks,

Eva

You Need to use `addDisk`

, or `addCircle`

in combination with `addCurveLoop`

and `addPlaneSurface`

as shown in for instance Electromagnetics example — FEniCS-X tutorial

1 Like

Thank you for that!

The tutorial is very helpful. I’d like to have a rectangle instead of a circle (for the background domain) where the boundaries of the rectangle will be labelled as walls, inflow and outlet.

Should I create a background domain, like in the tutorial, or do I need to approach it differently (like tried above with one surface for rectangle where I will solve the equations and then one of circle where I will couple the solution of the flow with the boundary conditions I need on it).

Many thanks!

I do not quite understand what you would like to do. Are you trying to create something like the domain in: Test problem 2: Flow past a cylinder (DFG 2D-3 benchmark) — FEniCS-X tutorial ?

Note that there are plenty of Gmsh tutorials at

tutorial/python · master · gmsh / gmsh · GitLab

Along with the examples i’ve posted.