trellis: a framework for adaptive numerical analysis based on multiparadigm programming in c++
DESCRIPTION
Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++. Jean-Francois Remacle, Ottmar Klaas and Mark Shephard Scientific Computation Research Center Rensselaer Polytechnic Institute. Scope of the presentation. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/1.jpg)
Trellis: A Framework for Adaptive Numerical Analysis Based on
Multiparadigm Programming in C++
Jean-Francois Remacle, Ottmar Klaas and Mark Shephard
Scientific Computation Research Center
Rensselaer Polytechnic Institute
![Page 2: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/2.jpg)
Scope of the presentation
• Aim of Trellis: find y(x,t) Y() such that
• Trellis modular design– A parallel adaptive mesh library, takes care of – A discretization library, takes care of Y() – A core library, takes care of f– A solver library for algebraic systems
![Page 3: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/3.jpg)
Linearization
• We usually need a linearization of
• The aim of Trellis is to provide M, C, K and f
• Trellis interacts with external solvers like PetSC or DASPK
![Page 4: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/4.jpg)
Parallel Algorithm Oriented Mesh Data-structure
• Aim of AOMD: providing services to mesh users– Basic services, iterators to various ranges of entities,
iterators on adjacencies, input-output ... – Geometry based analysis, relation mesh to model is
maintained– Support of dynamic mesh adjacencies – Parallel services: message passing and load
balancing capabilities
• Open source: www.scorec.rpi.edu/AOMD
![Page 5: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/5.jpg)
Parallel Algorithm Oriented Mesh Data-structure
• AOMD extensions– Conforming (anisotropic) and non-conforming
adaptive capabilities, available in parallel– Calculus toolkit, integration, curvilinear elements
and their mappings (Bezier, Lagrange)– Computational Geometry toolkit (Octree, ADT)– Interface to solid modelers (e.g. Parasolid), vertex
snapping– TSTT interface
![Page 6: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/6.jpg)
Example of AOMD capabilities
• Parallel• Adaptive• D.G. Solver• Load Balancing• High order
![Page 7: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/7.jpg)
The Discretization Library
• Representing components yi of a tensor field y
• With – A functional basis:– Coefficients (DOF’s):
![Page 8: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/8.jpg)
Degrees of Freedom
• Aim: flexibility – parallel, h-p adaptive– multiple fields– multi-methods, multi-physics
• Representation– constant part, DofKey– variable part DofData– The idea of a general DOF
representation is far more important than the implementation
![Page 9: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/9.jpg)
Degrees of Freedom Manager
• Design– Contains all degrees of
freedom– Container: std::map or std::hash_map if available e.g. at www.stlport.org
– Singleton pattern i.e. one only instance in the program
– Parallel capabilities
![Page 10: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/10.jpg)
Function Spaces
• Provide C and N of
• Hierarchy of classes• Available:
– Hierarchical, p<15– Lagrange, p<10– L2-Orthogonal, p<15– Crouzeix-Raviart– Enriched X-fem basis,
to come...
![Page 11: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/11.jpg)
Examples of Function Spaces
![Page 12: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/12.jpg)
Examples of Function Spaces
![Page 13: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/13.jpg)
Examples of Function Spaces
![Page 14: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/14.jpg)
Linear operators
• Aim: take tensor components and build a tensorial representation– A field with 3 component may be a covariant
vector, a vector or 3 scalars (Euler 1-D e.g.)
• We call with and we have the expansion
![Page 15: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/15.jpg)
Examples of Operators
![Page 16: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/16.jpg)
Scalar product, dual pairing
• Consider– Operators Fi acting on yi
– Contraction :: between operator results produces a scalar
• Particular case: bilinear density
– Linearisation of the general case
– Representation: dim(L1)dim(L2) matrix (not tensor!)
![Page 17: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/17.jpg)
Some other densities
• Linear Form– Representation: column vector, dim(L)
• Trilinear Form
– Automatic linearization
![Page 18: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/18.jpg)
Contributors
• Matrix Contributor
• Representation
![Page 19: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/19.jpg)
Implementation
• Generic:
• Template parameters: operators, material law– Efficient (inlining) and very general– An operator that computes must exist– That type safety helps developer not to make mistakes
![Page 20: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/20.jpg)
Algebraic and ODE Solvers
• Interfaces– to serial linear system solvers: Sparskit, IML,…– to parallel solvers: PetSC, SuperLU– to ODE solvers: PesSC, DASPK
• Internal Trellis solvers– Newton, BFGS– classical ODE solvers: CN, RK...
![Page 21: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/21.jpg)
Navier-Stokes in 4 lines of code
• Constraints: fix components to a value
![Page 22: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/22.jpg)
Channel flow, Re=625
![Page 23: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/23.jpg)
Natural convection (time dependant)
![Page 24: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/24.jpg)
Heated from below
• Natural convection– Ra = 105
– Semi-implicit
![Page 25: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/25.jpg)
Magneto-hydrodynamics
• Tilt instability– Dipole of current (b) oppositely
directed (repelling forces) in a constant b (confining field)
– dipole starts turning in order to align the external magnetic field (minimize magnetic energy)
– repelling effect is able to expel vortices– Instability: kinetic energy grows like exp(t) with
= O(1.4)
![Page 26: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/26.jpg)
Magneto-hydrodynamics
• Characterization of ker(div) – From “inside”, with potentials – From “outside” with Lagrange multipliers
(pressure and electric potential). SUPG stabilization (modified upwind operators b’ and ’)
![Page 27: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/27.jpg)
Results for a Tilt instability– Magnetic potential a with b = (aez ) , p=1 and
p=3 (v and b)
![Page 28: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/28.jpg)
Results for the Tilt instability• Magnetic Flux Density and Velocity
![Page 29: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/29.jpg)
Results for the Tilt instability
• Kinetic energy vs. time
0.00E+00
1.00E-01
2.00E-01
3.00E-01
4.00E-01
5.00E-01
6.00E-01
2.00E-03 2.90E+00 4.94E+00 8.00E+00 1.41E+01
![Page 30: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/30.jpg)
Current
• Current density j ez= b
• Oscillations observed – SUPG Stabilization for
higher order (p=3) may not be sufficient
![Page 31: Trellis: A Framework for Adaptive Numerical Analysis Based on Multiparadigm Programming in C++](https://reader035.vdocument.in/reader035/viewer/2022062519/56815144550346895dbf6405/html5/thumbnails/31.jpg)
Conclusions
• Multiparadigm design in C++– Higher level objects, Object Oriented– Kernel, Generic
• Trellis– Operator based, linear and non-linear– Complex physics easy to implement
• Future– Parallel (in progress) and adaptive (in progress)