Compile issue in plotting 3d mesh

Let \Omega is cubical the domain [-1,1]^3 and \Omega^1 is the spherical domain of radius 0.5. Let \Omega^2 is \Omega\setminus\Omega^1 is the cube with a spherical hole. Write a freefem code to build two different 3d meshes Sh1 for \Omega^1 and Sh2 for \Omega^2. Level the boundaries of both meshes.

I have written the code but its not working.

cubewithsphere2.edp (2.0 KB)

There is an example almost identical to what you want in the FreeFem documentation

p.158 “Build a 3d mesh of a cube with a balloon”

(change load “TetGen” to load “tetgen” )

Sir I have changed it to tetgen but still it is showing error.

Just like this for defining the sphere:

load “msh3”
load “tetgen”
include “MeshSurface.idp”
// Parameters
real hs = 0.1; //mesh size on sphere
// Mesh
meshS ThS = Sphere(0.5, hs, 7, 1);

Sphere takes 4 arguments

meshS ThS = Sphere(R, hs, L, 1);

where R is the radius, h is the mesh size of the sphere, L is the label of the sphere and the last one is the global orientation of the surface (1 for extern and -1 for intern)

Best regards,

Loïc,

I have tried to correct it but it still shows error. Can you please modify the code.

cubewithsphere2.edp (2.0 KB)

Here the code
sphereincube.edp (1.0 KB)

Best regards,

Loïc,