Escript
Revision_4320
Main Page
Namespaces
Classes
Files
File List
File Members
finley
src
finley/src/ElementFile.h
Go to the documentation of this file.
1
2
/*****************************************************************************
3
*
4
* Copyright (c) 2003-2013 by University of Queensland
5
* http://www.uq.edu.au
6
*
7
* Primary Business: Queensland, Australia
8
* Licensed under the Open Software License version 3.0
9
* http://www.opensource.org/licenses/osl-3.0.php
10
*
11
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12
* Development since 2012 by School of Earth Sciences
13
*
14
*****************************************************************************/
15
16
17
#ifndef INC_FINLEY_ELEMENTFILE
18
#define INC_FINLEY_ELEMENTFILE
19
20
#include "
Finley.h
"
21
#include "
NodeFile.h
"
22
#include "
ReferenceElementSets.h
"
23
#include "escript/DataC.h"
24
25
#ifdef ESYS_MPI
26
#include "esysUtils/Esys_MPI.h"
27
#endif
28
29
30
struct
Finley_ElementFile_Jacobeans
{
31
Finley_Status_t
status
;
/* status of mesh when jacobians were updated last time */
32
dim_t
numDim
;
/* spatial dimension */
33
Finley_ShapeFunction
*
BasisFunctions
;
/* basis function used */
34
dim_t
numQuadTotal
;
/* total number of quadrature nodes used to calculate jacobians = numSub * BasisFunctions->numQuadNodes*/
35
dim_t
numSides
;
/* number of sides (=1 normal, =2 contact) */
36
index_t
*
offsets
;
/* offset to sides (borrowed reference) */
37
dim_t
numSub
;
/* number of subelements */
38
dim_t
numShapesTotal
;
/* total number of shape functions = BasisFunctions->numShapes * numSides */
39
index_t
*
node_selection
;
/* local node selection list of length numSub * numShapesTotal (borrowed reference) */
40
dim_t
numElements
;
/* number of elements */
41
double
*
volume
;
/* local volume */
42
double
*
DSDX
;
/* derivatives of shape functions in global coordinates at quadrature points*/
43
};
44
45
typedef
struct
Finley_ElementFile_Jacobeans
Finley_ElementFile_Jacobeans
;
46
47
struct
Finley_ElementFile
{
48
Esys_MPIInfo
*
MPIInfo
;
49
Esys_MPI_rank
*
Owner
;
50
51
Finley_ReferenceElementSet
*
referenceElementSet
;
/* the reference element to be used */
52
53
dim_t
numElements
;
/* number of elements. */
54
55
index_t
*
Id
;
/* Id[i] is the id number of
56
node i. this number is not
57
used but useful when
58
elements are resorted. In
59
the entire code the term
60
'element id' refers to i
61
and not to Id[i] unless
62
explicitly stated
63
otherwise. */
64
65
index_t
*
Tag
;
/* Tag[i] is the tag of element i. */
66
67
index_t
*
tagsInUse
;
/* array of tags which are actually used */
68
dim_t
numTagsInUse
;
/* number of tags used */
69
70
71
dim_t
numNodes
;
/* number of nodes per element */
72
index_t
*
Nodes
;
/* Nodes[INDEX(k, i, numNodes)]
73
is the k-the node in the
74
i-the element. Note that
75
in the way the nodes are
76
ordered Nodes[INDEX(k, i, numNodes)
77
is the k-th node of element i
78
when referring to the
79
linear version of the mesh. */
80
index_t
minColor
;
/* minimum color */
81
index_t
maxColor
;
/* maximum color */
82
index_t
*
Color
;
/* assigns each element a color. Elements with the same color
83
don't share a node so they can be processed simultaneously.
84
At anytime Color must provide a valid value. In any case one can set
85
Color[e]=e for all e */
86
87
Finley_ElementFile_Jacobeans
*
jacobeans
;
/* jacobians of the shape function used for solution approximation */
88
Finley_ElementFile_Jacobeans
*
jacobeans_reducedS
;
/* jacobians of the shape function used for solution approximation for reduced order of shape function*/
89
Finley_ElementFile_Jacobeans
*
jacobeans_reducedQ
;
/* jacobians of the shape function used for solution approximation for reduced integration order*/
90
Finley_ElementFile_Jacobeans
*
jacobeans_reducedS_reducedQ
;
/* jacobians of the shape function used for solution approximation for reduced integration order and reduced order of shape function*/
91
92
};
93
94
typedef
struct
Finley_ElementFile
Finley_ElementFile
;
95
Finley_ElementFile
*
Finley_ElementFile_alloc
(
Finley_ReferenceElementSet
*
referenceElementSet
,
Esys_MPIInfo
*
MPIInfo
);
96
void
Finley_ElementFile_free
(
Finley_ElementFile
*);
97
void
Finley_ElementFile_allocTable
(
Finley_ElementFile
*,
dim_t
);
98
void
Finley_ElementFile_freeTable
(
Finley_ElementFile
*);
99
void
Finley_ElementFile_setElementDistribution
(
Finley_ElementFile
* in,
dim_t
* distribution);
100
dim_t
Finley_ElementFile_getGlobalNumElements
(
Finley_ElementFile
* in);
101
dim_t
Finley_ElementFile_getMyNumElements
(
Finley_ElementFile
* in);
102
index_t
Finley_ElementFile_getFirstElement
(
Finley_ElementFile
* in);
103
void
Finley_ElementFile_distributeByRankOfDOF
(
Finley_ElementFile
*
self
,
Esys_MPI_rank
* mpiRankOfDOF,
index_t
*
Id
);
104
105
void
Finley_ElementFile_createColoring
(
Finley_ElementFile
* in,
dim_t
numNodes
,
dim_t
* degreeOfFreedom);
106
void
Finley_ElementFile_optimizeOrdering
(
Finley_ElementFile
** in);
107
void
Finley_ElementFile_setNodeRange
(
dim_t
*,
dim_t
*,
Finley_ElementFile
*);
108
void
Finley_ElementFile_relableNodes
(
dim_t
*,
dim_t
,
Finley_ElementFile
*);
109
void
Finley_ElementFile_markNodes
(
dim_t
*,
dim_t
,
dim_t
,
Finley_ElementFile
*,
dim_t
);
110
void
Finley_ElementFile_scatter
(
dim_t
*,
Finley_ElementFile
*,
Finley_ElementFile
*);
111
void
Finley_ElementFile_gather
(
dim_t
*,
Finley_ElementFile
*,
Finley_ElementFile
*);
112
void
Finley_ElementFile_copyTable
(
dim_t
,
Finley_ElementFile
*,
dim_t
,
dim_t
,
Finley_ElementFile
*);
113
void
Finley_ElementFile_markDOFsConnectedToRange
(
index_t
* mask,
index_t
offset,
index_t
marker,
index_t
firstDOF,
index_t
lastDOF,
index_t
*dofIndex,
Finley_ElementFile
*in ,
bool_t
useLinear);
114
115
void
Finley_ElementFile_setTags
(
Finley_ElementFile
* ,
const
int
,
escriptDataC
*);
116
Finley_ElementFile_Jacobeans
*
Finley_ElementFile_Jacobeans_alloc
(
Finley_ShapeFunction
* );
117
void
Finley_ElementFile_Jacobeans_dealloc
(
Finley_ElementFile_Jacobeans
*);
118
Finley_ElementFile_Jacobeans
*
Finley_ElementFile_borrowJacobeans
(
Finley_ElementFile
*,
Finley_NodeFile
*,
bool_t
,
bool_t
);
119
void
Finley_ElementFile_setTagsInUse
(
Finley_ElementFile
* in);
120
121
122
#endif
/* #ifndef INC_FINLEY_ELEMENTFILE */
123
Generated on Fri Mar 15 2013 14:07:50 for Escript by
1.8.1.2