Skip to content

Instantly share code, notes, and snippets.


Yiannis Simillides ysimillides

View GitHub Profile
View FEniCS.jl docker image
LABEL maintainer=" Yiannis Simillides <>"
RUN apt-get update -y && apt-get install -y make gcc g++ bzip2 hdf5-tools unzip gfortran curl
RUN mkdir -p /opt/julia-0.6.3 && \
curl -s -L | tar -C /opt/julia-0.6.3 -x -z --strip-components=1 -f -
View todo list gsoc
re-evaluate arithmetic operations for Forms in jfem.jl
add integer points (currently only support double) so we can create Points([2,2]) instead of needing to write Points([2.,2.])
set_subdomain and boundary mesh tests
possible create jinterface file?
Blog post on mesh type
ysimillides /
Created Apr 29, 2018
Plot a 2d time-domain problem in pandas
#Let solution be our solution array
#with x,y and z being the first, second, and third index respectively.
import pandas as pd
x_pd= solution[0]
y_pd = solution[1]
z_pd = solution[2]
#We assume we already have the array for t, (this can also be created if needed, based on the dims of the previous iterates.
#We create a DataFrame object to store, and display our results if needed
df = pd.DataFrame({"time": t , "x": x_pd.flatten(), "y": y_pd.flatten(), "z": z_pd.flatten()})
#we define the number of iterates we wish to display
ysimillides / GSOC 2017 : A FEniCS Wrapper for the Julia
Last active Mar 4, 2020
My documentation for the final evaluation of GSOC 2017
View GSOC 2017 : A FEniCS Wrapper for the Julia


Throughout this Google Summer of Code project I, along with my mentors, aimed to create a Wrapper for the FEniCS Finite Element Toolbox in the Julia Language. Our work done can be found at FEniCS.jl . This would allow users to perform FEM calculations directly in Julia, utilizing our PyCall.jl wrapping functionality. We currently have wrapped the main functionality, along with providing the necessary instructions to add further components when they are deemed necessary. Members of the Julia community not directly related to the project also contributed small fixes and suggestions throughout the project. The majority of the code produced has already been merged to the GitHub repository (which was created specifically for this project). One of the main improvements which would greatly increase its usage would be the further integration with the JuliaDiffEq package.

What is FEniCS?

FEniCS describes itself as a pop

ysimillides / Helpful Items for FEniCS.jl
Created Aug 23, 2017
a list of helpful gists for usage alongside FEniCS.jl
View Helpful Items for FEniCS.jl
#to add various functionality / extend functions, take a look at
#to see some of the main differences between the julian wrapper and a pythonic FEniCS look at
#for a brief overview of its usage take a look at
ysimillides / init fix
Last active Aug 16, 2017
small example of how to fix precompilation in FEniCS.jl
View init fix
#replace @pyimport fenics with the following code below.
const fenics = PyNULL()
function __init__()
copy!(fenics, pyimport_conda("fenics", "FEniCS", "conda-forge"))
#to now call a function we need to change UnitTriangleMesh() = Mesh(fenics.UnitTriangleMesh()) to
UnitTriangleMesh() = Mesh(fenics[:UnitTriangleMesh]())
ysimillides / differences.jl
Created Aug 14, 2017
fenics.jl differences
View differences.jl
#Throughout the project we have tried to keep the API and the usage the same as direct interfacing with FEniCS.
#Due to some design preferences and technical issues they're may be slight differences in various parts.
#Regarding the Solve Funtion in FEniCS ,depending on the functionality we call
lvsolve , nlvsolve, anlvsolve #depending on what kind of solve we desire.
lvsolve # is the linear variational solver
nlvsolve # is the non-linear variational solver
anlvsolve # corresponds to the adapative non-linear solver.
#For the DirichletBC, whereas in FEniCS we would define a function as
def u0_boundary(x, on_boundary):
return on_boundary
View add_functionality.jl
#The main things needed to wrap and use the FEniCS package are access to
#functions and their attributes. Occasionally *types* may also be defined to allow
#easier use and function overloading. fenicspycall is used to access attributes and fenicsclass is used to define types(classes in FEniCS).
#These can be found in the FEniCS.jl main file.
#Assuming we now want to define the Mesh Class found here .
#We simply call @fenicsclass Mesh . If we want to access their attributes we can simply create access to them as follows
#hmin(mesh::Mesh) = fenicspycall(mesh, :hmin)
#Now we may wish to create access to the function .
ysimillides / workflow-example.jl
Last active Aug 14, 2017
View workflow-example.jl
using FEniCS
using PyCall
@pyimport fenics
mesh = UnitSquareMesh(8,8)
V = FunctionSpace(mesh,"P",1)
u_D = Expression("1+x[0]*x[0]+2*x[1]*x[1]",degree=2)
bc1 = DirichletBC(V,u_D, "on_boundary")