| ... | ... | @@ -104,14 +104,16 @@ To add a new mesh preset, follow these instructions: |
|
|
|
`super().write_XDMF_from_gmsh_code()` with the proper arguments (see [Base Classes](Base Classes) for what these are) for
|
|
|
|
gmsh code, or call 'super().save_FEniCS_mesh()` with the proper arguments if you created a FEniCS mesh
|
|
|
|
|
|
|
|
6. To make this mesh compatible with TDGL problems, add a function (NOT a new method) which takes in arguments of x and
|
|
|
|
on_boundary. Here x is a 2D or 3D vector (depending on the dimension of your mesh) where x[0], x[1], and x[2] correspond to
|
|
|
|
the x, y, and z coordinates, and on_boundary is a boolean that determines if the point is on the outer boundary of the mesh
|
|
|
|
(these will both be passed to the function by FEniCS when it's determining if it should apply boundary conditions). This
|
|
|
|
function should use these two arguments to come up with an expression for where the applied field should be placed on the
|
|
|
|
mesh during solving. If the point in question should have field applied there, the function returns True, otherwise it
|
|
|
|
returns false. Here is a simple of an example of a function which places the boundary at the top and bottom of a 1x1 square
|
|
|
|
mesh with it's bottom left corner at the origin:
|
|
|
|
6. To make this mesh compatible with TDGL problems, it is again different for FEniCS versus Gmsh meshes. For Gmsh meshes,
|
|
|
|
simply make sure that you create a physical surface/curve (depending of if the mesh is 3D or 2D) and assign its tag to be
|
|
|
|
1, when you load the mesh it's boundary function will be saved also. For a FEniCS mesh, add a function (NOT a new method)
|
|
|
|
which takes in arguments of x and on_boundary. Here x is a 2D or 3D vector (depending on the dimension of your mesh) where
|
|
|
|
x[0], x[1], and x[2] correspond to the x, y, and z coordinates, and on_boundary is a boolean that determines if the point
|
|
|
|
is on the outer boundary of the mesh (these will both be passed to the function by FEniCS when it's determining if it
|
|
|
|
should apply boundary conditions). This function should use these two arguments to come up with an expression for where the
|
|
|
|
applied field should be placed on the mesh during solving. If the point in question should have field applied there, the
|
|
|
|
function returns True, otherwise it returns false. Here is a simple of an example of a function which places the boundary
|
|
|
|
at the top and bottom of a 1x1 square mesh with it's bottom left corner at the origin:
|
|
|
|
```
|
|
|
|
def boundary(x, on_boundary):
|
|
|
|
return on_boundary and (d.near(x[1], 0) or d.near(x[1], 1))
|
| ... | ... | |