"- initial conditions seem to have strong influence\n",
"- initial conditions seem to have strong influence\n",
"- time step also plays a role for Newton solver\n",
"- time step also plays a role for Newton solver\n",
...
@@ -219,7 +219,8 @@
...
@@ -219,7 +219,8 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"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 @@
...
@@ -239,19 +240,15 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"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)."
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "markdown",
"execution_count": null,
"metadata": {},
"metadata": {},
"outputs": [],
"source": [
"source": [
"from fem_utils import convert_msh_to_xdmf\n",
"### Example on how to use convert_msh_to_xdmf\n",
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).
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).
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
According to the review (Weber et al. 2019, eqn. 2.29) the boundary length scale is
- initial conditions seem to have strong influence
- initial conditions seem to have strong influence
- time step also plays a role for Newton solver
- time step also plays a role for Newton solver
- best results with small time step and initial conditions close to final concentrations
- best results with small time step and initial conditions close to final concentrations
%% Cell type:markdown id: tags:
%% 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:
%% Cell type:code id: tags:
``` python
``` python
fromfem_utilsimportSpheres
fromfem_utilsimportSpheres
a=Spheres(n=17,ls=[2,2,2])
a=Spheres(n=17,ls=[2,2,2])
a.create_list()
a.create_list()
a.point_list
a.point_list
a.write_to_txt()
a.write_to_txt()
```
```
%% Cell type:markdown id: tags:
%% 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).
%% Cell type:code id: tags:
%% Cell type:markdown id: tags:
``` python
### Example on how to use convert_msh_to_xdmf
fromfem_utilsimportconvert_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.