Ktirio Urban Building Notebook
This is a Jupyter notebook for the Ktirio Urban Building project.
1. Introduction
You write your notebook in AsciiDoc including LaTeX math and thanks to the :page-jupyter: true attribute, the notebook is converted to a Jupyter notebook when the book is built.
2. Code cells
You can include code cells in your notebook using the [source,python] block macro.
import sys, os
print("Hello, world!")
3. Feel++ Code cells
You can include Feel++ code cells in your notebook using the [source,python] block macro.
import feelpp.core
app = fppc.Environment(["myapp"],config=fppc.globalRepository("myapp"))
geo=fppc.download( "github:{repo:feelpp,path:feelpp/quickstart/laplacian/cases/feelpp2d/feelpp2d.geo}", worldComm=app.worldCommPtr() )[0]
print("geo file: {}".format(geo))
mesh = fppc.load(feelpp.mesh(dim=2,realdim=2), geo, 0.1)
Xh=fppc.functionSpace(mesh=mesh, space="Pchv")
f = Xh.element()
f.on(range=fppc.elements(mesh),expr=fppc.expr("{sin(pi*x)*sin(pi*y),cos(pi*x)*cos(pi*y)}:x:y",row=2,col=1))
e= fppc.exporter(mesh=mesh)
e.add("f",f)
e.save()
You can then visualize the result using the pyvista package as follows:
from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
import pyvista as pv
pv.set_jupyter_backend('panel')
reader = pv.get_reader("exports/ensightgold/Exporter/Exporter.case")
mesh = reader.read()
mesh.plot(scalars="f",show_edges=True)