Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
a7350b1
added Piola transformation and checked with unit test
rezgarshakeri Dec 21, 2020
4026e35
added basis function and checked with BDM and worked
rezgarshakeri Dec 22, 2020
f45c707
added ACspace but does not work
rezgarshakeri Dec 22, 2020
8e893f8
added unit test for BDMspace
rezgarshakeri Dec 22, 2020
824ade6
changed vertices numbering in AC to be consistent with what we have i…
rezgarshakeri Dec 22, 2020
59dc9a3
fixed the bug
rezgarshakeri Dec 22, 2020
98f5e6b
inverse Piola needed to be defined
rezgarshakeri Dec 22, 2020
916cb78
added unit test for AC basis
rezgarshakeri Dec 22, 2020
0940962
added in-line explanation
rezgarshakeri Dec 22, 2020
c27fc08
added quadrature
rezgarshakeri Dec 23, 2020
5558ecd
quadrature function testing passed
rezgarshakeri Dec 23, 2020
6bc99ee
added explanation in GetQuadrature function
rezgarshakeri Dec 23, 2020
aa7f361
function get normal added
rezgarshakeri Dec 24, 2020
d311fba
added explanation
rezgarshakeri Dec 24, 2020
9d5caf0
test of GetNormal function passed
rezgarshakeri Dec 24, 2020
d461b6a
added fig3.5 of Tao's Phd Thesis just in case
rezgarshakeri Dec 24, 2020
be7aeb3
fixed some typo
rezgarshakeri Dec 25, 2020
4d049a8
test AC nodal basis on distorted element E, passed
rezgarshakeri Dec 26, 2020
f4f9931
clean up some function
rezgarshakeri Dec 27, 2020
b79acaa
added GetElementMat function to construc the saddle point problem on …
rezgarshakeri Dec 31, 2020
e4cf881
added connectivity function
rezgarshakeri Jan 1, 2021
d2c5ee4
connectivity function test passed
rezgarshakeri Jan 1, 2021
dea716a
added GetNodesCoord function
rezgarshakeri Jan 1, 2021
8fb0877
GetNodeCoord function testing passed
rezgarshakeri Jan 1, 2021
d0c062b
added GetID_LM function
rezgarshakeri Jan 1, 2021
a33dbb4
test ID,LM passed
rezgarshakeri Jan 2, 2021
f929e21
added Assembly function
rezgarshakeri Jan 2, 2021
db26971
added Assembly function
rezgarshakeri Jan 2, 2021
f650e8c
checked the error of u and p, something is wrong!
rezgarshakeri Jan 3, 2021
88f9818
created AC basis
rezgarshakeri Jan 3, 2021
77b8a6f
added vondermonde matrix
rezgarshakeri Jan 3, 2021
a1a9537
added quadrature, this function is tested and passed
rezgarshakeri Jan 3, 2021
bc0d20b
added nodal interpolation matrix N
rezgarshakeri Jan 3, 2021
27433a9
added GetACNodalBasis function and GetDivACNodalBasis function
rezgarshakeri Jan 12, 2021
4942320
test of GetNodalBasis function passed for uniform and non-uniform ele…
rezgarshakeri Jan 12, 2021
b228599
added GetMassMat to compute the mass matrix for element e at quadratu…
rezgarshakeri Jan 12, 2021
feec10f
added GetDivMat function
rezgarshakeri Jan 12, 2021
40a710c
test of divergence operator passed on non-uniform element
rezgarshakeri Jan 12, 2021
44741a5
some modifications
rezgarshakeri Jan 12, 2021
661adf9
fixed a typo
rezgarshakeri Jan 12, 2021
41b55e9
added connectivity function
rezgarshakeri Jan 12, 2021
af2aec5
added GetNodeCoord function
rezgarshakeri Jan 12, 2021
eb3a13d
added GetID_LM function
rezgarshakeri Jan 12, 2021
a631081
change the numbering based on common edge
rezgarshakeri Jan 14, 2021
b9163cc
test of Piola, Normal, Nodal Basis and Divergence of Nodal basis passed
rezgarshakeri Jan 14, 2021
bb58f25
remove print() in some functions
rezgarshakeri Jan 14, 2021
ee297a9
added GetDivMat and GetMassMat
rezgarshakeri Jan 14, 2021
7526696
added one more test to check the divergence operator for 1 element
rezgarshakeri Jan 14, 2021
0be52a0
added connectivity function
rezgarshakeri Jan 14, 2021
82637d6
test of connectivity function passed
rezgarshakeri Jan 14, 2021
cb36265
added GetNodeCoord function
rezgarshakeri Jan 14, 2021
be4b87f
test of GetNodeCoord function passed
rezgarshakeri Jan 14, 2021
743e6ed
added GetID_LM function
rezgarshakeri Jan 14, 2021
b081d33
test of ID and LM passed
rezgarshakeri Jan 14, 2021
bcd9b69
deleted some files
rezgarshakeri Jan 16, 2021
1a77f39
changed the name of files
rezgarshakeri Jan 16, 2021
017a034
need to fix the assembly
rezgarshakeri Jan 16, 2021
d5fd72d
divergence oprators tested on uniform and nonuniform element and passed
rezgarshakeri Jan 16, 2021
c2723b8
added explanation for GetID function
rezgarshakeri Jan 19, 2021
172e716
added explanation for GetLMu function
rezgarshakeri Jan 19, 2021
6e0fd3c
added AssembleDivOperator funtion
rezgarshakeri Jan 19, 2021
1bd1d6a
test of GetSharedEdgeDof passed
rezgarshakeri Jan 19, 2021
1311ace
added explanation in AssembleDivOperato function
rezgarshakeri Jan 19, 2021
50eb5a2
added explanation
rezgarshakeri Jan 19, 2021
3a9c97a
test of divergence on multiple elements passed for both uniform and n…
rezgarshakeri Jan 19, 2021
e01901a
added plotmesh function
rezgarshakeri Jan 19, 2021
fd08c24
divergence operator test on 4 different mesh distribution and 3 veloc…
rezgarshakeri Jan 19, 2021
755fa5f
random mesh option added
rezgarshakeri Jan 19, 2021
f180152
test of divergence operator on random mesh distribution passed
rezgarshakeri Jan 19, 2021
1d6ffd2
fixed the random mesh generation and test divergence again. All passed
rezgarshakeri Jan 20, 2021
6443a14
comment plot option in test
rezgarshakeri Jan 20, 2021
967b3d0
deleted some lines
rezgarshakeri Jan 20, 2021
377e2af
added function div_u() to make unit test easier
rezgarshakeri Jan 20, 2021
66235da
added explanation in div_u()
rezgarshakeri Jan 20, 2021
e867237
added explanation
rezgarshakeri Jan 20, 2021
53ab648
added assembly
rezgarshakeri Jan 21, 2021
3bb9abc
added global forcing vec to Assembly function
rezgarshakeri Jan 22, 2021
757a1ce
added mesh to argparse in FEAC1red2D.py
rezgarshakeri Jan 22, 2021
4be0a0f
added PltSolution
rezgarshakeri Jan 26, 2021
ee91099
added trig and quartic MMS
rezgarshakeri Jan 26, 2021
4fe16fa
added GetEigenvalue and GetResidual
rezgarshakeri Jan 26, 2021
6716198
plot the residual
rezgarshakeri Jan 26, 2021
0b1fdb0
added more explanation
rezgarshakeri Jan 29, 2021
e4e3810
added traction
rezgarshakeri Feb 1, 2021
cf4906c
fixed the plot function
rezgarshakeri Feb 3, 2021
df8941a
added results
rezgarshakeri Feb 3, 2021
c979205
added more explanation
rezgarshakeri Feb 3, 2021
8fc3a82
deleted pdf files
rezgarshakeri Feb 4, 2021
43ec3f7
added local and global test for mass matrix, local mass for single el…
rezgarshakeri Feb 8, 2021
dbf1f3f
fixed the global mass test, passed test for uniform mesh
rezgarshakeri Feb 8, 2021
99f3ec7
added test for assmebled mass matrix with uniform, nonuniform,stretch…
rezgarshakeri Feb 8, 2021
974080a
clean up some comments
rezgarshakeri Feb 9, 2021
e69c51e
added to run convergence rate
rezgarshakeri Feb 9, 2021
e44a7cd
added to plot convergence rate!we got conv_rate plot
rezgarshakeri Feb 9, 2021
bf2ef62
added traction
rezgarshakeri Feb 10, 2021
05a2438
some clean up
rezgarshakeri Feb 10, 2021
ad4810e
to plot convrate
rezgarshakeri Feb 10, 2021
2a566e5
cleanup loglogplot
rezgarshakeri Feb 10, 2021
b0e26cc
clean-up legend
rezgarshakeri Feb 10, 2021
9925db0
added functions to compute inf-sup constant
rezgarshakeri Feb 12, 2021
c849357
added option to run convergence rate and infsup problem separately
rezgarshakeri Feb 12, 2021
1cd7f58
added to run infsup test
rezgarshakeri Feb 12, 2021
193d63d
some clean up
rezgarshakeri Feb 12, 2021
42007de
added inf-sup function
rezgarshakeri Feb 13, 2021
aa7bbc1
added option to run inf-sup or convergence
rezgarshakeri Feb 13, 2021
a06a46c
to run inf-sup test
rezgarshakeri Feb 13, 2021
c1c40fc
to plot inf-sup and coercivity constants
rezgarshakeri Feb 13, 2021
7dd8a32
some clean-up
rezgarshakeri Feb 13, 2021
fb7c5db
convrate and infsup test done for different meshes
rezgarshakeri Feb 15, 2021
30628ba
added a function to compute mesh size, h
rezgarshakeri Feb 17, 2021
25379a3
added h to the output of the run
rezgarshakeri Feb 17, 2021
7a8d8e2
fixed the legends
rezgarshakeri Feb 17, 2021
23b55a9
fixed the legend
rezgarshakeri Feb 17, 2021
3b23c01
added massQmode to use LGL like WY problem
rezgarshakeri Feb 19, 2021
21a7b44
some clean-up
rezgarshakeri Feb 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions ACspace/FEAC1red2D.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
""" how to run
python3 FEAC1red2D.py --nelx 4 --nely 4 --Q 2 --quadmethod GAUSS --mesh uniform --MMS quartic
if you run with
python3 FEAC1red2D.py
uses the default values as
nelx=4
nely=4
Q=2
quadmethod=GAUSS
mesh=uniform
MMS = quartic
"""
import FEACSubroutines as FE
import argparse
import numpy as np

