libsupermesh version 1.0.1

Size: px
Start display at page:

Download "libsupermesh version 1.0.1"

Transcription

1 libsupermesh version James R. Maddison School of Mathematics and Maxwell Institute for Mathematical Sciences, University of Edinburgh, UK Iakovos Panourgias EPCC, University of Edinburgh, UK, Patrick E. Farrell Mathematical Institute, University of Oxford, UK, Center for Biomedical Computing, Simula Research Laboratory, Oslo, Norway January 2017 Contents 1 Introduction 2 2 Building libsupermesh 2 3 Using libsupermesh 3 4 Intersection identification Identifying all candidate intersections sort intersection finder quadtree intersection finder octree intersection finder tree intersection finder rtree intersection finder advancing front intersection finder brute force intersection finder intersection finder Identifying candidate intersections using queryable trees quadtree type octree type tree type rtree type j.r.maddison@ed.ac.uk 1

2 5 Element intersection One dimension Two dimensions Three dimensions General dimensions Parallelisation Algorithm parallel supermesh Callbacks Examples Serial Parallel Copyright libsupermesh Fluidity TinyXML libspatialindex Rtree UseLATEX.cmake Acknowledgements 49 1 Introduction libsupermesh is a Fortran 2008 library for serial and parallel mesh intersection, or supermeshing [Farrell et al., 2009, Farrell, 2009]. libsupermesh specifically includes components used in the local supermeshing approach described in Farrell and Maddison [2011] [see also Gander and Japhet, 2009, 2013]. Here, given two input meshes, elements in each mesh which intersect are identified, and a local mesh of their intersection is generated. 2 Building libsupermesh libsupermesh is built using CMake 1, for example via: cd [LIBSUPERMESH SOURCE PATH] / b u i l d cmake [LIBSUPERMESH SOURCE PATH] \ DCMAKE INSTALL PREFIX=[LIBSUPERMESH INSTALL PATH] make make i n s t a l l where [LIBSUPERMESH_SOURCE_PATH] is the path to the source directory, and [LIBSUPERMESH_INSTALL_PATH] is the path to the installation directory. Note that libsupermesh cannot be built in the source directory, and must be built with double precision Fortran reals

3 CMake options CMAKE BUILD TYPE Build type. Valid options are Release and Debug. Default Release. BUILD SHARED LIBS Build a shared library. Default disabled. LIBSUPERMESH DOUBLE PRECISION Use double precision Fortran reals. Fortran reals are used. Default enabled. If disabled then single precision LIBSUPERMESH AUTO COMPILER FLAGS Choose compiler flags automatically, enabling aggressive optimisation options for the Release build and additional debugging options for the Debug build. Active only if the GNU or Cray compilers are used. This overrides other CMake compiler flag variables. Default enabled. LIBSUPERMESH ENABLE JUDY Use the Judy library 2. Requires an available installation of Judy. Default disabled. LIBSUPERMESH ENABLE TIMERS Enable internal timers for parallel supermeshing. Default disabled. LIBSUPERMESH OVERLAP COMPUTE COMMS Overlaps communication and some calculation in parallel supermeshing. Default disabled. Build targets make Default build. Builds the library and unit tests. make test Runs the unit tests. make doc Builds this manual. 3 Using libsupermesh The libsupermesh Fortran module provides access to all functionality described in this manual. This can be accessed via: use libsupermesh If libsupermesh is compiled with the LIBSUPERMESH_DOUBLE_PRECISION CMake option enabled then libsupermesh Fortran real variables have kind real64. Otherwise libsupermesh Fortran real variables have kind real32. The kind is defined by the default integer real_kind variable. Throughout this manual the real kind is omitted from variable declarations. 4 Intersection identification libsupermesh includes a number of different algorithms for identifying candidate pairs of elements, in two different meshes A and B, which intersect. These algorithms are all based upon an axis-aligned bounding box (AABB) intersection predicate. Hence the different approaches are all guaranteed to return all pairs of elements which have a non-trivial intersection 3, but may additionally return pairs of elements which have zero intersection. The following definitions are used: d Mesh A defines a subset Ω A R d, and mesh B a subset Ω B R d Except for numerical precision related errors. 3

4 l A Number of nodes per element in mesh A. l B Number of nodes per element in mesh B. V A Number of nodes in mesh A. V B Number of nodes in mesh B. E A Number of elements in mesh A. E B Number of elements in mesh B. Element-node graphs are represented as l A E A and l B E B integer arrays respectively. For example, if enlist_a stores the element-node graph for mesh A, then in the following: integer, dimension ( l A, E A) : : e n l i s t a integer, dimension ( l A ) : : nodes a!... nodes a = e n l i s t a ( :, e l e a ) nodes_a contains the indices of nodes in mesh A for element ele_a. Candidate intersection element-element graphs are stored either as a ragged array or as a Compressed Sparse Row (CSR) sparsity 4. For the ragged array variant: type ( i n t e r s e c t i o n s ), dimension (E A) : : map ab integer : : n integer, dimension ( : ), pointer : : v!... n = map ab ( e l e a )%n v => map ab ( e l e a )%v or for the CSR sparsity variant: integer, dimension ( : ), allocatable, target : : map ab indices integer, dimension (E A + 1) : : map ab indptr integer : : n integer, dimension ( : ), pointer : : v!... n = map ab indptr ( e l e a + 1) map ab indptr ( e l e a ) v => map ab indices ( map ab indptr ( e l e a ) : map ab indptr ( e l e a + 1) 1) n contains the number of candidate elements in mesh B which may intersect with element ele_a of mesh A. v points at a vector of length n containing the indices of elements in mesh B which may intersect with element ele_a of mesh A. 4 See e.g. the SciPy documentation, matrix.html. 4

