/[escript]/branches/trilinos_from_5897/dudley/src/ElementFile_jacobians.cpp
ViewVC logotype

Contents of /branches/trilinos_from_5897/dudley/src/ElementFile_jacobians.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6009 - (show annotations)
Wed Mar 2 04:13:26 2016 UTC (3 years, 1 month ago) by caltinay
File size: 4141 byte(s)
Much needed sync with trunk...

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 #include "ElementFile.h"
18 #include "Assemble.h"
19 #include "ShapeTable.h"
20
21 namespace dudley {
22
23 Dudley_ElementFile_Jacobians *Dudley_ElementFile_Jacobians_alloc(void)
24 {
25 Dudley_ElementFile_Jacobians *out = new Dudley_ElementFile_Jacobians;
26 out->status = DUDLEY_INITIAL_STATUS - 1;
27 out->numDim = 0;
28 out->numQuad = 0;
29 out->numElements = 0;
30 out->absD = NULL;
31 out->quadweight = 0;
32 out->DSDX = NULL;
33 return out;
34 }
35
36 void Dudley_ElementFile_Jacobians_dealloc(Dudley_ElementFile_Jacobians * in)
37 {
38 if (in != NULL)
39 {
40 delete[] in->DSDX;
41 delete[] in->absD;
42 delete in;
43 }
44 }
45
46 Dudley_ElementFile_Jacobians *Dudley_ElementFile_borrowJacobians(
47 const Dudley_ElementFile* self, const Dudley_NodeFile* nodes,
48 bool reducedIntegrationOrder)
49 {
50 Dudley_ElementFile_Jacobians *out = NULL;
51
52 dim_t numNodes = self->numNodes;
53
54 if (reducedIntegrationOrder)
55 {
56 out = self->jacobians_reducedQ;
57 }
58 else
59 {
60 out = self->jacobians;
61 }
62 if (out->status < nodes->status)
63 {
64 out->numDim = nodes->numDim;
65 out->numQuad = QuadNums[self->numDim][!reducedIntegrationOrder];
66 out->numShapes = self->numDim + 1;
67 out->numElements = self->numElements;
68 if (out->DSDX == NULL)
69 out->DSDX = new double[(out->numElements) * (out->numShapes) * (out->numDim) * (out->numQuad)];
70 if (out->absD == NULL)
71 out->absD = new double[out->numElements];
72
73 /*========================== dim = 1 ============================= */
74 if (out->numDim == 1) {
75 throw DudleyException("Dudley does not support 1D domains.");
76 /*========================== dim = 2 ============================= */
77 } else if (out->numDim == 2) {
78 if (self->numLocalDim == 1) {
79 dudley::Assemble_jacobians_2D_M1D_E1D(nodes->Coordinates, out->numQuad, self->numElements, numNodes,
80 self->Nodes, out->DSDX, out->absD, &(out->quadweight), self->Id);
81 } else if (self->numLocalDim == 2) {
82 dudley::Assemble_jacobians_2D(nodes->Coordinates, out->numQuad, self->numElements, numNodes, self->Nodes,
83 out->DSDX, out->absD, &(out->quadweight), self->Id);
84 } else {
85 throw DudleyException("Dudley_ElementFile_borrowJacobians: local dimension in a 2D domain has to be 1 or 2.");
86 }
87 /*========================== dim = 3 ============================= */
88 } else if (out->numDim == 3) {
89 if (self->numLocalDim == 2) {
90 dudley::Assemble_jacobians_3D_M2D_E2D(nodes->Coordinates, out->numQuad, self->numElements, numNodes,
91 self->Nodes, out->DSDX, out->absD, &(out->quadweight), self->Id);
92 } else if (self->numLocalDim == 3) {
93 dudley::Assemble_jacobians_3D(nodes->Coordinates, out->numQuad, self->numElements, numNodes, self->Nodes,
94 out->DSDX, out->absD, &(out->quadweight), self->Id);
95 } else {
96 throw DudleyException("Dudley_ElementFile_borrowJacobians: local dimension in a 3D domain has to be 2 or 3.");
97 }
98 } else {
99 throw DudleyException("Dudley_ElementFile_borrowJacobians: spatial dimension has to be 1, 2 or 3.");
100 }
101 out->status = nodes->status;
102 }
103 return out;
104 }
105
106 } // namespace dudley
107

Properties

Name Value
svn:mergeinfo /branches/4.0fordebian/dudley/src/ElementFile_jacobeans.cpp:5567-5588 /branches/4.0fordebian/dudley/src/ElementFile_jacobians.cpp:5567-5588 /branches/complex/dudley/src/ElementFile_jacobians.cpp:5866-5937 /branches/diaplayground/dudley/src/ElementFile_jacobians.cpp:4940-5147 /branches/lapack2681/finley/src/ElementFile_jacobeans.cpp:2682-2741 /branches/lapack2681/finley/src/ElementFile_jacobians.cpp:2682-2741 /branches/pasowrap/dudley/src/ElementFile_jacobeans.cpp:3661-3674 /branches/pasowrap/dudley/src/ElementFile_jacobians.cpp:3661-3674 /branches/py3_attempt2/dudley/src/ElementFile_jacobeans.cpp:3871-3891 /branches/py3_attempt2/dudley/src/ElementFile_jacobians.cpp:3871-3891 /branches/restext/finley/src/ElementFile_jacobeans.cpp:2610-2624 /branches/restext/finley/src/ElementFile_jacobians.cpp:2610-2624 /branches/ripleygmg_from_3668/dudley/src/ElementFile_jacobeans.cpp:3669-3791 /branches/ripleygmg_from_3668/dudley/src/ElementFile_jacobians.cpp:3669-3791 /branches/stage3.0/finley/src/ElementFile_jacobeans.cpp:2569-2590 /branches/stage3.0/finley/src/ElementFile_jacobians.cpp:2569-2590 /branches/symbolic_from_3470/dudley/src/ElementFile_jacobeans.cpp:3471-3974 /branches/symbolic_from_3470/dudley/src/ElementFile_jacobians.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/src/ElementFile_jacobeans.cpp:3517-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/src/ElementFile_jacobians.cpp:3517-3974 /release/3.0/finley/src/ElementFile_jacobeans.cpp:2591-2601 /release/3.0/finley/src/ElementFile_jacobians.cpp:2591-2601 /release/4.0/dudley/src/ElementFile_jacobeans.cpp:5380-5406 /release/4.0/dudley/src/ElementFile_jacobians.cpp:5380-5406 /trunk/dudley/src/ElementFile_jacobeans.cpp:4257-4344 /trunk/dudley/src/ElementFile_jacobians.cpp:5898-5962,5982-6007 /trunk/ripley/test/python/dudley/src/ElementFile_jacobeans.cpp:3480-3515 /trunk/ripley/test/python/dudley/src/ElementFile_jacobians.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26