def main():
parser = argparse.ArgumentParser(description='Input for FE_subroutines')

parser.add_argument('--nelx',
dest='nelx',
type=int,
default=4,
help='Number of element in x direction')

parser.add_argument('--nely',
dest='nely',
type=int,
default=4,
help='Number of element in y direction')

parser.add_argument('--Q',
dest='Q',
type=int,
default=2,
help='Number of quadrature points')

parser.add_argument('--quadmethod',
dest='quadmethod',
type=str,
default='GAUSS',
help='Quadmethod which can be GAUSS or LGL')

parser.add_argument('--mesh',
dest='mesh',
type=str,
default='uniform',
help='mesh distribution which can be:uniform, nonuniform, stretched, random')

parser.add_argument('--MMS',
dest='MMS',
type=str,
default='quartic',
help='MMS solution which can be:trig, quartic, quadratic, linear, constant')

parser.add_argument('--problem',
dest='problem',
type=str,
default='convrate',
help='run convergence rate problem')

parser.add_argument('--massQmode',
dest='massQmode',
type=str,
default='GAUSS',
help='LGL is like WY and GAUSS is AC')

args = parser.parse_args()

nelx = args.nelx
nely = args.nely
Q = args.Q
quadmethod = args.quadmethod
mesh = args.mesh
MMS = args.MMS
problem = args.problem
# massQmode=LGL is WY problem and QAUSS is AC
massQmode = args.massQmode
edge = 'all'