5 4.1 Identifying all candidate intersections The following intersection finders return an element-element graph which associates with all elements in mesh A candidate intersecting elements in mesh B. The ragged array intersections data type, allocated by one of the following intersection finder routines, must be deallocated after use. interface deallocate module procedure d e a l l o c a t e i n t e r s e c t i o n s end interface deallocate pure elemental subroutine d e a l l o c a t e i n t e r s e c t i o n s ( i n t s ) type ( i n t e r s e c t i o n s ), intent ( inout ) : : i n t s ints Candidate intersecting mesh B elements for a mesh A element sort intersection finder An intersection finder for 1D meshes, based upon a combination of a merge sort and a 1D advancing front. interface s o r t i n t e r s e c t i o n f i n d e r module procedure s o r t i n t e r s e c t i o n f i n d e r r a n k 1 i n t e r s e c t i o n s, & & s o r t i n t e r s e c t i o n f i n d e r r a n k 2 i n t e r s e c t i o n s, & & s o r t i n t e r s e c t i o n f i n d e r r a n k 1 c s r s p a r s i t y, & & s o r t i n t e r s e c t i o n f i n d e r r a n k 2 c s r s p a r s i t y end interface s o r t i n t e r s e c t i o n f i n d e r pure subroutine s o r t i n t e r s e c t i o n f i n d e r r a n k 1 i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab ) real, dimension ( : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab positions a Length V A vector. Mesh A node coordinates. enlist a 2 E A array. Mesh A element-node graph. positions b Length V B vector. Mesh B node coordinates. enlist b 2 E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. pure subroutine s o r t i n t e r s e c t i o n f i n d e r r a n k 2 i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab 5

6 positions a 1 V A array. Mesh A node coordinates. enlist a 2 E A array. Mesh A element-node graph. positions b 1 V B array. Mesh B node coordinates. enlist b 2 E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. pure subroutine s o r t i n t e r s e c t i o n f i n d e r r a n k 1 c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr ) real, dimension ( : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr positions a Length V A vector. Mesh A node coordinates. enlist a 2 E A array. Mesh A element-node graph. positions b Length V B vector. Mesh B node coordinates. enlist b 2 E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A + 1. pure subroutine s o r t i n t e r s e c t i o n f i n d e r r a n k 2 c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr positions a 1 V A array. Mesh A node coordinates. enlist a 2 E A array. Mesh A element-node graph. positions b 1 V B array. Mesh B node coordinates. enlist b 2 E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A quadtree intersection finder An intersection finder for 2D meshes, based upon a quadtree data structure [Samet, 1984]. Each interface accepts an optional max_size argument, which specifies the maximum number of elements in a leaf node. This should be greater than the maximum number of elements (in the mesh used to build the quadtree) which can be found in a neighbourhood of an arbitrary point. If not specified then max_size defaults to the maximum of 256, and the maximum number of mesh elements connected to any single node (the maximal node-element graph degree). 6

7 pure function m a x n e l i s t d e g r e e ( nnodes, e n l i s t ) result ( max degree ) integer, intent ( in ) : : nnodes integer, dimension ( :, : ), intent ( in ) : : e n l i s t integer : : max degree nnodes V B. enlist l B E B array. Mesh B element-node graph. max degree Maximal mesh B node-element graph degree. interface q u a d t r e e i n t e r s e c t i o n f i n d e r module procedure q u a d t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s, & & q u a d t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y end interface q u a d t r e e i n t e r s e c t i o n f i n d e r subroutine q u a d t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab, max size ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab integer, optional, intent ( in ) : : max size positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. max size Maximum number of elements in a quadtree leaf node. subroutine q u a d t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr, max size ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr integer, optional, intent ( in ) : : max size positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A + 1. max size Maximum number of elements in a quadtree leaf node. 7

8 4.1.3 octree intersection finder An intersection finder for 3D meshes, based upon an octree data structure. See section for details regarding the optional max_size argument. interface o c t r e e i n t e r s e c t i o n f i n d e r module procedure o c t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s, & & o c t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y end interface o c t r e e i n t e r s e c t i o n f i n d e r subroutine o c t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab, max size ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab integer, optional, intent ( in ) : : max size positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. max size Maximum number of elements in an octree leaf node. subroutine o c t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr, max size ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr integer, optional, intent ( in ) : : max size positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A + 1. max size Maximum number of elements in an octree leaf node tree intersection finder An intersection finder for 2D and 3D meshes, which uses either the quadtree_intersection_finder (section 4.1.2) or octree_intersection_finder (section 4.1.3). 8

9 interface t r e e i n t e r s e c t i o n f i n d e r module procedure t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s, & & t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y end interface t r e e i n t e r s e c t i o n f i n d e r subroutine t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. subroutine t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A rtree intersection finder An intersection finder for 2D and 3D meshes, using a libspatialindex 5 R -tree [Guttman, 1984, Beckmann et al., 1990]. interface r t r e e i n t e r s e c t i o n f i n d e r module procedure r t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s, & & r t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y end interface r t r e e i n t e r s e c t i o n f i n d e r 5 9

10 subroutine r t r e e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. subroutine r t r e e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A advancing front intersection finder An intersection finder for meshes with simplicial or cubical elements, using the algorithm described in Farrell and Maddison [2011] [see also Gander and Japhet, 2009, 2013]. This intersection finder is primarily intended for the case where the meshes A and B cover the same domain. More generally, for correct output the input meshes must satisfy certain properties [Gander and Japhet, 2009]. Correct output is guaranteed if: 1. The first element in each connected sub-domain of mesh A intersects with at least one element of mesh B. 2. The elements of mesh B which intersect with any given element of mesh A define an element-element sub-graph of the mesh B element-element graph 6. All of these sub-graphs should be connected. interface a d v a n c i n g f r o n t i n t e r s e c t i o n f i n d e r module procedure a d v a n c i n g f r o n t i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s, & & a d v a n c i n g f r o n t i n t e r s e c t i o n f i n d e r c s r s p a r s i t y end interface a d v a n c i n g f r o n t i n t e r s e c t i o n f i n d e r 6 Here element-element graph edges are defined by elements sharing a common facet. 10

11 subroutine a d v a n c i n g f r o n t i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. subroutine a d v a n c i n g f r o n t i n t e r s e c t i o n f i n d e r c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A brute force intersection finder A basic brute force intersection finder with quadratic complexity. interface b r u t e f o r c e i n t e r s e c t i o n f i n d e r module procedure b r u t e f o r c e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s, & & b r u t e f o r c e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y end interface b r u t e f o r c e i n t e r s e c t i o n f i n d e r pure subroutine b r u t e f o r c e i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab 11

12 positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. pure subroutine b r u t e f o r c e i n t e r s e c t i o n f i n d e r c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A intersection finder An intersection finder for one, two, and three dimensional meshes. Uses the sort_intersection_finder (section 4.1.1) in the one dimensional case, and the rtree_intersection_finder (section 4.1.5) in the two and three dimensional cases. interface i n t e r s e c t i o n f i n d e r module procedure i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s, & & i n t e r s e c t i o n f i n d e r c s r s p a r s i t y end interface i n t e r s e c t i o n f i n d e r subroutine i n t e r s e c t i o n f i n d e r i n t e r s e c t i o n s ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, map ab ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b type ( i n t e r s e c t i o n s ), dimension ( : ), intent ( out ) : : map ab positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab Length E A vector. Candidate intersection element-element graph. 12

13 subroutine i n t e r s e c t i o n f i n d e r c s r s p a r s i t y ( & & p o s i t i o n s a, e n l i s t a, p o s i t i o n s b, e n l i s t b, & & map ab indices, map ab indptr ) real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s a integer, dimension ( :, : ), intent ( in ) : : e n l i s t a real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s b integer, dimension ( :, : ), intent ( in ) : : e n l i s t b integer, dimension ( : ), allocatable, intent ( out ) : : map ab indices integer, dimension ( : ), intent ( out ) : : map ab indptr positions a d V A array. Mesh A node coordinates. enlist a l A E A array. Mesh A element-node graph. positions b d V B array. Mesh B node coordinates. enlist b l B E B array. Mesh B element-node graph. map ab indices, map ab indptr CSR sparsity. Candidate intersection element-element graph. map_ab_indptr has length E A Identifying candidate intersections using queryable trees The following intersection finders use a given mesh B to construct a tree based structure which can be queried, one mesh A element at a time, for candidate intersecting elements quadtree type An intersection finder for 2D meshes, based upon a quadtree data structure (see section 4.1.2). Allocate a quadtree_type, which can later be queried for candidate intersecting elements. See section for details regarding the optional max_size argument. interface allocate module procedure a l l o c a t e q u a d t r e e end interface allocate subroutine a l l o c a t e q u a d t r e e ( quadtree, p o s i t i o n s, e n l i s t, max size ) type ( quadtree type ), intent ( out ) : : quadtree real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s integer, dimension ( :, : ), intent ( in ) : : e n l i s t integer, optional, intent ( in ) : : max size quadtree Quadtree data structure. positions d V B array. Mesh B node coordinates. enlist l B E B array. Mesh B element-node graph. max size Maximum number of elements in a quadtree leaf node. Query an allocated quadtree_type for candidate intersecting elements. interface query module procedure q u e r y q u a d t r e e a l l o c a t a b l e, q u e r y q u a d t r e e p o i n t e r end interface query 13

14 pure subroutine q u e r y q u a d t r e e a l l o c a t a b l e ( quadtree, element a, e l e s b ) type ( quadtree type ), intent ( inout ) : : quadtree real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), allocatable, intent ( out ) : : e l e s b pure subroutine q u e r y q u a d t r e e p o i n t e r ( quadtree, element a, e l e s b ) type ( quadtree type ), intent ( inout ) : : quadtree real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), pointer, intent ( out ) : : e l e s b quadtree Quadtree data structure. element a d l A array. Node coordinates of a mesh A element. eles b Elements of mesh B whose AABBs intersect with the AABB of the given mesh A element. Must be deallocated by the caller. Deallocate a quadtree_type. interface deallocate module procedure d e a l l o c a t e q u a d t r e e end interface deallocate pure elemental subroutine d e a l l o c a t e q u a d t r e e ( quadtree ) type ( quadtree type ), intent ( inout ) : : quadtree quadtree Quadtree data structure octree type An intersection finder for 3D meshes, based upon an octree data structure (see section 4.1.3). Allocate an octree_type, which can later be queried for candidate intersecting elements. See section for details regarding the optional max_size argument. interface allocate module procedure a l l o c a t e o c t r e e end interface allocate subroutine a l l o c a t e o c t r e e ( octree, p o s i t i o n s, e n l i s t, max size ) type ( o c t r e e t y p e ), intent ( out ) : : o c t r e e real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s integer, dimension ( :, : ), intent ( in ) : : e n l i s t integer, optional, intent ( in ) : : max size octree Octree data structure. positions d V B array. Mesh B node coordinates. enlist l B E B array. Mesh B element-node graph. max size Maximum number of elements in an octree leaf node. Query an allocated octree_type for candidate intersecting elements. 14

15 interface query module procedure q u e r y o c t r e e a l l o c a t a b l e, q u e r y o c t r e e p o i n t e r end interface query pure subroutine q u e r y o c t r e e a l l o c a t a b l e ( octree, element a, e l e s b ) type ( o c t r e e t y p e ), intent ( inout ) : : o c t r e e real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), allocatable, intent ( out ) : : e l e s b pure subroutine q u e r y o c t r e e p o i n t e r ( octree, element a, e l e s b ) type ( o c t r e e t y p e ), intent ( inout ) : : o c t r e e real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), pointer, intent ( out ) : : e l e s b octree Octree data structure. element a d l A array. Node coordinates of a mesh A element. eles b Elements of mesh B whose AABBs intersect with the AABB of the given mesh A element. Must be deallocated by the caller. Deallocate an octree_type. interface deallocate module procedure d e a l l o c a t e o c t r e e end interface deallocate pure elemental subroutine d e a l l o c a t e o c t r e e ( o c t r e e ) type ( o c t r e e t y p e ), intent ( inout ) : : o c t r e e octree Octree data structure tree type An intersection finder for 2D and 3D meshes, which uses either the quadtree_type (section 4.2.1) or octree_type (section 4.2.2). Allocate a tree_type, which can later be queried for candidate intersecting elements. interface allocate module procedure a l l o c a t e t r e e end interface allocate subroutine a l l o c a t e t r e e ( tree, p o s i t i o n s, e n l i s t ) type ( t r e e t y p e ), intent ( out ) : : t r e e real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s integer, dimension ( :, : ), intent ( in ) : : e n l i s t tree Quadtree or octree data structure. positions d V B array. Mesh B node coordinates. enlist l B E B array. Mesh B element-node graph. 15

