This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from micahjohnson150/update_mms_tests-30
Updated mms tests
- Loading branch information
Showing
13 changed files
with
104 additions
and
40 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
Binary file modified
BIN
-80 Bytes
(100%)
tests/heat_equation/mms/gold/mms_heat_equation_dphi_dt_out.e
Binary file not shown.
Binary file not shown.
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
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
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
'''*************************************** | ||
* Generating Method of MFG-ed * | ||
* Solutions applied to the Heat * | ||
* equation (eqn 34) in Kaempfer 2009 * | ||
* * | ||
* Compile: * | ||
* python MassTransportMMS.py * | ||
* * | ||
***************************************''' | ||
#!/usr/bin/python | ||
|
||
from sympy import * | ||
from sympy.utilities.codegen import codegen | ||
init_printing() | ||
|
||
x = symbols('x') | ||
y = symbols('y') | ||
t = symbols('t') | ||
|
||
phi = t*x*y | ||
u = t*sin(2.0*pi*x)*cos(2.0*pi*y) | ||
print '\n' | ||
print 'u =\n ' | ||
pprint(u) | ||
print '\n' | ||
|
||
#Chemical diffusion | ||
D = symbols('D') | ||
|
||
#Simplifying Math terms | ||
du_dt = diff(u,t) | ||
grad_u = [diff(u,x), diff(u,y)] | ||
diffuse_D_grad_u =((diff(D*grad_u[0],x) + diff(D*grad_u[1],y))) | ||
|
||
dPhi_dt = diff(phi,t) | ||
|
||
term1 = du_dt | ||
term2 = diffuse_D_grad_u | ||
term3 =-0.5*(dPhi_dt) #yes it is negative in the original eq. | ||
|
||
# Eq. (35) without dPhi_dt | ||
f = term1-term2 | ||
|
||
#Print out equation | ||
print '\n' | ||
print ' F = \n' | ||
pprint(f) | ||
print '\n' | ||
print '\n' | ||
print ' -phi_term = \n' | ||
pprint(-term3) | ||
print '\n' | ||
|
||
|
||
#Generate the C/C++ version of the code. | ||
print('Equation 35 Code : \n') | ||
[(c_name, c_code), (h_name, c_header)] = codegen( | ||
("f", f), "C", "test", header=False, empty=False) | ||
print(c_code) | ||
print('\n') | ||
|
||
#Generate C/C++ code for term 4 | ||
print('-dPhi_dt term Code : \n') | ||
[(c_name, c_code), (h_name, c_header)] = codegen( | ||
("f", -term3), "C", "test", header=False, empty=False) | ||
print(c_code) | ||
print('\n') | ||
|
Binary file modified
BIN
-57.4 KB
(75%)
tests/mass_transport/mms/gold/mms_mass_transport_dphi_dt_out.e
Binary file not shown.
Binary file not shown.
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
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
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
Binary file modified
BIN
+0 Bytes
(100%)
tests/phase_evolution/mms/gold/mms_double_well_potential_out.e
Binary file not shown.
Binary file not shown.