/[escript]/branches/trilinos_from_5897/dudley/src/Assemble.h
ViewVC logotype

Contents of /branches/trilinos_from_5897/dudley/src/Assemble.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6090 - (show annotations)
Wed Mar 23 06:35:54 2016 UTC (3 years ago) by caltinay
File MIME type: text/plain
File size: 7349 byte(s)
Simplified dudley PDE routines.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The 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 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 /****************************************************************************
18
19 Assemblage routines: header file
20
21 *****************************************************************************/
22
23 #ifndef __DUDLEY_ASSEMBLE_H__
24 #define __DUDLEY_ASSEMBLE_H__
25
26 #include "Dudley.h"
27 #include "ElementFile.h"
28 #include "NodeFile.h"
29 #include <escript/AbstractSystemMatrix.h>
30
31 namespace dudley {
32
33 struct AssembleParameters
34 {
35 AssembleParameters(const NodeFile* nodes, const ElementFile* ef,
36 escript::ASM_ptr sm, escript::Data& rhs,
37 bool reducedOrder);
38
39 /// element file these parameters apply to
40 const ElementFile* elements;
41 /// system matrix to be updated
42 escript::ASM_ptr S;
43 /// right-hand side to be updated
44 escript::Data& F;
45 /// number of quadrature nodes
46 int numQuad;
47 /// number of spatial dimensions
48 int numDim;
49 /// leading dimension of element node table
50 int NN;
51 /// number of equations (= matrix row/column block size)
52 int numEqu;
53 /// row and column degrees of freedom
54 const index_t* DOF;
55 /// number of local degrees of freedom
56 dim_t DOF_UpperBound;
57 /// reference to jacobians
58 const ElementFile_Jacobians* jac;
59 int numShapes;
60 const double* shapeFns;
61 };
62
63 void Assemble_PDE(const NodeFile* nodes, const ElementFile* elements,
64 escript::ASM_ptr S, escript::Data& F,
65 const escript::Data& A, const escript::Data& B,
66 const escript::Data& C, const escript::Data& D,
67 const escript::Data& X, const escript::Data& Y);
68
69 void Assemble_PDE_Points(const AssembleParameters& p,
70 const escript::Data& d_dirac,
71 const escript::Data& y_dirac);
72
73 void Assemble_PDE_Single_2D(const AssembleParameters& p,
74 const escript::Data& A, const escript::Data& B,
75 const escript::Data& C, const escript::Data& D,
76 const escript::Data& X, const escript::Data& Y);
77
78 void Assemble_PDE_Single_3D(const AssembleParameters& p,
79 const escript::Data& A, const escript::Data& B,
80 const escript::Data& C, const escript::Data& D,
81 const escript::Data& X, const escript::Data& Y);
82
83 void Assemble_PDE_System_2D(const AssembleParameters& p,
84 const escript::Data& A, const escript::Data& B,
85 const escript::Data& C, const escript::Data& D,
86 const escript::Data& X, const escript::Data& Y);
87
88 void Assemble_PDE_System_3D(const AssembleParameters& p,
89 const escript::Data& A, const escript::Data& B,
90 const escript::Data& C, const escript::Data& D,
91 const escript::Data& X, const escript::Data& Y);
92
93
94 /// Adds the matrix array[Eq,Eq,NN,NN] onto the matrix S.
95 /// The rows/columns are given by i_Eq+Eq*Nodes[Nodes[j_Eq]]
96 /// (i_Eq=0:Eq; j_Eq=0:NN_Eq).
97 /// The routine has to be called from a parallel region and assumes that
98 /// array is fully packed.
99 void Assemble_addToSystemMatrix(escript::ASM_ptr S,
100 const std::vector<index_t>& Nodes, int numEq,
101 const std::vector<double>& array);
102
103 /// Assembles the mass matrix in lumped form.
104 /// The coefficient D has to be defined on the integration points or not
105 /// present. `lumpedMat` has to be initialized before the routine is called.
106 void Assemble_LumpedSystem(const NodeFile* nodes, const ElementFile* elements,
107 escript::Data& lumpedMat, const escript::Data& D,
108 bool useHRZ);
109
110 /// averages data
111 void Assemble_AverageElementData(const ElementFile* elements,
112 escript::Data& out, const escript::Data& in);
113
114 /// copies data between different types of elements
115 void Assemble_CopyElementData(const ElementFile* elements, escript::Data& out,
116 const escript::Data& in);
117
118 /// copies data between different types of nodal representations
119 void Assemble_CopyNodalData(const NodeFile* nodes, escript::Data& out,
120 const escript::Data& in);
121
122 /// copies node coordinates into expanded Data object `x`
123 void Assemble_NodeCoordinates(const NodeFile* nodes, escript::Data& x);
124
125 /// calculates the normal vector at quadrature points on face elements
126 void Assemble_getNormal(const NodeFile* nodes, const ElementFile* elements,
127 escript::Data& normals);
128
129 /// calculates the minimum distance between two vertices of elements and
130 /// assigns the value to each quadrature point in `size`
131 void Assemble_getSize(const NodeFile* nodes, const ElementFile* elements,
132 escript::Data& size);
133
134 /// Assemblage of Jacobians: calculates the gradient of nodal data at
135 /// quadrature points
136 void Assemble_gradient(const NodeFile* nodes, const ElementFile* elements,
137 escript::Data& gradient, const escript::Data& data);
138
139 /// integrates data on quadrature points
140 void Assemble_integrate(const NodeFile* nodes, const ElementFile* elements,
141 const escript::Data& data, std::vector<double>& integrals);
142
143 /// interpolates nodal data in a data array onto elements (=integration points)
144 void Assemble_interpolate(const NodeFile* nodes, const ElementFile* elements,
145 const escript::Data& data, escript::Data& output);
146
147 void Assemble_jacobians_2D(const double* coordinates, int numQuad,
148 dim_t numElements, int numNodes,
149 const index_t* nodes, double* dTdX, double* absD,
150 double* quadWeight, const index_t* elementId);
151
152 void Assemble_jacobians_2D_M1D_E1D(const double* coordinates, int numQuad,
153 dim_t numElements, int numNodes,
154 const index_t* nodes, double* dTdX, double* absD,
155 double* quadWeight, const index_t* elementId);
156
157 void Assemble_jacobians_3D(const double* coordinates, int numQuad,
158 dim_t numElements, int numNodes,
159 const index_t* nodes, double* dTdX, double* abs_D,
160 double* quadWeight, const index_t* elementId);
161
162 void Assemble_jacobians_3D_M2D_E2D(const double* coordinates, int numQuad,
163 dim_t numElements, int numNodes,
164 const index_t* nodes, double* dTdX, double* absD,
165 double* quadWeight, const index_t* elementId);
166
167
168 } // namespace dudley
169
170 #endif // __DUDLEY_ASSEMBLE_H__
171

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26