16 Query an allocated tree_type for candidate intersecting elements. interface query module procedure q u e r y t r e e a l l o c a t a b l e, q u e r y t r e e p o i n t e r end interface query subroutine q u e r y t r e e a l l o c a t a b l e ( tree, element a, e l e s b ) type ( t r e e t y p e ), intent ( inout ) : : t r e e real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), allocatable, intent ( out ) : : e l e s b subroutine q u e r y t r e e p o i n t e r ( tree, element a, e l e s b ) type ( t r e e t y p e ), intent ( inout ) : : t r e e real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), pointer, intent ( out ) : : e l e s b tree Quadtree or octree data structure. element a d l A array. Node coordinates of a mesh A element. eles b Elements of mesh B whose AABBs intersect with the AABB of the given mesh A element. Must be deallocated by the caller. Deallocate a tree_type. interface deallocate module procedure d e a l l o c a t e t r e e end interface deallocate subroutine d e a l l o c a t e t r e e ( t r e e ) type ( t r e e t y p e ), intent ( inout ) : : t r e e tree Quadtree or octree data structure rtree type An intersection finder for 2D and 3D meshes, using a libspatialindex R -tree (see section 4.1.5). Allocate an rtree_type, which can later be queried for candidate intersecting elements. interface allocate module procedure a l l o c a t e r t r e e end interface allocate subroutine a l l o c a t e r t r e e ( r t r e e, p o s i t i o n s, e n l i s t ) type ( r t r e e t y p e ), intent ( out ) : : r t r e e real, dimension ( :, : ), intent ( in ) : : p o s i t i o n s integer, dimension ( :, : ), intent ( in ) : : e n l i s t rtree libspatialindex R -tree data structure. positions d V B array. Mesh B node coordinates. enlist l B E B array. Mesh B element-node graph. 16

17 Query an allocated rtree_type for candidate intersecting elements. interface query module procedure q u e r y r t r e e a l l o c a t a b l e, q u e r y r t r e e p o i n t e r end interface query subroutine q u e r y r t r e e a l l o c a t a b l e ( r t r e e, element a, e l e s b ) type ( r t r e e t y p e ), intent ( inout ) : : r t r e e real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), allocatable, intent ( out ) : : e l e s b subroutine q u e r y r t r e e p o i n t e r ( r t r e e, element a, e l e s b ) type ( r t r e e t y p e ), intent ( inout ) : : r t r e e real, dimension ( :, : ), intent ( in ) : : element a integer, dimension ( : ), pointer, intent ( out ) : : e l e s b rtree libspatialindex R -tree data structure. element a d l A array. Node coordinates of a mesh A element. eles b Elements of mesh B whose AABBs intersect with the AABB of the given mesh A element. Must be deallocated by the caller. Deallocate an rtree_type. interface deallocate module procedure d e a l l o c a t e r t r e e end interface deallocate subroutine d e a l l o c a t e r t r e e ( r t r e e ) type ( r t r e e t y p e ), intent ( inout ) : : r t r e e rtree libspatialindex R -tree data structure. 5 Element intersection Given two elements, element A from mesh A and element B from mesh B, the following routines are used to construct a simplicial mesh C, which is a mesh of their intersection (the local supermesh ). The following definitions are used: d Mesh A defines a subset Ω A R d, and mesh B a subset Ω B R d. l Number of nodes in an element. l A Number of nodes in element A from mesh A. l B Number of nodes in element B from mesh B. F A F B Number of element A facets. Number of element B facets. l C Number of nodes per element in the intersection mesh C, always equal to d + 1. E C Number of elements in the intersection mesh C. M C An upper bound for the maximum number of elements which can be in any intersection mesh C. 17

18 5.1 One dimension Definition of M C. integer, parameter : : i n t e r v a l b u f s i z e = 1 Interval intersection. interface i n t e r s e c t i n t e r v a l s module procedure i n t e r s e c t i n t e r v a l s r a n k 1, i n t e r s e c t i n t e r v a l s r a n k 2, & & i n t e r s e c t i n t e r v a l s r a n k 3 end interface i n t e r s e c t i n t e r v a l s pure subroutine i n t e r s e c t i n t e r v a l s r a n k 1 ( i n t e r v a l a, i n t e r v a l b, & & i n t e r v a l s c, n i n t e r v a l s c ) real, dimension ( 2 ), intent ( in ) : : i n t e r v a l a real, dimension ( 2 ), intent ( in ) : : i n t e r v a l b real, dimension ( 2 ), intent ( out ) : : i n t e r v a l s c integer, intent ( out ) : : n i n t e r v a l s c interval a Length 2 vector. Element A node coordinates. interval b Length 2 vector. Element B node coordinates. interval c Length 2 vector. Intersection mesh C node coordinates. n intervals c Number of elements in mesh C. Equal to 1 if elements A and B intersect, and 0 otherwise. pure subroutine i n t e r s e c t i n t e r v a l s r a n k 2 ( i n t e r v a l a, i n t e r v a l b, & & i n t e r v a l s c, n i n t e r v a l s c ) real, dimension ( 2 ), intent ( in ) : : i n t e r v a l a real, dimension ( 2 ), intent ( in ) : : i n t e r v a l b real, dimension ( 2, i n t e r v a l b u f s i z e ), intent ( out ) : : i n t e r v a l s c integer, intent ( out ) : : n i n t e r v a l s c interval a Length 2 vector. Element A node coordinates. interval b Length 2 vector. Element B node coordinates. interval c 2 M C array. Intersection mesh C node coordinates. M C = 1. n intervals c Number of elements in mesh C. Equal to 1 if elements A and B intersect, and 0 otherwise. pure subroutine i n t e r s e c t i n t e r v a l s r a n k 3 ( i n t e r v a l a, i n t e r v a l b, & & i n t e r v a l s c, n i n t e r v a l s c ) real, dimension ( 1, 2 ), intent ( in ) : : i n t e r v a l a real, dimension ( 1, 2 ), intent ( in ) : : i n t e r v a l b real, dimension ( 1, 2, i n t e r v a l b u f s i z e ), intent ( out ) : : i n t e r v a l s c integer, intent ( out ) : : n i n t e r v a l s c interval a 1 2 array. Element A node coordinates. interval b 1 2 vector. Element B node coordinates. interval c 1 2 M C array. Intersection mesh C node coordinates. M C = 1. n intervals c Number of elements in mesh C. Equal to 1 if elements A and B intersect, and 0 otherwise. 18

19 Interval length. interface i n t e r v a l s i z e module procedure i n t e r v a l s i z e r a n k 1, i n t e r v a l s i z e r a n k 2 end interface i n t e r v a l s i z e pure function i n t e r v a l s i z e r a n k 1 ( i n t e r v a l ) result ( size ) real, dimension ( 2 ), intent ( in ) : : i n t e r v a l real : : size interval Length 2 vector. Element node coordinates. size Length of the element. pure function i n t e r v a l s i z e r a n k 2 ( i n t e r v a l ) result ( size ) real, dimension ( 1, 2 ), intent ( in ) : : i n t e r v a l real : : size interval 1 2 array. Element node coordinates. size Length of the element. 5.2 Two dimensions Intersection of two-dimensional polygons using the Sutherland and Hodgman [1974] algorithm. triangle_type data type, used to define triangles. type t r i t y p e real, dimension ( 2, 3) : : v end type t r i t y p e v d l array. Triangle node coordinates. line_type data type, used to define the lines which constitute the half-spaces defined by element facets. type l i n e t y p e real, dimension ( 2 ) : : normal real, dimension ( 2 ) : : point end type l i n e t y p e normal Length d vector. Components of an outward pointing facet normal. Need not have unit norm. point Length d vector. Coordinates of a point on the line defining the half-space. Definition of M C for triangle-triangle intersection. integer, parameter : : t r i b u f s i z e = 22 Definition of M C for triangle-polygon intersection. interface m a x n t r i s c module procedure m a x n t r i s c t r i end interface m a x n t r i s c 19

