OOFEM 3.0
Loading...
Searching...
No Matches
ltrspaceboundaryvoigt.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
37#include "node.h"
38#include "material.h"
39#include "gausspoint.h"
41#include "floatmatrix.h"
42#include "floatarray.h"
43#include "intarray.h"
44#include "mathfem.h"
45#include "fei3dtetlin.h"
46#include "classfactory.h"
48
49
50namespace oofem {
52
53LTRSpaceBoundaryVoigt :: LTRSpaceBoundaryVoigt(int n, Domain *aDomain) :
54 LTRSpaceBoundary(n, aDomain)
55{}
56
57void
58LTRSpaceBoundaryVoigt :: giveDofManDofIDMask(int inode, IntArray &answer) const
59{
60 if ( inode == 5 ) {
61 answer = { E_xx, E_yy, E_zz, G_yz, G_xz, G_xy };
62 } else {
63 answer = { D_u, D_v, D_w };
64 }
65}
66
67
68void
69LTRSpaceBoundaryVoigt :: computeTransformationMatrix(FloatMatrix &answer, TimeStep *tStep)
70{
71 FloatArray unitCellSize;
72 unitCellSize.resize(3);
73 unitCellSize.at(1) = this->giveNode(5)->giveCoordinate(1);
74 unitCellSize.at(2) = this->giveNode(5)->giveCoordinate(2);
75 unitCellSize.at(3) = this->giveNode(5)->giveCoordinate(3);
76
77 IntArray switches1, switches2, switches3, switches4;
78 this->giveSwitches(switches1, this->location.at(1) );
79 this->giveSwitches(switches2, this->location.at(2) );
80 this->giveSwitches(switches3, this->location.at(3) );
81 this->giveSwitches(switches4, this->location.at(4) );
82
83 FloatMatrix k21_node1, k22_node1, k21_node2, k22_node2, k21_node3, k22_node3, k21_node4, k22_node4;
84 k21_node1.resize(3, 3);
85 k22_node1.resize(3, 3);
86 k21_node2.resize(3, 3);
87 k22_node2.resize(3, 3);
88 k21_node3.resize(3, 3);
89 k22_node3.resize(3, 3);
90 k21_node4.resize(3, 3);
91 k22_node4.resize(3, 3);
92
93 k21_node1.at(1, 1) = unitCellSize.at(1) * switches1.at(1);
94 k21_node1.at(2, 2) = unitCellSize.at(2) * switches1.at(2);
95 k21_node1.at(3, 3) = unitCellSize.at(3) * switches1.at(3);
96
97 k22_node1.at(1, 2) = unitCellSize.at(3) * switches1.at(3);
98 k22_node1.at(1, 3) = unitCellSize.at(2) * switches1.at(2);
99 k22_node1.at(2, 1) = unitCellSize.at(3) * switches1.at(3);
100
101 k21_node2.at(1, 1) = unitCellSize.at(1) * switches2.at(1);
102 k21_node2.at(2, 2) = unitCellSize.at(2) * switches2.at(2);
103 k21_node2.at(3, 3) = unitCellSize.at(3) * switches2.at(3);
104
105 k22_node2.at(1, 2) = unitCellSize.at(3) * switches2.at(3);
106 k22_node2.at(1, 3) = unitCellSize.at(2) * switches2.at(2);
107 k22_node2.at(2, 1) = unitCellSize.at(3) * switches2.at(3);
108
109 k21_node3.at(1, 1) = unitCellSize.at(1) * switches3.at(1);
110 k21_node3.at(2, 2) = unitCellSize.at(2) * switches3.at(2);
111 k21_node3.at(3, 3) = unitCellSize.at(3) * switches3.at(3);
112
113 k22_node3.at(1, 2) = unitCellSize.at(3) * switches3.at(3);
114 k22_node3.at(1, 3) = unitCellSize.at(2) * switches3.at(2);
115 k22_node3.at(2, 1) = unitCellSize.at(3) * switches3.at(3);
116
117 k21_node4.at(1, 1) = unitCellSize.at(1) * switches4.at(1);
118 k21_node4.at(2, 2) = unitCellSize.at(2) * switches4.at(2);
119 k21_node4.at(3, 3) = unitCellSize.at(3) * switches4.at(3);
120
121 k22_node4.at(1, 2) = unitCellSize.at(3) * switches4.at(3);
122 k22_node4.at(1, 3) = unitCellSize.at(2) * switches4.at(2);
123 k22_node4.at(2, 1) = unitCellSize.at(3) * switches4.at(3);
124
125 answer.resize(12, 12);
126 answer.beUnitMatrix();
127 answer.resizeWithData(12, 18);
128
129 answer.assemble(k21_node1, { 1, 2, 3 }, { 13, 14, 15 });
130 answer.assemble(k22_node1, { 1, 2, 3 }, { 16, 17, 18 });
131 answer.assemble(k21_node2, { 4, 5, 6 }, { 13, 14, 15 });
132 answer.assemble(k22_node2, { 4, 5, 6 }, { 16, 17, 18 });
133 answer.assemble(k21_node3, { 7, 8, 9 }, { 13, 14, 15 });
134 answer.assemble(k22_node3, { 7, 8, 9 }, { 16, 17, 18 });
135 answer.assemble(k21_node4, { 10, 11, 12 }, { 13, 14, 15 });
136 answer.assemble(k22_node4, { 10, 11, 12 }, { 16, 17, 18 });
137}
138} // end namespace oofem
#define REGISTER_Element(class)
Node * giveNode(int i) const
Definition element.h:629
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void resizeWithData(Index, Index)
Definition floatmatrix.C:91
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void assemble(const FloatMatrix &src, const IntArray &loc)
double at(std::size_t i, std::size_t j) const
void beUnitMatrix()
Sets receiver to unity matrix.
int & at(std::size_t i)
Definition intarray.h:104
void giveSwitches(IntArray &answer, int location)
LTRSpaceBoundary(int n, Domain *d)

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011