Page MenuHomec4science

symmetric_disk_engine.py
No OneTemporary

File Metadata

Created
Sat, Nov 16, 01:26

symmetric_disk_engine.py

import fenics as fen
import mshr
from rrompy.hfengines.linear_problem import HelmholtzProblemEngine
class SymmetricDiskEngine(HelmholtzProblemEngine):
def __init__(self, k0:float, n:int):
super().__init__(mu0 = [k0])
mesh = mshr.generate_mesh(mshr.Circle(fen.Point(0., 0.), 1.), n)
self.V = fen.FunctionSpace(mesh, "P", 1)
x, y = fen.SpatialCoordinate(self.V.mesh())[:]
self.forcingTerm = [fen.exp(x + y) * (1. - x ** 2. - y ** 2.),
fen.exp(x - y) * (1. - x ** 2. - y ** 2.)]

Event Timeline