20 pure elemental function m a x n t r i s c t r i ( n l i n e s b ) result ( m a x n t r i s c ) integer, intent ( in ) : : n l i n e s b integer : : m a x n t r i s c n lines b F B, assuming that element A is a triangle. max n tris c M C = 3 ( 2 F B) 2. Definition of M C for polygon-polygon intersection. interface m a x n t r i s c module procedure m a x n t r i s c p o l y end interface m a x n t r i s c pure elemental function m a x n t r i s c p o l y ( n l i n e s a, n l i n e s b ) result ( m a x n t r i s c ) integer, intent ( in ) : : n l i n e s a integer, intent ( in ) : : n l i n e s b integer : : m a x n t r i s c n lines a F A. n lines b F B. max n tris c M C = F A ( 2 F B ) 2. Obtain a line_type representation of the half-spaces defined by facets. interface g e t l i n e s module procedure g e t l i n e s t r i, g e t l i n e s p o l y end interface g e t l i n e s pure function g e t l i n e s t r i ( t r i ) result ( l i n e s ) type ( t r i t y p e ), intent ( in ) : : t r i type ( l i n e t y p e ), dimension ( 3 ) : : l i n e s tri A triangle. lines The three half-spaces. pure function g e t l i n e s p o l y ( poly ) result ( l i n e s ) real, dimension ( :, : ), intent ( in ) : : poly type ( l i n e t y p e ), dimension ( size ( poly, 2 ) ) : : l i n e s poly d l array. Coordinates of the polygon nodes, in either clockwise or anti-clockwise order. The first three nodes must not be co-linear. lines Length l array. The half-spaces defined by the facets of the polygon. Triangle-triangle intersection. interface i n t e r s e c t t r i s module procedure i n t e r s e c t t r i s r e a l, i n t e r s e c t t r i s t r i end interface i n t e r s e c t t r i s 20

21 subroutine i n t e r s e c t t r i s r e a l ( t r i a, t r i b, t r i s c, n t r i s c ) real, dimension ( 2, 3 ), intent ( in ) : : t r i a real, dimension ( 2, 3 ), intent ( in ) : : t r i b real, dimension ( 2, 3, t r i b u f s i z e ), intent ( out ) : : t r i s c integer, intent ( out ) : : n t r i s c tri a d l A array. Element A node coordinates. Element A must be a triangle. tri b d l B array. Element B node coordinates. Element B must be a triangle. tris c d l C M C array. Mesh C node coordinates. M C = 22. n tris c E C. subroutine i n t e r s e c t t r i s t r i ( t r i a, t r i b, t r i s c, n t r i s c ) type ( t r i t y p e ), intent ( in ) : : t r i a type ( t r i t y p e ), intent ( in ) : : t r i b type ( t r i t y p e ), dimension ( t r i b u f s i z e ), intent ( out ) : : t r i s c integer, intent ( out ) : : n t r i s c tri a Element A. tri b Element B. tris c Length M C vector. Triangles in mesh C. M C = 22. n tris c E C. Triangle-quadrilateral intersection. subroutine i n t e r s e c t t r i q u a d ( t r i a, quad b, t r i s c, n t r i s c ) real, dimension ( :, : ), intent ( in ) : : t r i a real, dimension ( :, : ), intent ( in ) : : quad b real, dimension ( :, :, : ), intent ( inout ) : : t r i s c integer, intent ( out ) : : n t r i s c tri a d l A array. Element A node coordinates. Element A must be a triangle. quad b d l B array. Element B node coordinates. Element B must be a convex quadrilateral with the node coordinates in either clockwise or anti-clockwise order, and the first three nodes must not be co-linear. tris c d l C M C array. Mesh C node coordinates. M C = 46. n tris c E C. Quadrilateral-quadrilateral intersection. subroutine i n t e r s e c t q u a d s ( quad a, quad b, t r i s c, n t r i s c ) real, dimension ( :, : ), intent ( in ) : : quad a real, dimension ( :, : ), intent ( in ) : : quad b real, dimension ( :, :, : ), intent ( inout ) : : t r i s c integer, intent ( out ) : : n t r i s c quad a d l A array. Element A node coordinates. Element A must be a quadrilateral with the node coordinates in either clockwise or anti-clockwise order. quad b d l B array. Element B node coordinates. Element B must be a convex quadrilateral with the node coordinates in either clockwise or anti-clockwise order, and the first three nodes must not be co-linear. The intersection of elements A and B must be a convex polygon. 21

22 tris c d l C M C array. Mesh C node coordinates. M C = 62. n tris c E C. Triangle-polygon intersection. interface i n t e r s e c t p o l y s module procedure i n t e r s e c t t r i l i n e s end interface i n t e r s e c t p o l y s pure subroutine i n t e r s e c t t r i l i n e s ( t r i a, l i n e s b, t r i s c, n t r i s c, area b, work ) type ( t r i t y p e ), intent ( in ) : : t r i a type ( l i n e t y p e ), dimension ( : ), intent ( in ) : : l i n e s b type ( t r i t y p e ), dimension ( : ), intent ( out ) : : t r i s c integer, intent ( out ) : : n t r i s c real, optional, intent ( in ) : : area b real, dimension ( :, :, : ), target, optional, intent ( out ) : : work tri a Element A. lines b Element B facet half-spaces. Element B must be a convex polygon. tris c Length M C vector. Triangles in mesh C. n tris c E C. area b Area of element B. Used to discard near-degenerate elements in mesh C. work 2 M C 2 array. Working memory. Polygon-polygon intersection. interface i n t e r s e c t p o l y s module procedure i n t e r s e c t p o l y s r e a l, i n t e r s e c t p o l y s l i n e s end interface i n t e r s e c t p o l y s pure subroutine i n t e r s e c t p o l y s r e a l ( poly a, poly b, t r i s c, n t r i s c, & & area a, area b, work ) real, dimension ( :, : ), intent ( in ) : : poly a real, dimension ( :, : ), intent ( in ) : : poly b type ( t r i t y p e ), dimension ( : ), intent ( out ) : : t r i s c integer, intent ( out ) : : n t r i s c real, optional, intent ( in ) : : a r e a a real, optional, intent ( in ) : : area b real, dimension ( :, :, : ), target, optional, intent ( out ) : : work poly a d l A array. Element A node coordinates. The node coordinates must be in either clockwise or anti-clockwise order. poly b d l B array. Element B node coordinates. The node coordinates must be in either clockwise or anti-clockwise order, the first three nodes must not be co-linear, and the element must be a convex polygon. The intersection of elements A and B must be a convex polygon. tris c Length M C vector. Triangles in mesh C. n tris c E C. area a Area of element A. Used to discard near-degenerate elements in mesh C. area b Area of element B. Used to discard near-degenerate elements in mesh C. work 2 M C 2 array. Working memory. 22

23 pure subroutine i n t e r s e c t p o l y s l i n e s ( poly a, l i n e s b, t r i s c, n t r i s c, & & area a, area b, work ) real, dimension ( :, : ), intent ( in ) : : poly a type ( l i n e t y p e ), dimension ( : ), intent ( in ) : : l i n e s b type ( t r i t y p e ), dimension ( : ), intent ( out ) : : t r i s c integer, intent ( out ) : : n t r i s c real, optional, intent ( in ) : : a r e a a real, optional, intent ( in ) : : area b real, dimension ( :, :, : ), target, optional, intent ( out ) : : work poly a d l A array. Element A node coordinates. The node coordinates must be in either clockwise or anti-clockwise order. lines b d l B array. Element B facet half-spaces. Element B must be a convex polygon. The intersection of elements A and B must be a convex polygon. tris c Length M C vector. Triangles in mesh C. n tris c E C. area a Area of element A. Used to discard near-degenerate elements in mesh C. area b Area of element B. Used to discard near-degenerate elements in mesh C. work 2 M C 2 array. Working memory. Triangle area. interface t r i a n g l e a r e a module procedure t r i a n g l e a r e a r e a l, t r i a n g l e a r e a t r i end interface t r i a n g l e a r e a pure function t r i a n g l e a r e a r e a l ( t r i ) result ( area ) real, dimension ( 2, 3 ), intent ( in ) : : t r i real : : area tri d l array. Triangle node coordinates. area Area of the triangle. pure elemental function t r i a n g l e a r e a t r i ( t r i ) result ( area ) type ( t r i t y p e ), intent ( in ) : : t r i real : : area tri A triangle. area Area of the triangle. 5.3 Three dimensions Intersection of three-dimensional convex polyhedra using the plane-at-a-time clipping algorithm described in Eberly [2007] (section 2.4.3). tet_type data type, used to define tetrahedra. type t e t t y p e real, dimension ( 3, 4) : : v integer, dimension ( 4 ) : : c o l o u r s = 1 end type t e t t y p e 23

CS1802 Week 11: Algorithms, Sums, Series, Induction

