1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
:
0) () , data()
1) () erase array , resize'
2) () ReferenceArray
3) () char, short, - , -
4) ()
5) ( )
6) ()
7) () chunk_bulk_array - chunk_array - ,
8) ()
8.1)
10) ()
10.-1) () Element getNodes,getEdges,getFaces,getCells
10.0) (, ) array,
10.1) () adjacent ( ID , )
10.1.0) (, , 10.6) - array ( reference_array) dynarray ( )
10.1.1) ()
10.2) () ElementSet - , LowConn , ,
HighConn , 1- - , - , - ( INMOST_experimental)
tag_set_size, , LowConn
?
,
10.2.0) () ,
:
- , , , , insert
- array, , swap array
,
10.2.1) () - , , , 10.1
- ,
10.2.2) () ApplyModification
10.2.3) () VTK
10.2) () ID
10.3) () Cell, Face, Edge, Node, ElementSet - , ID
10.4) () Cell,Face,Edge,Node,ElementSet ID
10.5) () reference_array
10.6) () createCell, CreateFace.. - TieElement new, 10.3
11) () Markers, HighConn, LowConn - TagManager, , ,
26) ()
26.1) ( ) radix ( INMOST_experimental)
25*n 8- , 16
17*n 11- , 131
27) () Read* pmf,
28) () std::vector array
29) () std::vector array
31) () TagManager & TagManager::assign(Mesh * m, TagManager const & other)
33) () ElementNum, ElementType 6
34) () Storage ,
36) ( ) , Storage Mesh
50) () container.hpp enumerator size_type
51) () container.hpp ( iterator_category?)
41) ( ) HighConn, LowConn ,
44) ( ) PackElementsData tag
46) ( ) . ,
19) () ( , )
20) ()
63) () expr
=====================================================================================
0) ,
14) ReferenceArray?
16) parallel_storage
17) ?
18)
19.) incident_matrix.hpp incident_matrix::compute_measure geometry.cpp Mesh::GetGeometricData
21) /- (kd examples/OldDrawGrid)
22) ResolveShared
23) ,
24)
25) ,
30) - sort ReorderApply , chunk_array
ReorderApply radix-?
32) , , Cell, Face, Edge Node
35) Bridge*
37) container.hpp,
38) GatherBoundaryFaces/GatherInteriorFaces
39) CastRay ,
40) ?
42) Inside discr_common.cpp
43) RestoreCellNodes?
45) ?
. ( )
47) , , ?
49) -
,
ResolveShared
ModificationResolve
52) , radix big-endian
53) SortByGlobalID, globalid
54) ( unit tests)
55) mpi_send/mpi_recv -
56) Enumerate with mask should accept MarkerType select to select elements
57) GlobalID service class with different operation options to help pick new global ids when mesh is modified locally
options:
a) global id continuous among processors
b) global id may have gaps but local interval for each processor is bounded
c) global id is just a unique number
58) vtk- "VTK_WRITE_SETS_TO_FILES" = "YES"
59) Openmp
60) ResolveShared MarkerType, ( ResolveModification)
61) ResolveModification .
62) DATA_UNKNOWN unknown
64) Automatizator
65) Bulk MarkerType.
66)
65) (???)
66) Map RowMerger, ( OrderInfo )
67) Graph, Partitioner Solver
68) Redistribute tag
69) ghost- Partitioner::Evaluate, ReduceData.
====================================================================================
INMOST Mesh
0) TagDenseFixed, TagSparseFixed, TagDenseVariable, TagSparseVariable
dynamic_variable, static_variable may be templatized with respect to type of the Tag
1) rewrite parallel_storage
(?) RecomputeParallelStorage detect element types in ExchangeMarked
Either organise separation per element type in ElementSet, or store 4 element sets.
2) volume for nonconvex elements
implement in incedence_matrix in modify.cpp
3) (ok) New mesh format reader, XML
search tag positions in file
parallel reader
4) octree structure for intersection of remote nodes
in ResolveShared
in UnpackElementsData
in file reading procedures
5) algorithm for dynamic mesh adaptation in parallel
ResolveShared should depend on marker
Algorithm of shortest path to close the gap in shared skin
OR remap processors numbers from old cells onto new ones using bijection of cell centers
7) Introduce INMOST DataBase, that should be outside
(?) ElementSet should have data for it's elements, Mesh should become ElementSet
Move MGetLink and all the mechanism to access data into TagManager
Move inline functions for Storage from inmost_mesh to inmost_data
9) (test) add DATA_REMOTE_REFERENCE, RemoteHandleType data type and structure that will allow to link another mesh
(ok) static Mesh::GetMesh(std::string name), structure to collect meshes by name.
Save multiple meshes to file
10) (test,ok) algorithm in PackTagData for DATA_VARIABLE
(ok) GetData,SetData,SetDataSize - add DATA_VARIABLE
(ok) GetDataSize - returns number of entries in array
(ok) GetDataCapacity - returns space capacity occupied by all the data (specific for DATA_VARIABLE)
(ok) GetData - puts all the data into allocated array of size GetDataSpace
(ok) SetData - given the number of entries is known, knows how to fill the internal data
(ok) MPI type for DATA_VARIABLE
Destroy type on Finalize
Test!
(ok) Should get capacity of unpacked data, provide function ComputeCapacity
See next
(ok) Organize GetDataCapacity with parameter that represents storage and size information
(ok) Provide tools to retrive data from bytes arrays in Unpack functions
(ok) variable::RecordEntry - write into array of Row::entry
(ok) variable::RetriveEntry - get out of array of pairs
(ok) variable::RetriveSizeEntry - how many entries used to store
(ok) variable::RequiredSizeEntry - how many entries are needed to store
11) DATA_REFERENCE, DATA_REMOTE_REFERENCE can use PackElements in PackTagData
Have to make rounds of communication as in ExchangeMarked
Presence of Tag of type DATA_REFERENCE and DATA_REMOTE_REFERENCE should internally mark the elements, invoke ExhchangeMarked
12) Orientation of edges as directed, order faces with right hand side rule, each face's normal should follow right hand side rule
Insertion of faces into edge
Orientation of faces
Optimized algorithms:
all cells of the edge (traverse faces, get back cell)
all nodes of the face (traverse edges, always get first node)
all faces of the node (traverse only edges that are directed outside or inside, get their faces)
INMOST Solvers:
-1) (ok) Move annotation into matrix as outstanding structure that can be allocated on demand
0) (no) BasicRow class for autodiff or above
1) Rewrite BCGS as with Anderson Acceleration
3) Internal CSRMatrix format
3.1) Reorderings for CSRMatrix with PQ (RCM,ColAMD,MetisND)
3.2) Reorderings with execution tree (Mondriaan)
3.3) CSRMatrix functions - transpose, swap row/column, compute schur with LU, multiply vector, additive schwartz...
3.4) types for CSRMatrix
3.5) fast row/col exchange for MPTILUC
4) Fast laplacian matrix factorization graphs: Horst Simon, C:\Users\KIRILL\Documents\Read\solver\laplacian_graph
5) condition estimation for ilu2
6) Purely algebraic CPR (see galerkin principle)
7) PrepareMatrix should be able to merge rows in parallel, just sum the row on lowest-rank processor, have to return the solution on every processor.
INMOST Autodiff
0) Gateaux derivatives
1) Clean old staff
2) Superproblem definition??
3) Read about Fenics
4) (ok) Automatizator::MakeCurrent, Automatizator::GetCurrent, Automatizator::HasCurrent
(ok) variable should detect presence of current automatizator and access it's structures
5) Abstraction of KeyValueTable,
add cubic spline,
add bc treatment
6) condition_etype_variable, condition_marker_variable - needed in THREEPHASE in interpolation
7) support std::swap
8) expression foreach that will iterate over elements or elements handles
INMOST Nonlinear
1. Newton
2. Line search
3. Anderson
4. http://fenicsproject.org/documentation/tutorial/nonlinear.html
nonlinear solvers: Hans De Sterck
Nonlinear solvers for INMOST L-BFGS
1) Rewrite onephase into class with ComputeFunction, ComputeGradient, ComputeHessian(?)
2) Create abstract problem class for nonlinear solvers within INMOST
3) reimplement Newton/LS/AA into INMOST
4) implement L-BFGS https://github.com/PatWie/CppNumericalSolvers/blob/master/src/LbfgsSolver.cpp
5) hessian https://en.wikipedia.org/wiki/Hessian_automatic_differentiation
====================================================================================
7.MSPP: () : , ,
8.MSPP:
9.MSPP: () visual studio
10.MSPP: ( )
11. ()
12. (, )
12. () MSPP: Mesh
13. MSPP: Redistribute!!! ExchangeGhost
13. INMOST / MMTK = Mathematical Modelling ToolKit / NSTK
() last_created_element -
1) - ,
( ),
-
,
-
2) small_hash -> dynarray
3)
4)
5) parent()
6)
7) , []
8)
9) ,
( )
10) ,
11) LLVM asmjit
12) openmp
13) opencl , openmp
14)
1) -
1)
2) ILUC2
3) /,
4) E,F
5) EU^-1 L^-1F
6)
7) (openmp)
8) (openmp) EU^-1, L^-1F
9) nicole spillane
10) ,
11) amls
12)
13) Matrix Row:
Row::MergeRows(linked_list_storage, row b
Matrix::MergeRow(alpha, row & a, real beta, row &b)
14) CSRMatrix, CSRRow
15) Matrix -> CSRMatrix
16) OrderInfo CSRMatrix
17)
solver:
read mc64
read nested dissection
try to postpone ReorderEF to the end of run
5.MSPP:
6.MSPP:
6.0 bicgs(l)
6.0 OrderInfo -> ASM_preconditioner?
6.0.1 OrderInfo.PrepareMatrix(A,levels) -> ASM_preconditioner(A,levels) : Method
6.0.3 OrderInfo.PrepareVector(vector) -> Matrix.PrepareVector(vector)
6.0.4 OrderInfo.Update(vector) -> Matrix.Update(vector)
6.0.5 orderInfo.Accumulate(vector) -> Matrix.Accumulate(vector)
6.1 (, MPI_Waitall->MPI_Waitsome)
6.2 Update(vector) -> UpdateBegin, UpdateEnd, , (INIT,PREC,MATVEC)
6.3 (?) ilu2 ( superlu?)
6.3.1
info->PrepareMatrix(A,0)
6.3.2
6.4 tau
6.5
6.6 superlu
6.7 - ..
//FOR 2D
// Node -> Vertex
// Edge -> Vertex
// Face -> Line, Curve
// Cell -> Tri, Quad, Polygon, MultiLine
//FOR 3D
// Node -> Vertex
// Edge -> Line, Curve
// Face -> Tri, Quad, Polygon, MultiLine
// Cell -> Tet, Hex, Prism, Pyramid, Polyhedron, MultiPolygon
//TODO:
1D???
//serial
//1.0 read/write formats
// 1.1 read gmv
// 1.2 read different kinds of vtk besides unstructured
// 1.3 read/write xml vtk formats
// 1.4 pmf: print error when markers cannot be represented in current type and data was lost
// 1.5 pmf: save hide_marker, new_marker values
// 1.6 pmf: save topology checking information
//2. enchance iterators
// iterators should return pointers or references?
//3. geometry.cpp
// 3.0 decide how FixNormalOrientation should update geometric data
// 3.1 replace calculation of normale by hyperplane equation for any dimension??
// 3.2 correct Inside function to check weather point inside Segment, Polygon
// 3.3 dynamically balanced obtree or octree or kd-tree to query elements by position
//4. (done, need check) add some low-level mesh modification procedures to elements
// 5.1 add some high-level mesh modification procedures: split by plane,
// 5.2 csg: difference, union, intersection
// 5.3 calculate volume for concave elements, choose elements by minimum volume, not minimum number of elements in incident_matrix class (modify.cpp)
//5. reduce size used by sparse data
//6. new ElementSet class, derived from Element class
// 6.1 support ierarhy
//7. algorithm that checks topology on element creation
// 7.1 complete unimplemented tests for star-shaped objects, concavity
//parallel:
//1. algorithm in EndModification or ResolveModification to keep the mesh in parallel consistent state after element creation/deletion
// 1.1 restore contiguous global id
//2. test algorithm that checks for halo in ExchangeMarked, if performance increases
//3. decide how to exchange ElementSets between processors
//4. exchange data of type DATA_REFERENCE, by GlobalID and ElementType
//5. mesh_file.cpp
// 5.1 on parallel load, when there are more processors then parts in mesh - duplicate mesh on other processors??
// 5.2 when mesh is duplicated over many processors use local clusterization algorithm in ResolveShared
// shared parallel
//1. avoid markers in nbAdjElements, getAdjElements, getNodes, getEdges, getFaces, getCells, BridgeAdjacency
// partitioner:
//1. implement K-means clustering
//solver:
//0. workaround for overlapping vertices and matrices
//1. read TODO on top of solver_*.hpp
//autodiff:
//1. read TODO on top of INMOST_autodiff.h
//TODO:
// Recheck computation of derivatives!!!!
// Detect similar parts of the tree in Automatizator
// Restructure tree expressions
// Intorduce multivariate tables
// Generate opencl code
// Make so that stencil may be represented by tags, by set or by callback_function
//RegisterTable and table implementation should account for boundary conditions beyond data
//SOLVER todo:
//TODO:
// how to calculate diagonal perturbation?
// how to calculate schur complement faster
//
// done! implement crout-ILU from
// Documents/Read/solver/crout/crout.pdf to ILUC_preconditioner
// done! implement condition estimation for |L^{-1}| and |U^{-1}| and adaptive tau for ILUC_preconditioner from
// Documents\Read\solver\Read_now\bollhofer_siam.pdf
// done! try to make ILUC2_preconditioner - second order ILU from ILUC_preconditioner
// done! implement diagonal pivoting for ILUC - maybe need to update diagonal at every step
// goto references [7],[10]-(data structure!) from
// Documents\Read\solver\crout\crout.pdf
// return dropped values to diagonal if control vector is provided from
// Documents\Read\solver\stabilization\milut.pdf
// try to apply dropping while forming linked list,should correctly calculate condition estimates
// Calculate schur complement faster:
// Documents\Read\solver\sparse_matmul\sparse.pdf
// in ILUC_preconditioner, replace matrix structures by CSR, estimate number of nonzeros in rows/cols
// before filling, if necessery (how?)