ParMooN
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Variables
Friends
Pages
include
AMG
amg_coarsen.h
1
/****************************************************************************/
2
/* */
3
/* File: amg_coarsen.h */
4
/* */
5
/* Purpose: algebraic multigrid coarse grid setup */
6
/* */
7
/* Author: Peter Bastian */
8
/* Institut fuer Computeranwendungen III */
9
/* Universitaet Stuttgart */
10
/* Pfaffenwaldring 27 */
11
/* 70550 Stuttgart */
12
/* email: peter@ica3.uni-stuttgart.de */
13
/* phone: 0049-(0)711-685-7003 */
14
/* fax : 0049-(0)711-685-7000 */
15
/* */
16
/* History: 29 FEB 1996 Begin */
17
/* 01 OKT 1997 redesign */
18
/* */
19
/* Remarks: */
20
/* */
21
/****************************************************************************/
22
23
/* RCS_ID
24
$Header: /homes/matthies/ARCHIVE_MooNMD/MooNMD/include/AMG/amg_coarsen.h,v 1.3 2004/12/10 08:33:37 john Exp $
25
*/
26
27
/****************************************************************************/
28
/* */
29
/* auto include mechanism and other include files */
30
/* */
31
/****************************************************************************/
32
33
#ifndef __AMG_COARSEN__
34
#define __AMG_COARSEN__
35
36
#include "amg_sp.h"
37
38
/****************************************************************************/
39
/* */
40
/* defines in the following order */
41
/* */
42
/* compile time constants defining static data size (i.e. arrays) */
43
/* other constants */
44
/* macros */
45
/* */
46
/****************************************************************************/
47
48
#define AMG_MAX_COMP 5
/* max number of components in syste*/
49
50
#define AMG_MAX_LEVELS 32
/* max no of levels in hierarchy */
51
#define AMG_MAX_FRONT 4096
/* max number of front nodes */
52
#define AMG_MAX_CLUSTER 256
/* max size of a cluster */
53
#define AMG_MAX_STACK 256
/* size of seed stack */
54
#define AMG_MAX_ROW 2048
/* max number of nonzeros in row */
55
56
57
#define AMG_UNSYM 1
/* unsymmetric dependency strategy */
58
#define AMG_SYM 2
/* symmetric dependency strategy */
59
60
/****************************************************************************/
61
/* */
62
/* data structures exported by the corresponding source file */
63
/* */
64
/****************************************************************************/
65
66
typedef
struct
{
/* parameters of coarsening strategy */
67
int
verbose;
/* be verbose */
68
double
alpha;
/* "relative" strongness */
69
double
beta;
/* "absolute" strongness */
70
int
mincluster;
/* minimal cluster size */
71
int
maxcluster;
/* maximum cluster size */
72
int
maxdistance;
/* maximum distance in one cluster */
73
int
maxconnectivity;
/* limit for connectivity */
74
int
coarsentarget;
/* quit coarsening if nodes reached */
75
int
depthtarget;
/* create at most so many levels */
76
double
coarsenrate;
/* quit if coarsening is too slow */
77
int
major;
/* use major component strategy if >=0 */
78
int
dependency;
/* selects dependency strategy */
79
double
time;
/* time for coarsening */
80
}
AMG_CoarsenContext
;
81
82
struct
amg_graph
{
/* graph data structure */
83
int
n;
/* number of nodes (this is n from A) */
84
int
e;
/* number of edges (nonzeros from A) */
85
int
*ra,*ja;
/* connectivity from A */
86
int
*ca;
/* cluster array (fine to coarse map) */
87
char
*na;
/* node array (flags per node) */
88
char
*la;
/* link array */
89
float
*da;
/* damping array with automatic damping */
90
int
clusters;
/* total number of clusters build */
91
int
conclusters;
/* number of nonisolated clusters */
92
int
system_as_scalar;
/* copied from matrix */
93
};
94
95
typedef
struct
amg_graph
AMG_GRAPH
;
96
97
#define AMG_GRAPH_N(p) (p)->n
98
#define AMG_GRAPH_E(p) (p)->e
99
#define AMG_GRAPH_SAS(p) (p)->system_as_scalar
100
#define AMG_GRAPH_RA(p) (p)->ra
101
#define AMG_GRAPH_JA(p) (p)->ja
102
#define AMG_GRAPH_CA(p) (p)->ca
103
#define AMG_GRAPH_NA(p) (p)->na
104
#define AMG_GRAPH_LA(p) (p)->la
105
#define AMG_GRAPH_DA(p) (p)->da
106
107
108
/****************************************************************************/
109
/* */
110
/* functions */
111
/* */
112
/****************************************************************************/
113
114
int
AMG_BuildHierarchy (
AMG_CoarsenContext
*cc,
AMG_MATRIX
*A,
115
AMG_MATRIX
*H[AMG_MAX_LEVELS],
AMG_GRAPH
*G[AMG_MAX_LEVELS]);
116
117
int
AMG_BuildHierarchy_Saddle (
AMG_CoarsenContext
*cc,
AMG_MATRIX
*A,
118
AMG_MATRIX
*H[AMG_MAX_LEVELS],
AMG_GRAPH
*G[AMG_MAX_LEVELS],
119
AMG_MATRIX
*schur,
AMG_MATRIX
*H_schur[AMG_MAX_LEVELS],
120
AMG_GRAPH
*G_schur[AMG_MAX_LEVELS],
121
AMG_MATRIX
*B[AMG_MAX_LEVELS]);
122
#endif
AMG_CoarsenContext
Definition:
amg_coarsen.h:66
amg_graph
Definition:
amg_coarsen.h:82
amg_matrix
Definition:
amg_sp.h:96
Generated on Tue May 10 2016 09:07:57 for ParMooN by
1.8.5