CS1802 Week 11: Algorithms, Sums, Series, Induction CS180 Discrete Structures Recitation Fall 017 Nov 11 - November 17, 017 CS180 Week 11: Algorithms, Sums, Series, Induction 1 Markov chain i. Boston has days which are either sunny or rainy and can be modeled

More information

Numerical differentiation

Numerical differentiation Chapter 3 Numerical differentiation 3.1 Introduction Numerical integration and differentiation are some of the most frequently needed methods in computational physics. Quite often we are confronted with

More information

Advanced parallel Fortran

Advanced parallel Fortran 1/44 Advanced parallel Fortran A. Shterenlikht Mech Eng Dept, The University of Bristol Bristol BS8 1TR, UK, Email: mexas@bristol.ac.uk coarrays.sf.net 12th November 2017 2/44 Fortran 2003 i n t e g e

More information

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes )

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes ) CSE613: Parallel Programming, Spring 2012 Date: May 11 Final Exam ( 11:15 AM 1:45 PM : 150 Minutes ) This exam will account for either 10% or 20% of your overall grade depending on your relative performance

More information

pyoptfem Documentation

pyoptfem Documentation pyoptfem Documentation Release V0.0.6 F. Cuvelier November 09, 2013 CONTENTS 1 Presentation 3 1.1 Classical assembly algorithm (base version).............................. 6 1.2 Sparse matrix requirement........................................

More information

Auto-Tuning Complex Array Layouts for GPUs - Supplemental Material

Auto-Tuning Complex Array Layouts for GPUs - Supplemental Material BIN COUNT EGPGV,. This is the author version of the work. It is posted here by permission of Eurographics for your personal use. Not for redistribution. The definitive version is available at http://diglib.eg.org/.

More information

5 Spatial Access Methods

5 Spatial Access Methods 5 Spatial Access Methods 5.1 Quadtree 5.2 R-tree 5.3 K-d tree 5.4 BSP tree 3 27 A 17 5 G E 4 7 13 28 B 26 11 J 29 18 K 5.5 Grid file 9 31 8 17 24 28 5.6 Summary D C 21 22 F 15 23 H Spatial Databases and

More information

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations Sparse Linear Systems Iterative Methods for Sparse Linear Systems Matrix Computations and Applications, Lecture C11 Fredrik Bengzon, Robert Söderlund We consider the problem of solving the linear system

More information

Module 10.1: nag polynom eqn Roots of Polynomials. Contents

Module 10.1: nag polynom eqn Roots of Polynomials. Contents Nonlinear Equations Module Contents Module 10.1: nag polynom eqn Roots of Polynomials nag polynom eqn provides a procedure for computing the roots of a polynomial with real or complex coefficients. Contents

More information

Adaptive Spike-Based Solver 1.0 User Guide

Adaptive Spike-Based Solver 1.0 User Guide Intel r Adaptive Spike-Based Solver 10 User Guide I V 1 W 2 I V 2 W 3 I V 3 W 4 I 1 Contents 1 Overview 4 11 A Quick What, Why, and How 4 12 A Hello World Example 7 13 Future Developments 8 14 User Guide

More information

A simple FEM solver and its data parallelism

A simple FEM solver and its data parallelism A simple FEM solver and its data parallelism Gundolf Haase Institute for Mathematics and Scientific Computing University of Graz, Austria Chile, Jan. 2015 Partial differential equation Considered Problem

More information

CPSC 320 (Intermediate Algorithm Design and Analysis). Summer Instructor: Dr. Lior Malka Final Examination, July 24th, 2009

CPSC 320 (Intermediate Algorithm Design and Analysis). Summer Instructor: Dr. Lior Malka Final Examination, July 24th, 2009 CPSC 320 (Intermediate Algorithm Design and Analysis). Summer 2009. Instructor: Dr. Lior Malka Final Examination, July 24th, 2009 Student ID: INSTRUCTIONS: There are 6 questions printed on pages 1 7. Exam

More information

Faster quantum algorithm for evaluating game trees

Faster quantum algorithm for evaluating game trees Faster quantum algorithm for evaluating game trees x 7 x 8 Ben Reichardt xx1 1 x 2 x 3 x 4 x 6 OR x 9 x1 1 x 5 x 9 University of Waterloo x 5 AND OR AND AND OR AND ϕ(x) x 7 x 8 x 1 x 2 x 3 x 4 x 6 OR x

More information

Parallelization of the QC-lib Quantum Computer Simulator Library

Parallelization of the QC-lib Quantum Computer Simulator Library Parallelization of the QC-lib Quantum Computer Simulator Library Ian Glendinning and Bernhard Ömer September 9, 23 PPAM 23 1 Ian Glendinning / September 9, 23 Outline Introduction Quantum Bits, Registers

More information

Algorithmic Approach to Counting of Certain Types m-ary Partitions

Algorithmic Approach to Counting of Certain Types m-ary Partitions Algorithmic Approach to Counting of Certain Types m-ary Partitions Valentin P. Bakoev Abstract Partitions of integers of the type m n as a sum of powers of m (the so called m-ary partitions) and their

More information

Conquest order N ab initio Electronic Structure simulation code for quantum mechanical modelling in large scale

Conquest order N ab initio Electronic Structure simulation code for quantum mechanical modelling in large scale Fortran Expo: 15 Jun 2012 Conquest order N ab initio Electronic Structure simulation code for quantum mechanical modelling in large scale Lianheng Tong Overview Overview of Conquest project Brief Introduction

More information

5 Spatial Access Methods

5 Spatial Access Methods 5 Spatial Access Methods 5.1 Quadtree 5.2 R-tree 5.3 K-d tree 5.4 BSP tree 3 27 A 17 5 G E 4 7 13 28 B 26 11 J 29 18 K 5.5 Grid file 9 31 8 17 24 28 5.6 Summary D C 21 22 F 15 23 H Spatial Databases and

More information

Wolf-Tilo Balke Silviu Homoceanu Institut für Informationssysteme Technische Universität Braunschweig

Wolf-Tilo Balke Silviu Homoceanu Institut für Informationssysteme Technische Universität Braunschweig Multimedia Databases Wolf-Tilo Balke Silviu Homoceanu Institut für Informationssysteme Technische Universität Braunschweig http://www.ifis.cs.tu-bs.de 13 Indexes for Multimedia Data 13 Indexes for Multimedia

More information

GAME PHYSICS SECOND EDITION. дяййтаййг 1 *

GAME PHYSICS SECOND EDITION. дяййтаййг 1 * GAME PHYSICS SECOND EDITION DAVID H. EBERLY дяййтаййг 1 * К AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO MORGAN ELSEVIER Morgan Kaufmann Publishers

More information

The Discontinuous Galerkin Finite Element Method

The Discontinuous Galerkin Finite Element Method The Discontinuous Galerkin Finite Element Method Michael A. Saum msaum@math.utk.edu Department of Mathematics University of Tennessee, Knoxville The Discontinuous Galerkin Finite Element Method p.1/41

More information

arxiv:physics/ v2 [physics.atom-ph] 31 May 2004

arxiv:physics/ v2 [physics.atom-ph] 31 May 2004 arxiv:physics/0405136v2 [physics.atom-ph] 31 May 2004 Pure spin angular momentum coefficients for non scalar one particle operators in jj coupling G. Gaigalas a and S. Fritzsche b a Institute of Theoretical

More information

Poisson Solvers. William McLean. April 21, Return to Math3301/Math5315 Common Material.

Poisson Solvers. William McLean. April 21, Return to Math3301/Math5315 Common Material. Poisson Solvers William McLean April 21, 2004 Return to Math3301/Math5315 Common Material 1 Introduction Many problems in applied mathematics lead to a partial differential equation of the form a 2 u +

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms Computer Science & Engineering 423/823 Design and Analysis of s Lecture 09 Dynamic Programming (Chapter 15) Stephen Scott (Adapted from Vinodchandran N. Variyam) 1 / 41 Spring 2010 Dynamic programming

More information

Limitations of Algorithm Power

Limitations of Algorithm Power Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 03 Dynamic Programming (Chapter 15) Stephen Scott and Vinodchandran N. Variyam sscott@cse.unl.edu 1/44 Introduction Dynamic

More information

2. Polynomial interpolation

2. Polynomial interpolation 2. Polynomial interpolation Contents 2. POLYNOMIAL INTERPOLATION... 1 2.1 TYPES OF INTERPOLATION... 1 2.2 LAGRANGE ONE-DIMENSIONAL INTERPOLATION... 2 2.3 NATURAL COORDINATES*... 15 2.4 HERMITE ONE-DIMENSIONAL

More information

Advances in Bayesian Network Learning using Integer Programming

Advances in Bayesian Network Learning using Integer Programming Advances in Bayesian Network Learning using Integer Programming Mark Bartlett and James Cussens UAI-13, 2013-07-12 Supported by the UK Medical Research Council (Project Grant G1002312) Mark Bartlett and

