This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FEniCS-based solver for the 2018 Solbraa-Bergersen Ionic Electrodiffusion-scheme | |
# | |
# Marie E. Rognes (meg@simula.no) | |
# | |
# Feb 17 2023 | |
import numpy | |
from dolfin import * | |
def set_initial_conditions(x): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Utility functions in FEniCS and test script for refining and | |
# inspecting meshes with large cell size variations. | |
from dolfin import * | |
def mark_large_cells(mesh, tolerance): | |
# Initialize mesh function (markers) that defines whether to | |
# refine a cell or not | |
d = mesh.topology().dim() | |
markers = MeshFunction("bool", mesh, d) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fenics import * | |
# Define the elastic body | |
mesh = UnitSquareMesh(20, 20) | |
V = VectorFunctionSpace(mesh, "CG", 1) | |
u = TrialFunction(V) | |
v = TestFunction(V) | |
# Set the | |
mu = Constant(10.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2015 Marie E. Rognes | |
# | |
# Run this file with python oblig1.py | |
import pylab | |
import numpy | |
from numpy import linalg | |
# Define parameters | |
L = 10 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Demo illustrating "challenging forms" based on the Holzapfel-Ogden | |
hyperelasticity model for modelling cardiac ventricular tissue. | |
Original implementation by Gabriel Balaban, modified by Marie | |
E. Rognes (meg@simula.no) | |
""" | |
from dolfin import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color:#bf2c2c; | |
font-family: Verdana, sans-serif; | |
font-size:100%; | |
color:#111; | |
} | |
main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Marie's simple FEniCS dev setup: | |
# | |
# 1. Use dorsal to install dependencies: CGAL, PETSC, (TRILINOS)), | |
# SLEPc in some directory (mine is ~/local/fenics-dependencies). | |
# | |
# 2. Modify the paths immediately below in accordance with your setup. | |
# | |
# 3. Run this script in one of two ways: | |
# | |
# ./install_fenics.sh install # To install from scratch |