forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use FunctionPenaltyDirichletBC in Hermite convergence tests.
* Drop redundant periodic, FunctionNeumannBCs, and associated Functions. * We have to use FunctionPenaltyDirichletBC with Hermites because MOOSE does not correctly handle the setting of DirichletBCs for HERMITE elements. * Switch test to use new [Adaptivity] system. Note that this changes this output of the 'dofs' postprocessor since there are now elemental dofs for the marker variable in the system. This required regolding the tests, but I checked to make sure that the solutions were still the same. * Drop gold files that were not used for anything. * If you use periodic BCs, you should not apply any other kind of BC on that boundary. * Reduce the order of the custom quadrature rule used. This seemed to make no difference in the results and might speed up the test just a bit. Refs idaholab#2190.
- Loading branch information
1 parent
d512061
commit f599233
Showing
11 changed files
with
78 additions
and
105 deletions.
There are no files selected for viewing
Binary file added
BIN
+18.8 KB
test/tests/variables/fe_hermite_convergence/gold/hermite_converge_dirichlet_out.e-s003
Binary file not shown.
Binary file removed
BIN
-28.6 KB
test/tests/variables/fe_hermite_convergence/gold/hermite_converge_neumann_out.e
Binary file not shown.
Binary file removed
BIN
-6.39 KB
test/tests/variables/fe_hermite_convergence/gold/hermite_converge_neumann_out.e-s002
Binary file not shown.
Binary file removed
BIN
-15.4 KB
test/tests/variables/fe_hermite_convergence/gold/hermite_converge_neumann_out.e-s003
Binary file not shown.
Binary file modified
BIN
+3.43 KB
(120%)
test/tests/variables/fe_hermite_convergence/gold/hermite_converge_periodic_out.e-s003
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
4 changes: 4 additions & 0 deletions
4
test/tests/variables/fe_hermite_convergence/hermite_converge_dirichlet_out.csv
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,4 @@ | ||
time,H1Semierror,H1error,L2error,dofs,h | ||
1,0.074775053298366,0.074924715366233,0.0047333262023076,116,0.70710678118655 | ||
2,0.011349257396992,0.011356952857997,0.00041801286535784,388,0.35355339059327 | ||
3,0.0015118325178008,0.0015121167524912,2.9317422887085e-05,1412,0.17677669529664 |
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
4 changes: 4 additions & 0 deletions
4
test/tests/variables/fe_hermite_convergence/hermite_converge_periodic_out.csv
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,4 @@ | ||
time,H1Semierror,H1error,L2error,dofs,h | ||
1,0.074775053282849,0.074924715349675,0.0047333261853512,116,0.70710678118655 | ||
2,0.011349257394713,0.011356952855582,0.00041801286158565,388,0.35355339059327 | ||
3,0.0015118325174985,0.0015121167521718,2.9317421998023e-05,1412,0.17677669529664 |
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,35 @@ | ||
#!/usr/bin/env python | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
""" | ||
This script makes log-log plots of the error vs. h for the tests in this directory. | ||
""" | ||
|
||
filenames = ['hermite_converge_dirichlet_out.csv', | ||
'hermite_converge_periodic_out.csv'] | ||
|
||
for filename in filenames: | ||
fig = plt.figure() | ||
ax1 = fig.add_subplot(111) | ||
|
||
# passing names=True option is supposed to treat first row as column | ||
# header names, and then everything is stored by column name in data. | ||
data = np.genfromtxt(filename, delimiter=',', names=True) | ||
|
||
log_h1_error = np.log10(data['H1error']) | ||
log_l2_error = np.log10(data['L2error']) | ||
logh = np.log10(data['h']) | ||
|
||
h1_fit = np.polyfit(logh, log_h1_error, 1) | ||
l2_fit = np.polyfit(logh, log_l2_error, 1) | ||
|
||
ax1.plot(logh, log_h1_error, linewidth=2, marker='o', label=r'$H^1$ error') | ||
ax1.text(-0.4, -2., '{:.2f}'.format(h1_fit[0])) | ||
|
||
ax1.plot(logh, log_l2_error, linewidth=2, marker='o', label=r'$L^2$ error') | ||
ax1.text(-0.4, -3.5, '{:.2f}'.format(l2_fit[0])) | ||
|
||
ax1.set_xlabel('log(h)') | ||
ax1.legend(loc='upper left') | ||
plt.savefig(filename.rsplit( ".", 1)[0] + '.pdf') |
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