More information

Multimedia Databases 1/29/ Indexes for Multimedia Data Indexes for Multimedia Data Indexes for Multimedia Data

Multimedia Databases 1/29/ Indexes for Multimedia Data Indexes for Multimedia Data Indexes for Multimedia Data 1/29/2010 13 Indexes for Multimedia Data 13 Indexes for Multimedia Data 13.1 R-Trees Multimedia Databases Wolf-Tilo Balke Silviu Homoceanu Institut für Informationssysteme Technische Universität Braunschweig

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 9 Divide and Conquer Merge sort Counting Inversions Binary Search Exponentiation Solving Recurrences Recursion Tree Method Master Theorem Sofya Raskhodnikova S. Raskhodnikova;

More information

Module 5.2: nag sym lin sys Symmetric Systems of Linear Equations. Contents

Module 5.2: nag sym lin sys Symmetric Systems of Linear Equations. Contents Linear Equations Module Contents Module 5.2: nag sym lin sys Symmetric Systems of Linear Equations nag sym lin sys provides a procedure for solving real or complex, symmetric or Hermitian systems of linear

More information

ECS289: Scalable Machine Learning

ECS289: Scalable Machine Learning ECS289: Scalable Machine Learning Cho-Jui Hsieh UC Davis Sept 27, 2015 Outline Linear regression Ridge regression and Lasso Time complexity (closed form solution) Iterative Solvers Regression Input: training

More information

An Introduction to Z3

An Introduction to Z3 An Introduction to Z3 Huixing Fang National Trusted Embedded Software Engineering Technology Research Center April 12, 2017 Outline 1 SMT 2 Z3 Huixing Fang (ECNU) An Introduction to Z3 April 12, 2017 2

More information

MATHEMATICAL OBJECTS in

MATHEMATICAL OBJECTS in MATHEMATICAL OBJECTS in Computational Tools in a Unified Object-Oriented Approach Yair Shapira @ CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis

More information

CVXOPT Documentation. Release 1.2. Martin S. Andersen, Joachim Dahl, and Lieven Vandenberghe

CVXOPT Documentation. Release 1.2. Martin S. Andersen, Joachim Dahl, and Lieven Vandenberghe CVXOPT Documentation Release 1.2 Martin S. Andersen, Joachim Dahl, and Lieven Vandenberghe April 17, 2018 Contents 1 Copyright and License 3 2 Introduction 5 3 Dense and Sparse Matrices 7 3.1 Dense Matrices..............................................

More information

Department of Chemical Engineering University of California, Santa Barbara Spring Exercise 2. Due: Thursday, 4/19/09

Department of Chemical Engineering University of California, Santa Barbara Spring Exercise 2. Due: Thursday, 4/19/09 Department of Chemical Engineering ChE 210D University of California, Santa Barbara Spring 2012 Exercise 2 Due: Thursday, 4/19/09 Objective: To learn how to compile Fortran libraries for Python, and to

More information

Parallel Transposition of Sparse Data Structures

Parallel Transposition of Sparse Data Structures Parallel Transposition of Sparse Data Structures Hao Wang, Weifeng Liu, Kaixi Hou, Wu-chun Feng Department of Computer Science, Virginia Tech Niels Bohr Institute, University of Copenhagen Scientific Computing

More information

Anatomy of SINGULAR talk at p. 1

Anatomy of SINGULAR talk at p. 1 Anatomy of SINGULAR talk at MaGiX@LIX 2011- p. 1 Anatomy of SINGULAR talk at MaGiX@LIX 2011 - Hans Schönemann hannes@mathematik.uni-kl.de Department of Mathematics University of Kaiserslautern Anatomy

More information

On an Approximation Result for Piecewise Polynomial Functions. O. Karakashian

On an Approximation Result for Piecewise Polynomial Functions. O. Karakashian BULLETIN OF THE GREE MATHEMATICAL SOCIETY Volume 57, 010 (1 7) On an Approximation Result for Piecewise Polynomial Functions O. arakashian Abstract We provide a new approach for proving approximation results

More information

Automatic Differentiation Algorithms and Data Structures. Chen Fang PhD Candidate Joined: January 2013 FuRSST Inaugural Annual Meeting May 8 th, 2014

Automatic Differentiation Algorithms and Data Structures. Chen Fang PhD Candidate Joined: January 2013 FuRSST Inaugural Annual Meeting May 8 th, 2014 Automatic Differentiation Algorithms and Data Structures Chen Fang PhD Candidate Joined: January 2013 FuRSST Inaugural Annual Meeting May 8 th, 2014 1 About 2 3 of the code for physics in simulators computes

More information

Logic and Discrete Mathematics. Section 6.7 Recurrence Relations and Their Solution

Logic and Discrete Mathematics. Section 6.7 Recurrence Relations and Their Solution Logic and Discrete Mathematics Section 6.7 Recurrence Relations and Their Solution Slides version: January 2015 Definition A recurrence relation for a sequence a 0, a 1, a 2,... is a formula giving a n

More information

1 Approximate Quantiles and Summaries

1 Approximate Quantiles and Summaries CS 598CSC: Algorithms for Big Data Lecture date: Sept 25, 2014 Instructor: Chandra Chekuri Scribe: Chandra Chekuri Suppose we have a stream a 1, a 2,..., a n of objects from an ordered universe. For simplicity

More information

Applied Cartography and Introduction to GIS GEOG 2017 EL. Lecture-2 Chapters 3 and 4

Applied Cartography and Introduction to GIS GEOG 2017 EL. Lecture-2 Chapters 3 and 4 Applied Cartography and Introduction to GIS GEOG 2017 EL Lecture-2 Chapters 3 and 4 Vector Data Modeling To prepare spatial data for computer processing: Use x,y coordinates to represent spatial features

More information

import java. u t i l. ;... Scanner sc = new Scanner ( System. in ) ;

