"- initial conditions seem to have strong influence\n",
"- time step also plays a role for Newton solver\n",
...
...
@@ -219,7 +219,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Example for how to use Spheres class to create n positions of non-overlapping spheres inside a box of dimensions ls.**"
"### Example for use of 'Spheres' class \n",
"...to create n positions of non-overlapping spheres inside a box of dimensions ls."
]
},
{
...
...
@@ -239,19 +240,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Example on how to use convert_msh_to_xdmf to convert a mesh created in gmsh via 'gmsh -3 file -format msh2' to xdmf, which can be parallelised, in contrast to .xml meshes.**"
"The resulting points in points.txt can now be used in a .geo file, e.g. box_with_spheres. Simply copy them in, then create the mesh (see below)."
To solve this equation we follow the [Fenics Cahn-Hilliard example](https://bitbucket.org/fenics-project/dolfin/src/master/python/demo/documented/cahn-hilliard/demo_cahn-hilliard.py.rst#rst-header-id1)(the maths is explained [here](https://fenicsproject.org/docs/dolfinx/dev/python/demos/cahn-hilliard/demo_cahn-hilliard.py.html), for our free energy see overleaf).
where we dropped the boundary terms (not explicitly written in second equation) due to the boundary conditions/weak form. We also disregard 1-n, because constants don't change the flux in the absence of chemical reactions (an offset doesn't change the solution in this case, try out by adding $-6.0*v*dx$ to L1, for this check out fenics tutorial Poisson equation).
According to the review (Weber et al. 2019, eqn. 2.29) the boundary length scale is
- initial conditions seem to have strong influence
- time step also plays a role for Newton solver
- best results with small time step and initial conditions close to final concentrations
%% Cell type:markdown id: tags:
**Example for how to use Spheres class to create n positions of non-overlapping spheres inside a box of dimensions ls.**
### Example for use of 'Spheres' class
...to create n positions of non-overlapping spheres inside a box of dimensions ls.
%% Cell type:code id: tags:
``` python
fromfem_utilsimportSpheres
a=Spheres(n=17,ls=[2,2,2])
a.create_list()
a.point_list
a.write_to_txt()
```
%% Cell type:markdown id: tags:
**Example on how to use convert_msh_to_xdmf to convert a mesh created in gmsh via 'gmsh -3 file -format msh2' to xdmf, which can be parallelised, in contrast to .xml meshes.**
The resulting points in points.txt can now be used in a .geo file, e.g. box_with_spheres. Simply copy them in, then create the mesh (see below).