if problem == 'convrate':

F1, K = FE.Assembly(massQmode, MMS, mesh, nelx, nely, Q, quadmethod)
T = FE.GetGlobalTraction(MMS, mesh, nelx, nely, Q, quadmethod, edge)
F = F1 - T

dp, du = FE.GetFESol(K,F,nelx,nely)
p, u = FE.GetExactSol(MMS, mesh, nelx, nely)
h = FE.Gethsz(mesh, nelx, nely)
#res_p, res_u = FE.GetResidual(K,u,p, nelx, nely)

#error_u = np.absolute(du-u)
#error_p = np.absolute(dp-p)
normerror_u = np.linalg.norm(du-u)/np.linalg.norm(u)
normerror_p = np.linalg.norm(dp-p)/np.linalg.norm(p)

print("h, Velocity and Pressure Absolute Error:",h, normerror_u, normerror_p)

#FE.plotmesh(mesh, nelx, nely)
#FE.PltSolution(mesh, nelx, nely, du, dp, 'ux_h','uy_h','p_h' )
#FE.PltSolution(mesh, nelx, nely, u, p,'ux_ex','uy_ex','p_ex')
#FE.PltSolution(mesh, nelx, nely, error_u, error_p,'abs(ux_ex - ux_h)', 'abs(uy_ex - uy_h)', 'abs(p_ex - p_h)')
#FE.PltSolution(mesh, nelx, nely, res_u, res_p, 'res_ux','res_uy','res_p')

if problem == 'infsup':
H, M, B, C = FE.GetGlobalInfSupMat(mesh, nelx, nely, Q, quadmethod)
alpha, beta = FE.GetInfSupConst(H, M, B, C)
h = FE.Gethsz(mesh, nelx, nely)
#FE.plotmesh(mesh, nelx, nely)
print("h, coercivity and infsup constants:",h, alpha, beta)

return

if __name__ == '__main__':
main()
Loading