import java. u t i l. ;... Scanner sc = new Scanner ( System. in ) ; CPSC 490 Input Input will always arrive on stdin. You may assume input is well-formed with respect to the problem specification; inappropriate input (e.g. text where a number was specified, number out

More information

Mathangi Thiagarajan Rice Genome Annotation Workshop May 23rd, 2007

Mathangi Thiagarajan Rice Genome Annotation Workshop May 23rd, 2007 -2 Transcript Alignment Assembly and Automated Gene Structure Improvements Using PASA-2 Mathangi Thiagarajan mathangi@jcvi.org Rice Genome Annotation Workshop May 23rd, 2007 About PASA PASA is an open

More information

Chapter 4. Two-Dimensional Finite Element Analysis

Chapter 4. Two-Dimensional Finite Element Analysis Chapter 4. Two-Dimensional Finite Element Analysis general two-dimensional boundary-value problems 4.1 The Boundary-Value Problem 2nd-order differential equation to consider α α β φ Ω (4.1) Laplace, Poisson

More information

ECE521 W17 Tutorial 1. Renjie Liao & Min Bai

ECE521 W17 Tutorial 1. Renjie Liao & Min Bai ECE521 W17 Tutorial 1 Renjie Liao & Min Bai Schedule Linear Algebra Review Matrices, vectors Basic operations Introduction to TensorFlow NumPy Computational Graphs Basic Examples Linear Algebra Review

More information

arxiv: v4 [cs.cg] 31 Mar 2018

arxiv: v4 [cs.cg] 31 Mar 2018 New bounds for range closest-pair problems Jie Xue Yuan Li Saladi Rahul Ravi Janardan arxiv:1712.9749v4 [cs.cg] 31 Mar 218 Abstract Given a dataset S of points in R 2, the range closest-pair (RCP) problem

More information

Excel for Scientists and Engineers Numerical Method s. E. Joseph Billo

Excel for Scientists and Engineers Numerical Method s. E. Joseph Billo Excel for Scientists and Engineers Numerical Method s E. Joseph Billo Detailed Table of Contents Preface Acknowledgments About the Author Chapter 1 Introducing Visual Basic for Applications 1 Chapter

More information

Integer Programming for Bayesian Network Structure Learning

Integer Programming for Bayesian Network Structure Learning Integer Programming for Bayesian Network Structure Learning James Cussens Prague, 2013-09-02 Supported by the UK Medical Research Council (Project Grant G1002312) James Cussens IP for BNs Prague, 2013-09-02

More information

4th year Project demo presentation

4th year Project demo presentation 4th year Project demo presentation Colm Ó héigeartaigh CASE4-99387212 coheig-case4@computing.dcu.ie 4th year Project demo presentation p. 1/23 Table of Contents An Introduction to Quantum Computing The

More information

Finite Elements. Colin Cotter. January 15, Colin Cotter FEM

Finite Elements. Colin Cotter. January 15, Colin Cotter FEM Finite Elements January 15, 2018 Why Can solve PDEs on complicated domains. Have flexibility to increase order of accuracy and match the numerics to the physics. has an elegant mathematical formulation

More information

Presentation of XLIFE++

Presentation of XLIFE++ Presentation of XLIFE++ Eigenvalues Solver & OpenMP Manh-Ha NGUYEN Unité de Mathématiques Appliquées, ENSTA - Paristech 25 Juin 2014 Ha. NGUYEN Presentation of XLIFE++ 25 Juin 2014 1/19 EigenSolver 1 EigenSolver

More information

Shortest paths with negative lengths

Shortest paths with negative lengths Chapter 8 Shortest paths with negative lengths In this chapter we give a linear-space, nearly linear-time algorithm that, given a directed planar graph G with real positive and negative lengths, but no

More information

SPATIAL INDEXING. Vaibhav Bajpai

SPATIAL INDEXING. Vaibhav Bajpai SPATIAL INDEXING Vaibhav Bajpai Contents Overview Problem with B+ Trees in Spatial Domain Requirements from a Spatial Indexing Structure Approaches SQL/MM Standard Current Issues Overview What is a Spatial

More information

FPGA Resource Utilization Estimates for NI crio LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008

FPGA Resource Utilization Estimates for NI crio LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 FPGA Resource Utilization Estimates for NI crio-9104 LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 Note: The numbers presented in this document are estimates. Actual resource usage for your

More information

On Approximating Minimum 3-connected m-dominating Set Problem in Unit Disk Graph

On Approximating Minimum 3-connected m-dominating Set Problem in Unit Disk Graph 1 On Approximating Minimum 3-connected m-dominating Set Problem in Unit Disk Graph Bei Liu, Wei Wang, Donghyun Kim, Senior Member, IEEE, Deying Li, Jingyi Wang, Alade O. Tokuta, Member, IEEE, Yaolin Jiang

More information

Debugging and Testing with ScalaCheck

Debugging and Testing with ScalaCheck Debugging and Testing with ScalaCheck Martina Seidl December 11, 2012 1 / 24 Some Words on Scala Scala is object-oriented. every value is an object classes and traits: types and behavior of objects inheritance

More information

Computing Real Roots of Real Polynomials

Computing Real Roots of Real Polynomials Computing Real Roots of Real Polynomials and now For Real! Alexander Kobel Max-Planck-Institute for Informatics, Saarbrücken, Germany Fabrice Rouillier INRIA & Université Pierre et Marie Curie, Paris,

More information

3. Numerical integration

3. Numerical integration 3. Numerical integration... 3. One-dimensional quadratures... 3. Two- and three-dimensional quadratures... 3.3 Exact Integrals for Straight Sided Triangles... 5 3.4 Reduced and Selected Integration...

More information

NAG Fortran Library Routine Document F04CFF.1

NAG Fortran Library Routine Document F04CFF.1 F04 Simultaneous Linear Equations NAG Fortran Library Routine Document Note: before using this routine, please read the Users Note for your implementation to check the interpretation of bold italicised

More information

Freezing Method with Comsol Multiphysics

Freezing Method with Comsol Multiphysics Freezing Method with Comsol Multiphysics Nagumo Equation: Traveling 1-front Denny Otten 1 Department of Mathematics Bielefeld University 33501 Bielefeld Germany Date: 26. Oktober 2015 1. Freezing Traveling

More information

What s New in Isorropia?

What s New in Isorropia? What s New in Isorropia? Erik Boman Cedric Chevalier, Lee Ann Riesen Sandia National Laboratories, NM, USA Trilinos User s Group, Nov 4-5, 2009. SAND 2009-7611P. Sandia is a multiprogram laboratory operated

More information

Universität Augsburg

Universität Augsburg Universität Augsburg Properties of Overwriting for Updates in Typed Kleene Algebras Thorsten Ehm Report 2000-7 Dezember 2000 Institut für Informatik D-86135 Augsburg Copyright c Thorsten Ehm Institut für

More information

Symmetric Constrained Optimal Control: Theory, Algorithms, and Applications. Claus Robert Danielson

Symmetric Constrained Optimal Control: Theory, Algorithms, and Applications. Claus Robert Danielson Symmetric Constrained Optimal Control: Theory, Algorithms, and Applications by Claus Robert Danielson A dissertation submitted in partial satisfaction of the requirements for the degree of Doctor of Philosophy

More information

C:\Users\Leonardo\Desktop\README_ELMO_NOTES.txt Montag, 7. Juli :48

C:\Users\Leonardo\Desktop\README_ELMO_NOTES.txt Montag, 7. Juli :48 *********** * Input * *********** Besides the normal GAMESS-UK input directives, to perform an ELMO calculation one needs to specify the elmo keyword and to provide additional instructions that are contained

More information

Optimization of Quadratic Forms: NP Hard Problems : Neural Networks

Optimization of Quadratic Forms: NP Hard Problems : Neural Networks 1 Optimization of Quadratic Forms: NP Hard Problems : Neural Networks Garimella Rama Murthy, Associate Professor, International Institute of Information Technology, Gachibowli, HYDERABAD, AP, INDIA ABSTRACT

More information

NAG Library Routine Document F08FAF (DSYEV)

NAG Library Routine Document F08FAF (DSYEV) NAG Library Routine Document (DSYEV) Note: before using this routine, please read the Users Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent

More information

Optimisation and Operations Research

Optimisation and Operations Research Optimisation and Operations Research Lecture 15: The Greedy Heuristic Matthew Roughan http://www.maths.adelaide.edu.au/matthew.roughan/ Lecture_notes/OORII/ School of

More information

Conjugate-Gradient. Learn about the Conjugate-Gradient Algorithm and its Uses. Descent Algorithms and the Conjugate-Gradient Method. Qx = b.

Conjugate-Gradient. Learn about the Conjugate-Gradient Algorithm and its Uses. Descent Algorithms and the Conjugate-Gradient Method. Qx = b. Lab 1 Conjugate-Gradient Lab Objective: Learn about the Conjugate-Gradient Algorithm and its Uses Descent Algorithms and the Conjugate-Gradient Method There are many possibilities for solving a linear

More information

Asymptotic Analysis. Slides by Carl Kingsford. Jan. 27, AD Chapter 2

Asymptotic Analysis. Slides by Carl Kingsford. Jan. 27, AD Chapter 2 Asymptotic Analysis Slides by Carl Kingsford Jan. 27, 2014 AD Chapter 2 Independent Set Definition (Independent Set). Given a graph G = (V, E) an independent set is a set S V if no two nodes in S are joined

More information

Efficient Implementation of a Gibbs Sampler for Multivariate Truncated Gaussian and of the Gaussian Adaptation Algorithm

Efficient Implementation of a Gibbs Sampler for Multivariate Truncated Gaussian and of the Gaussian Adaptation Algorithm Efficient Implementation of a Gibbs Sampler for Multivariate Truncated Gaussian and of the Gaussian Adaptation Algorithm Patrick Plattner, ETH Zürich, plpatric@student.ethz.ch June 24, 2011 Abstract Executing

More information

NAG Library Routine Document C02AGF.1

NAG Library Routine Document C02AGF.1 NAG Library Routine Document Note: before using this routine, please read the Users Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent

More information

25. Minimum Spanning Trees

25. Minimum Spanning Trees 695 25. Minimum Spanning Trees Motivation, Greedy, Algorithm Kruskal, General Rules, ADT Union-Find, Algorithm Jarnik, Prim, Dijkstra, Fibonacci Heaps [Ottman/Widmayer, Kap. 9.6, 6.2, 6.1, Cormen et al,

More information

COMP 382: Reasoning about algorithms

COMP 382: Reasoning about algorithms Fall 2014 Unit 4: Basics of complexity analysis Correctness and efficiency So far, we have talked about correctness and termination of algorithms What about efficiency? Running time of an algorithm For

More information

25. Minimum Spanning Trees

25. Minimum Spanning Trees Problem Given: Undirected, weighted, connected graph G = (V, E, c). 5. Minimum Spanning Trees Motivation, Greedy, Algorithm Kruskal, General Rules, ADT Union-Find, Algorithm Jarnik, Prim, Dijkstra, Fibonacci

More information

Carnegie Mellon Univ. Dept. of Computer Science Database Applications. SAMs - Detailed outline. Spatial Access Methods - problem

Carnegie Mellon Univ. Dept. of Computer Science Database Applications. SAMs - Detailed outline. Spatial Access Methods - problem Carnegie Mellon Univ. Dept. of Computer Science 15-415 - Database Applications Lecture #26: Spatial Databases (R&G ch. 28) SAMs - Detailed outline spatial access methods problem dfn R-trees Faloutsos 2

More information

FPGA Resource Utilization Estimates for NI PXI-7854R. LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008

FPGA Resource Utilization Estimates for NI PXI-7854R. LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 FPGA Resource Utilization Estimates for NI PXI-7854R LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 Note: The numbers presented in this document are estimates. Actual resource usage for your

More information

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Limitations of Algorithms We conclude with a discussion of the limitations of the power of algorithms. That is, what kinds

More information

Dynamic Programming. Data Structures and Algorithms Andrei Bulatov

Dynamic Programming. Data Structures and Algorithms Andrei Bulatov Dynamic Programming Data Structures and Algorithms Andrei Bulatov Algorithms Dynamic Programming 18-2 Weighted Interval Scheduling Weighted interval scheduling problem. Instance A set of n jobs. Job j

More information

An evaluation of sparse direct symmetric solvers: an introduction and preliminary finding

An evaluation of sparse direct symmetric solvers: an introduction and preliminary finding Numerical Analysis Group Internal Report 24- An evaluation of sparse direct symmetric solvers: an introduction and preliminary finding J A Scott Y Hu N I M Gould November 8, 24 c Council for the Central

More information

"C:\Program Files\ANSYS Inc\v190\CFX\bin\perllib\cfx5solve.pl" -batch -ccl runinput.ccl -fullname "Fluid Flow CFX_002"

C:\Program Files\ANSYS Inc\v190\CFX\bin\perllib\cfx5solve.pl -batch -ccl runinput.ccl -fullname Fluid Flow CFX_002 This run of the CFX Release 19.0 Solver started at 19:06:17 on 05 Jun 2018 by user ltval on DESKTOP-JCG0747 (intel_xeon64.sse2_winnt) using the command: "C:\Program Files\ANSYS Inc\v190\CFX\bin\perllib\cfx5solve.pl"

More information

CS 273 Prof. Serafim Batzoglou Prof. Jean-Claude Latombe Spring Lecture 12 : Energy maintenance (1) Lecturer: Prof. J.C.

CS 273 Prof. Serafim Batzoglou Prof. Jean-Claude Latombe Spring Lecture 12 : Energy maintenance (1) Lecturer: Prof. J.C. CS 273 Prof. Serafim Batzoglou Prof. Jean-Claude Latombe Spring 2006 Lecture 12 : Energy maintenance (1) Lecturer: Prof. J.C. Latombe Scribe: Neda Nategh How do you update the energy function during the

More information

Searching. Constant time access. Hash function. Use an array? Better hash function? Hash function 4/18/2013. Chapter 9

Searching. Constant time access. Hash function. Use an array? Better hash function? Hash function 4/18/2013. Chapter 9 Constant time access Searching Chapter 9 Linear search Θ(n) OK Binary search Θ(log n) Better Can we achieve Θ(1) search time? CPTR 318 1 2 Use an array? Use random access on a key such as a string? Hash

More information

AM 205 Final Project The N-Body Problem

AM 205 Final Project The N-Body Problem AM 205 Final Project The N-Body Problem Leah Birch Elizabeth Finn Karen Yu December 14, 2012 Abstract The N-Body Problem can be solved using a variety of numeric integrators. Newton s Law of Universal

More information

The L 3 (4) near octagon

The L 3 (4) near octagon The L 3 (4) near octagon A. Bishnoi and B. De Bruyn October 8, 206 Abstract In recent work we constructed two new near octagons, one related to the finite simple group G 2 (4) and another one as a sub-near-octagon

More information

SPATIAL DATA MINING. Ms. S. Malathi, Lecturer in Computer Applications, KGiSL - IIM

SPATIAL DATA MINING. Ms. S. Malathi, Lecturer in Computer Applications, KGiSL - IIM SPATIAL DATA MINING Ms. S. Malathi, Lecturer in Computer Applications, KGiSL - IIM INTRODUCTION The main difference between data mining in relational DBS and in spatial DBS is that attributes of the neighbors

More information

COMPUTATIONAL MODELING OF SHAPE MEMORY MATERIALS

COMPUTATIONAL MODELING OF SHAPE MEMORY MATERIALS COMPUTATIONAL MODELING OF SHAPE MEMORY MATERIALS Jan Valdman Institute of Information Theory and Automation, Czech Academy of Sciences (Prague) based on joint works with Martin Kružík and Miroslav Frost

More information

Supplementary Material

Supplementary Material Supplementary Material Contents 1 Keywords of GQL 2 2 The GQL grammar 3 3 THE GQL user guide 4 3.1 The environment........................................... 4 3.2 GQL projects.............................................

More information

The Verdict Library Reference Manual

The Verdict Library Reference Manual The Verdict Library Reference Manual C. J. Stimpson Elemental Technologies, Inc. 17 N. Merchant St. American Fork, UT 84003, U.S.A. clinton@elemtech.com C. D. Ernst Elemental Technologies, Inc. 17 N. Merchant

More information

10. Applications of 1-D Hermite elements

10. Applications of 1-D Hermite elements 10. Applications of 1-D Hermite elements... 1 10.1 Introduction... 1 10.2 General case fourth-order beam equation... 3 10.3 Integral form... 5 10.4 Element Arrays... 7 10.5 C1 Element models... 8 10.6

More information

IndiFrag v2.1: An Object-based Fragmentation Analysis Software Tool

IndiFrag v2.1: An Object-based Fragmentation Analysis Software Tool IndiFrag v2.1: An Object-based Fragmentation Analysis Software Tool Geo-Environmental Cartography and Remote Sensing Group http://cgat.webs.upv.es/software/ Universitat Politècnica de València Introduction

More information

NINE CHOICE SERIAL REACTION TIME TASK

NINE CHOICE SERIAL REACTION TIME TASK instrumentation and software for research NINE CHOICE SERIAL REACTION TIME TASK MED-STATE NOTATION PROCEDURE SOF-700RA-8 USER S MANUAL DOC-025 Rev. 1.3 Copyright 2013 All Rights Reserved MED Associates

More information

Data Structures and Algorithms(7)

Data Structures and Algorithms(7) Ming Zhang Data Structures and Algorithms Data Structures and Algorithms(7) Instructor: Ming Zhang Textbook Authors: Ming Zhang, Tengjiao Wang and Haiyan Zhao Higher Education Press, 2008.6 (the "Eleventh

More information

Diagnosing Automatic Whitelisting for Dynamic Remarketing Ads Using Hybrid ASP

Diagnosing Automatic Whitelisting for Dynamic Remarketing Ads Using Hybrid ASP Diagnosing Automatic Whitelisting for Dynamic Remarketing Ads Using Hybrid ASP Alex Brik 1 and Jeffrey B. Remmel 2 LPNMR 2015 September 2015 1 Google Inc 2 UC San Diego lex Brik and Jeffrey B. Remmel (LPNMR

More information

NAG Library Routine Document F08PNF (ZGEES)

NAG Library Routine Document F08PNF (ZGEES) F08 Least-squares and Eigenvalue Problems (LAPACK) F08PNF NAG Library Routine Document F08PNF (ZGEES) Note: before using this routine, please read the Users Note for your implementation to check the interpretation

More information

Solutions to Exercises Chapter 10: Ramsey s Theorem

Solutions to Exercises Chapter 10: Ramsey s Theorem Solutions to Exercises Chapter 10: Ramsey s Theorem 1 A platoon of soldiers (all of different heights) is in rectangular formation on a parade ground. The sergeant rearranges the soldiers in each row of

More information

Building Blocks for Direct Sequential Simulation on Unstructured Grids

Building Blocks for Direct Sequential Simulation on Unstructured Grids Building Blocks for Direct Sequential Simulation on Unstructured Grids Abstract M. J. Pyrcz (mpyrcz@ualberta.ca) and C. V. Deutsch (cdeutsch@ualberta.ca) University of Alberta, Edmonton, Alberta, CANADA

More information

CURRENT SOURCES EXAMPLE 1 Find the source voltage Vs and the current I1 for the circuit shown below SOURCE CONVERSIONS

CURRENT SOURCES EXAMPLE 1 Find the source voltage Vs and the current I1 for the circuit shown below SOURCE CONVERSIONS CURRENT SOURCES EXAMPLE 1 Find the source voltage Vs and the current I1 for the circuit shown below EXAMPLE 2 Find the source voltage Vs and the current I1 for the circuit shown below SOURCE CONVERSIONS

More information

GloMAP Mode on HECToR Phase2b (Cray XT6) Mark Richardson Numerical Algorithms Group

GloMAP Mode on HECToR Phase2b (Cray XT6) Mark Richardson Numerical Algorithms Group GloMAP Mode on HECToR Phase2b (Cray XT6) Mark Richardson Numerical Algorithms Group 1 Acknowledgements NERC, NCAS Research Councils UK, HECToR Resource University of Leeds School of Earth and Environment

More information

User-Materials in ANSYS

User-Materials in ANSYS User-Materials in ANSYS Holzapfel-Model l lfor Soft Tissues Prof. Dr.-Ing A. Fritsch Possibilities of user programming ANSYS User Programmable Features (UPF) are capabilities you can use to write your

More information