Python + FEM
Introduction to SFE
Robert Cimrman
Department of Mechanics & New Technologies Research Centre University of West Bohemia
Plzeˇn, Czech Republic
Outline
1 Introduction
Programming Languages Programming Techniques
2 Our choice
Mixing Languages — Best of Both Worlds Python
Software Dependencies
3 Example Problem
Continuous Formulation Weak Formulation Problem Description File
Programming Languages
1 compiled (fortran, C, C++, Java, . . . )
Pros
speed, speed, speed, . . . , did I sayspeed?
large code base (legacy codes), tradition
Cons
(often) complicated build process, recompile after any change low-level⇒lots of lines to get basic stuff done
code size⇒maintenance problems static!
2 interpreted or scripting (sh, tcl, matlab, perl, ruby, python, . . . ) Pros
no compiling
(very) high-level⇒a few of lines to get (complex) stuff done code size⇒easy maintenance dynamic!
Cons
many are relatively new
Programming Languages
1 compiled (fortran, C, C++, Java, . . . )
Pros
speed, speed, speed, . . . , did I sayspeed?
large code base (legacy codes), tradition
Cons
(often) complicated build process, recompile after any change low-level⇒lots of lines to get basic stuff done
code size⇒maintenance problems static!
2 interpreted or scripting (sh, tcl, matlab, perl, ruby, python, . . . ) Pros
no compiling
(very) high-level⇒a few of lines to get (complex) stuff done code size⇒easy maintenance dynamic!
Cons
many are relatively new
Programming Languages
1 compiled (fortran, C, C++, Java, . . . )
Pros
speed, speed, speed, . . . , did I sayspeed?
large code base (legacy codes), tradition
Cons
(often) complicated build process, recompile after any change low-level⇒lots of lines to get basic stuff done
code size⇒maintenance problems static!
2 interpreted or scripting (sh, tcl, matlab, perl, ruby, python, . . . ) Pros
no compiling
(very) high-level⇒a few of lines to get (complex) stuff done code size⇒easy maintenance dynamic!
Cons
many are relatively new
Programming Languages
1 compiled (fortran, C, C++, Java, . . . )
Pros
speed, speed, speed, . . . , did I sayspeed?
large code base (legacy codes), tradition
Cons
(often) complicated build process, recompile after any change low-level⇒lots of lines to get basic stuff done
code size⇒maintenance problems static!
2 interpreted or scripting (sh, tcl, matlab, perl, ruby, python, . . . )
Pros
no compiling
(very) high-level⇒a few of lines to get (complex) stuff done code size⇒easy maintenance dynamic!
Cons
many are relatively new
Programming Languages
1 compiled (fortran, C, C++, Java, . . . )
Pros
speed, speed, speed, . . . , did I sayspeed?
large code base (legacy codes), tradition
Cons
(often) complicated build process, recompile after any change low-level⇒lots of lines to get basic stuff done
code size⇒maintenance problems static!
2 interpreted or scripting (sh, tcl, matlab, perl, ruby, python, . . . )
Pros
no compiling
(very) high-level⇒a few of lines to get (complex) stuff done code size⇒easy maintenance dynamic!
Cons
many are relatively new
Programming Languages
1 compiled (fortran, C, C++, Java, . . . )
Pros
speed, speed, speed, . . . , did I sayspeed?
large code base (legacy codes), tradition
Cons
(often) complicated build process, recompile after any change low-level⇒lots of lines to get basic stuff done
code size⇒maintenance problems static!
2 interpreted or scripting (sh, tcl, matlab, perl, ruby, python, . . . )
Pros
no compiling
(very) high-level⇒a few of lines to get (complex) stuff done code size⇒easy maintenance dynamic!
Cons
many are relatively new
Example C Code
c h a r s [ ] = ” s e l t u d y , mel dudy . a s e l o p r a v d u t u d y . ” ;
i n t s t r f i n d (c h a r ∗s t r , c h a r ∗t g t )
{
i n t t l e n = s t r l e n ( t g t ) ;
i n t max = s t r l e n ( s t r ) − t l e n ;
r e g i s t e r i n t i ;
f o r ( i = 0 ; i < max ; i ++){
i f ( s t r n c m p (& s t r [ i ] , t g t , t l e n ) = = 0 )
r e t u r n i ;
}
r e t u r n −1;
} i n t i 1 ;
i 1 = s t r f i n d ( s , ” t u d y ” ) ; p r i n t f ( ”%d\n ” , i 1 ) ;
Programming Techniques
Random remarks: spaghetti code modular programming OOP
design patterns(gang-of-four, GO4) post-OOP — dynamic languages
Programming Techniques
Random remarks: spaghetti code modular programming OOP
design patterns(gang-of-four, GO4) post-OOP — dynamic languages
Mixing Languages — Best of Both Worlds
Low level: C
FE matrix evaluations
costly mesh-related functions (listing faces, edges, surface generation, . . . )
. . .
can use alsofortran
+
High level: Python
www.python.org “batteries included” logic of the code
configuration files! probleminputfiles!
Mixing Languages — Best of Both Worlds
Low level: C
FE matrix evaluations
costly mesh-related functions (listing faces, edges, surface generation, . . . )
. . .
can use alsofortran
+
High level: Pythonwww.python.org “batteries included” logic of the code
configuration files!
Python I
Pythonris a dynamic object-oriented programming language that can be used for many kinds of software
development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code.
. . .
Python II
1.1.16 Why is it called Python?
At the same time he began implementing Python, Guido van Rossum was also reading the published scripts from ”Monty Python’s Flying Circus” (a BBC comedy series from the seventies, in the unlikely case you didn’t know). It occurred to him that he needed a name that was short, unique, and slightly mysterious, so he decided to call the language Python.
1.1.17 Do I have to like ”Monty Python’s Flying Circus”?
No, but it helps. :)
Python III
NASA uses Python. . .
. . . so does Rackspace, Industrial Light and Magic, AstraZeneca, Honeywell, and many others.
Python III
NASA uses Python. . .
. . . so does Rackspace, Industrial Light and Magic, AstraZeneca, Honeywell, and many others.
Software Dependencies
1 libraries & modules
➢ SciPy: free (BSD license) collection of numerical computing libraries for Python
enables Matlab-like array/matrix manipulations and indexing ➢ UMFPACK: very fast direct solver for sparse systems
Python wrappers are part of SciPy :-)
➢ output files (results) and data files inHDF5:
general purpose library and file format for storing scientific data, efficient storage and I/O
. . . viaPyTables
➢ misc: Pyparsing, Matplotlib 2 tools
➢ SWIG: automatic generation of Python-C interface code
➢ Medit: simple mesh and data viewer
➢ ParaView: VTK-based advanced mesh and data viewer in Tcl/Tk
Software Dependencies
1 libraries & modules
➢ SciPy: free (BSD license) collection of numerical computing
libraries for Python
enables Matlab-like array/matrix manipulations and indexing ➢ UMFPACK: very fast direct solver for sparse systems
Python wrappers are part of SciPy :-) ➢ output files (results) and data files inHDF5:
general purpose library and file format for storing scientific data, efficient storage and I/O
. . . viaPyTables
➢ misc: Pyparsing, Matplotlib
2 tools
➢ SWIG: automatic generation of Python-C interface code
➢ Medit: simple mesh and data viewer
➢ ParaView: VTK-based advanced mesh and data viewer in Tcl/Tk
Software Dependencies
1 libraries & modules
➢ SciPy: free (BSD license) collection of numerical computing
libraries for Python
enables Matlab-like array/matrix manipulations and indexing ➢ UMFPACK: very fast direct solver for sparse systems
Python wrappers are part of SciPy :-) ➢ output files (results) and data files inHDF5:
general purpose library and file format for storing scientific data, efficient storage and I/O
. . . viaPyTables
➢ misc: Pyparsing, Matplotlib 2 tools
➢ SWIG: automatic generation of Python-C interface code
➢ Medit: simple mesh and data viewer
➢ ParaView: VTK-based advanced mesh and data viewer in Tcl/Tk
Software Dependencies
1 libraries & modules
➢ SciPy: free (BSD license) collection of numerical computing
libraries for Python
enables Matlab-like array/matrix manipulations and indexing ➢ UMFPACK: very fast direct solver for sparse systems
Python wrappers are part of SciPy :-)
➢ output files (results) and data files inHDF5:
general purpose library and file format for storing scientific data, efficient storage and I/O
. . . viaPyTables
➢ misc: Pyparsing, Matplotlib 2 tools
➢ SWIG: automatic generation of Python-C interface code
➢ Medit: simple mesh and data viewer
➢ ParaView: VTK-based advanced mesh and data viewer in Tcl/Tk
Software Dependencies
1 libraries & modules
➢ SciPy: free (BSD license) collection of numerical computing
libraries for Python
enables Matlab-like array/matrix manipulations and indexing ➢ UMFPACK: very fast direct solver for sparse systems
Python wrappers are part of SciPy :-)
➢ output files (results) and data files inHDF5:
general purpose library and file format for storing scientific data, efficient storage and I/O
. . . viaPyTables
➢ misc: Pyparsing, Matplotlib
2 tools
➢ SWIG: automatic generation of Python-C interface code ➢ Medit: simple mesh and data viewer
➢ ParaView: VTK-based advanced mesh and data viewer in Tcl/Tk
Software Dependencies
1 libraries & modules
➢ SciPy: free (BSD license) collection of numerical computing
libraries for Python
enables Matlab-like array/matrix manipulations and indexing ➢ UMFPACK: very fast direct solver for sparse systems
Python wrappers are part of SciPy :-)
➢ output files (results) and data files inHDF5:
general purpose library and file format for storing scientific data, efficient storage and I/O
. . . viaPyTables
➢ misc: Pyparsing, Matplotlib
2 tools
➢ SWIG: automatic generation of Python-C interface code
➢ Medit: simple mesh and data viewer
➢ ParaView: VTK-based advanced mesh and data viewer in Tcl/Tk
Software Dependencies
1 libraries & modules
➢ SciPy: free (BSD license) collection of numerical computing
libraries for Python
enables Matlab-like array/matrix manipulations and indexing ➢ UMFPACK: very fast direct solver for sparse systems
Python wrappers are part of SciPy :-)
➢ output files (results) and data files inHDF5:
general purpose library and file format for storing scientific data, efficient storage and I/O
. . . viaPyTables
➢ misc: Pyparsing, Matplotlib
2 tools
➢ SWIG: automatic generation of Python-C interface code
➢ Medit: simple mesh and data viewer
➢ ParaView: VTK-based advanced mesh and data viewer in Tcl/Tk
Shape Optimization in Incompressible Flow Problems
Objective FunctionΨΓ(u)≡
ν 2
Z
Ωc
|∇u|2−→min (1)
minimize gradients of solution (e.g. losses) in Ωc ⊂Ω
by moving design boundaryΓ⊂∂Ω perturbation of Γ by vector fieldV
Ω(t) = Ω +{tV(x)}x∈Ω where V= 0 in ¯Ωc∪∂Ω\Γ (2)
Γin Γ
out ΓD
ΓD
ΓC ΩC ΩD
Shape Optimization in Incompressible Flow Problems
Objective FunctionΨΓ(u)≡
ν 2
Z
Ωc
|∇u|2−→min (1)
minimize gradients of solution (e.g. losses) in Ωc ⊂Ω
by moving design boundaryΓ⊂∂Ω
perturbation of Γ by vector fieldV
Ω(t) = Ω +{tV(x)}x∈Ω where V= 0 in ¯Ωc∪∂Ω\Γ (2)
Γin Γ
out ΓD
ΓD
ΓC ΩC ΩD
Shape Optimization in Incompressible Flow Problems
Objective FunctionΨΓ(u)≡
ν 2
Z
Ωc
|∇u|2−→min (1)
minimize gradients of solution (e.g. losses) in Ωc ⊂Ω
by moving design boundaryΓ⊂∂Ω
perturbation of Γ by vector fieldV
Ω(t) = Ω +{tV(x)}x∈Ω where V= 0 in ¯Ωc∪∂Ω\Γ (2)
Γin Γ
out ΓD
ΓD
ΓC ΩC ΩD
Appetizer
flow and spline boxes, left: initial, right: final
→
Continuous Formulation
laminar steady state incompressibleNavier-Stokes equations
−ν∇2u+u· ∇u+∇p = 0 in Ω (3)
∇ ·u = 0 in Ω (4)
boundary conditions
u=u0 on Γin −pn+ν∂u
∂n =−pn¯ on Γout
u= 0 on Γwalls
(5)
adjoint equations for computing the adjoint solutionw: −ν∇2w+∇u·w−u· ∇w− ∇r =χΩ
cν∇
2u in Ω ∇ ·w = 0 in Ω (6) w = 0 on Γ ∪Γ andχ is the characteristic function of Ω
Continuous Formulation
laminar steady state incompressibleNavier-Stokes equations
−ν∇2u+u· ∇u+∇p = 0 in Ω (3)
∇ ·u = 0 in Ω (4)
boundary conditions
u=u0 on Γin −pn+ν∂u
∂n =−pn¯ on Γout
u= 0 on Γwalls
(5)
adjoint equations for computing the adjoint solutionw:
−ν∇2w+∇u·w−u· ∇w− ∇r =χ Ωcν∇
2u in Ω
∇ ·w = 0 in Ω (6)
Weak Formulation
state problem: find u, p (from suitable function spaces) such that
Z
Ω
ν∇v :∇u+
Z
Ω
(u· ∇u)·v− Z
Ω
p∇ ·v=− Z
Γout
¯
pv·n ∀v ∈V0,
Z
Ω
q∇ ·u= 0 ∀q∈Q
(7)
adjoint equations: find w, r (from suitable function spaces) such that
Z
Ω
ν∇v :∇w+
Z
Ω
(v· ∇u)·w+
Z
Ω
(u· ∇v)·w+
Z
Ω r∇ ·v =−
Z
Ωc
ν∇v :∇u ∀v ∈V0,
Z
Ω
q∇ ·w = 0 ∀q∈Q
Weak Formulation
state problem: find u, p (from suitable function spaces) such that
Z
Ω
ν∇v :∇u+
Z
Ω
(u· ∇u)·v− Z
Ω
p∇ ·v=− Z
Γout
¯
pv·n ∀v ∈V0,
Z
Ω
q∇ ·u= 0 ∀q∈Q
(7)
adjoint equations: find w, r (from suitable function spaces) such that
Z
Ω
ν∇v :∇w+
Z
Ω
(v· ∇u)·w+
Z
Ω
(u· ∇v)·w+
Z
Ω r∇ ·v
=−
Z
Ωc
ν∇v :∇u ∀v ∈V0,
Z
Ω
q∇ ·w = 0 ∀q∈Q
Weak Formulation
state problem: find u, p (from suitable function spaces) such that
Z
Ω
ν∇v :∇u+
Z
Ω
(u· ∇u)·v− Z
Ω
p∇ ·v=− Z
Γout
¯
pv·n ∀v ∈V0,
Z
Ω
q∇ ·u= 0 ∀q∈Q
(7)
adjoint equations: find w, r (from suitable function spaces) such that
Z
Ω
ν∇v :∇w+
Z
Ω
(v· ∇u)·w+
Z
Ω
(u· ∇v)·w+
Z
Ω r∇ ·v
=−
Z
Ωc
ν∇v :∇u ∀v ∈V0,
Z
Ω
q∇ ·w = 0 ∀q∈Q
Problem Description File I
a regular python file ⇒all python machinery is accessible!
requires/recognizes severalkeywordsto define mesh
regions→subdomains, boundaries, characteristic functions, . . . boundary conditions→Dirichlet
fields→field approximation per subdomain variables→unknown fields, test fields, parameters equations
materials→constitutive relations, e.g. newton fluid, elastic solid, . . . solver parameters→nonlinear solver, flow solver, optimization solver, . . .
Problem Description File I
a regular python file ⇒all python machinery is accessible!
requires/recognizes severalkeywordsto define
mesh
regions→subdomains, boundaries, characteristic functions, . . . boundary conditions→Dirichlet
fields→field approximation per subdomain variables→unknown fields, test fields, parameters equations
materials→constitutive relations, e.g. newton fluid, elastic solid, . . . solver parameters→nonlinear solver, flow solver, optimization solver, . . .
Problem Description File II
mesh
f i l e N a m e m e s h = ’ s i m p l e . mesh ’
regions
r e g i o n 1 0 0 0 = {
’ name ’ : ’ Omega ’ ,
’ s e l e c t ’ : ’ e l e m e n t s o f g r o u p 6 ’ ,
}
r e g i o n 0 = {
’ name ’ : ’ W a l l s ’ ,
’ s e l e c t ’ : ’ n o d e s o f s u r f a c e −n r . O u t l e t ’ ,
}
r e g i o n 1 = {
’ name ’ : ’ I n l e t ’ ,
’ s e l e c t ’ : ’ n o d e s by c i n c ( x , y , z , 0 ) ’ ,
}
r e g i o n 2 = {
’ name ’ : ’ O u t l e t ’ ,
’ s e l e c t ’ : ’ n o d e s by c i n c ( x , y , z , 1 ) ’ ,
}
r e g i o n 1 0 0 = {
’ name ’ : ’ Omega C ’ , # C o n t r o l domain .
’ s e l e c t ’ : ’ n o d e s i n ( x > −25.9999 e−3) & ( x < −18.990 e−3 ) ’ ,
}
r e g i o n 1 0 1 = {
Problem Description File III
fields
f i e l d 1 ={
’ name ’ : ’ 3 v e l o c i t y ’ , ’ dim ’ : ( 3 , 1 ) ,
’ f l a g s ’ : ( ’ BQP’ , ) ,
’ b a s e s ’ : ( ( ’ Omega ’ , ’ 3 4 P1B ’ ) , )
}
f i e l d 2 ={
’ name ’ : ’ p r e s s u r e ’ , ’ dim ’ : ( 1 , 1 ) , ’ f l a g s ’ : ( ) ,
’ b a s e s ’ : ( ( ’ Omega ’ , ’ 3 4 P 1 ’ ) , )
}
variables v a r i a b l e s ={
’ u ’ : ( ’ f i e l d ’ , ’ p a r a m e t e r ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) ) , ’ w 0 ’ : ( ’ f i e l d ’ , ’ p a r a m e t e r ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) ) , ’w ’ : ( ’ f i e l d ’ , ’ unknown ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) , 0 ) , ’ v ’ : ( ’ f i e l d ’ , ’ t e s t ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) , ’ w ’ ) , ’ p ’ : ( ’ f i e l d ’ , ’ p a r a m e t e r ’ , ’ p r e s s u r e ’ , ( 9 , ) ) , ’ r ’ : ( ’ f i e l d ’ , ’ unknown ’ , ’ p r e s s u r e ’ , ( 9 , ) , 1 ) , ’ q ’ : ( ’ f i e l d ’ , ’ t e s t ’ , ’ p r e s s u r e ’ , ( 9 , ) , ’ r ’ ) , ’ Nu ’ : ( ’ f i e l d ’ , ’ m e s h V e l o c i t y ’ , ’ p r e s s u r e ’ , ( 9 , ) ) ,
Problem Description File III
fields
f i e l d 1 ={
’ name ’ : ’ 3 v e l o c i t y ’ , ’ dim ’ : ( 3 , 1 ) ,
’ f l a g s ’ : ( ’ BQP’ , ) ,
’ b a s e s ’ : ( ( ’ Omega ’ , ’ 3 4 P1B ’ ) , )
}
f i e l d 2 ={
’ name ’ : ’ p r e s s u r e ’ , ’ dim ’ : ( 1 , 1 ) , ’ f l a g s ’ : ( ) ,
’ b a s e s ’ : ( ( ’ Omega ’ , ’ 3 4 P 1 ’ ) , )
}
variables
v a r i a b l e s ={
’ u ’ : ( ’ f i e l d ’ , ’ p a r a m e t e r ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) ) , ’ w 0 ’ : ( ’ f i e l d ’ , ’ p a r a m e t e r ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) ) , ’w ’ : ( ’ f i e l d ’ , ’ unknown ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) , 0 ) , ’ v ’ : ( ’ f i e l d ’ , ’ t e s t ’ , ’ 3 v e l o c i t y ’ , ( 3 , 4 , 5 ) , ’ w ’ ) , ’ p ’ : ( ’ f i e l d ’ , ’ p a r a m e t e r ’ , ’ p r e s s u r e ’ , ( 9 , ) ) , ’ r ’ : ( ’ f i e l d ’ , ’ unknown ’ , ’ p r e s s u r e ’ , ( 9 , ) , 1 ) , ’ q ’ : ( ’ f i e l d ’ , ’ t e s t ’ , ’ p r e s s u r e ’ , ( 9 , ) , ’ r ’ ) , ’ Nu ’ : ( ’ f i e l d ’ , ’ m e s h V e l o c i t y ’ , ’ p r e s s u r e ’ , ( 9 , ) ) ,
Problem Description File IV
Dirichlet BC
e b c ={
’ W a l l s ’ : ( ( ’ W a l l s ’ , ( 3 , 4 , 5 ) , 0 . 0 ) , ) , ’ I n l e t ’ : ( ( ’ V e l o c i t y I n l e t x ’ , ( 4 , ) , 1 . 0 ) ,
( ’ V e l o c i t y I n l e t y z ’ , ( 3 , 5 ) , 0 . 0 ) ) ,
}
state equations (compare with (7)) e q u a t i o n s ={
’ b a l a n c e ’ :
”””+ d w d i v g r a d . Omega ( f l u i d , v , w ) + d w c o n v e c t . Omega ( v , w )
− d w g r a d . Omega ( v , r )
=− d w s u r f a c e l t r . O u t l e t ( b p r e s s , v ) ” ” ” , ’ i n c o m p r e s s i b i l i t y ’ :
””” d w d i v . Omega ( q , w ) = 0 ” ” ” ,
Problem Description File IV
Dirichlet BC
e b c ={
’ W a l l s ’ : ( ( ’ W a l l s ’ , ( 3 , 4 , 5 ) , 0 . 0 ) , ) , ’ I n l e t ’ : ( ( ’ V e l o c i t y I n l e t x ’ , ( 4 , ) , 1 . 0 ) ,
( ’ V e l o c i t y I n l e t y z ’ , ( 3 , 5 ) , 0 . 0 ) ) ,
}
state equations (compare with (7))
e q u a t i o n s ={
’ b a l a n c e ’ :
”””+ d w d i v g r a d . Omega ( f l u i d , v , w ) + d w c o n v e c t . Omega ( v , w )
− d w g r a d . Omega ( v , r )
=− d w s u r f a c e l t r . O u t l e t ( b p r e s s , v ) ” ” ” , ’ i n c o m p r e s s i b i l i t y ’ :
””” d w d i v . Omega ( q , w ) = 0 ” ” ” ,
Problem Description File V
adjoint equations (compare with (8))
e q u a t i o n s a d j o i n t = {
’ b a l a n c e ’ :
”””+ d w d i v g r a d . Omega ( f l u i d , v , w ) + d w a d j c o n v e c t 1 . Omega ( v , w , u ) + d w a d j c o n v e c t 2 . Omega ( v , w , u ) + d w g r a d . Omega ( v , r )
=− d w a d j d i v g r a d 2 . Omega C ( one , f l u i d , v , u ) ” ” ” , ’ i n c o m p r e s s i b i l i t y ’ :
””” d w d i v . Omega ( q , w ) = 0 ” ” ” ,
}
materials m a t e r i a l 2 = {
’ name ’ : ’ f l u i d ’ , ’ mode ’ : ’ h e r e ’ , ’ r e g i o n ’ : ’ Omega ’ , ’ v i s c o s i t y ’ : 1 . 2 5 e−1,
}
m a t e r i a l 1 0 0 = {
’ name ’ : ’ b p r e s s ’ , ’ mode ’ : ’ h e r e ’ , ’ r e g i o n ’ : ’ Omega ’ , ’ v a l ’ : 0 . 0 ,
Problem Description File V
adjoint equations (compare with (8))
e q u a t i o n s a d j o i n t = {
’ b a l a n c e ’ :
”””+ d w d i v g r a d . Omega ( f l u i d , v , w ) + d w a d j c o n v e c t 1 . Omega ( v , w , u ) + d w a d j c o n v e c t 2 . Omega ( v , w , u ) + d w g r a d . Omega ( v , r )
=− d w a d j d i v g r a d 2 . Omega C ( one , f l u i d , v , u ) ” ” ” , ’ i n c o m p r e s s i b i l i t y ’ :
””” d w d i v . Omega ( q , w ) = 0 ” ” ” ,
}
materials
m a t e r i a l 2 = {
’ name ’ : ’ f l u i d ’ , ’ mode ’ : ’ h e r e ’ , ’ r e g i o n ’ : ’ Omega ’ , ’ v i s c o s i t y ’ : 1 . 2 5 e−1,
}
m a t e r i a l 1 0 0 = {
’ name ’ : ’ b p r e s s ’ , ’ mode ’ : ’ h e r e ’ , ’ r e g i o n ’ : ’ Omega ’ , ’ v a l ’ : 0 . 0 ,
Yes, the final slide!
What is done
basic FE element engine
approximations up to P2 on simplexes (possibly with bubble)
Q1 tensor-product
approximation on rectangles
handling of fields and variables
boundary conditions, DOF handling
FE assembling
equations, terms, regions materials, material caches generic solvers (Newton iteration, direct linear system solution)
What is not done
general FE engine, with symbolic evaluation (`a la SyFi - merge it?) documentation, unit tests organization of solvers
fast problem-specific solvers parallelization of both assembling and solving
use PETSC? What will not be done (?)
GUI
real symbolic parsing/evaluation of equations
Yes, the final slide!
What is done
basic FE element engine
approximations up to P2 on simplexes (possibly with bubble)
Q1 tensor-product
approximation on rectangles
handling of fields and variables
boundary conditions, DOF handling
FE assembling
equations, terms, regions materials, material caches generic solvers (Newton iteration, direct linear system solution)
What is not done
general FE engine, with symbolic
evaluation (`a la SyFi - merge it?)
documentation, unit tests organization of solvers
fast problem-specific solvers
parallelization of both assembling and solving
use PETSC?
What will not be done (?) GUI
real symbolic parsing/evaluation of equations
Yes, the final slide!
What is done
basic FE element engine
approximations up to P2 on simplexes (possibly with bubble)
Q1 tensor-product
approximation on rectangles
handling of fields and variables
boundary conditions, DOF handling
FE assembling
equations, terms, regions materials, material caches generic solvers (Newton iteration, direct linear system solution)
What is not done
general FE engine, with symbolic
evaluation (`a la SyFi - merge it?)
documentation, unit tests organization of solvers
fast problem-specific solvers
parallelization of both assembling and solving
use PETSC?
What will not be done (?)
GUI
real symbolic parsing/evaluation of equations