-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Last touches. The beginning of a new idea?
- Loading branch information
1 parent
d385329
commit 6052f4e
Showing
2 changed files
with
18 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
from firedrake import SpatialCoordinate, VectorFunctionSpace, Function | ||
from q3d.uflplus import * | ||
|
||
def firedrakefy(func, mesh): # REMOVE? | ||
H1_vec = VectorFunctionSpace(mesh, 'CG', 1, 5) | ||
x0, x1, x2 = SpatialCoordinate(mesh) | ||
def EqnGlobalFunction(func_str, func_space_data): | ||
from q3d.firedrakeplus.eqnglobals import EqnGlobals | ||
|
||
H1_vec = VectorFunctionSpace(*func_space_data, 5) | ||
x0, x1, x2 = SpatialCoordinate(func_space_data[0]) | ||
|
||
func = getattr(EqnGlobals, func_str) | ||
|
||
f = Function(H1_vec) | ||
f.interpolate(eval(func)) | ||
|
||
return f | ||
|
||
def RandomFunction(function_space): # CHANGE to mesh instead of func space? | ||
f = Function(function_space) | ||
f.interpolate(as_vector([0,0,0,0,0])) | ||
def RandomFunction(dim, func_space_data): # CHANGE to mesh instead of func space? | ||
H1_vec = VectorFunctionSpace(*func_space_data, dim) | ||
|
||
f = Function(H1_vec) | ||
f.assign(Zero((dim,))) | ||
|
||
for ii in range(len(f.dat.data)): | ||
f.dat.data[ii] = f.rand(5)*1e+1 | ||
|
||
return f | ||
|
||
def ManuQ(mesh): # REMOVE? | ||
from q3d.firedrakeplus.eqnglobals import EqnGlobals | ||
return firedrakefy(EqnGlobals.manu_q, mesh) | ||
return f |
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