35#include "tr2shell7phfi.h"
41#include "equationid.h"
55IntArray Tr2Shell7PhFi :: ordering_disp(42);
56IntArray Tr2Shell7PhFi :: ordering_disp_inv(42);
57IntArray Tr2Shell7PhFi :: ordering_base(42);
58IntArray Tr2Shell7PhFi :: ordering_base_inv(42);
59IntArray Tr2Shell7PhFi:: ordering_all(1);
60IntArray Tr2Shell7PhFi:: ordering_damage(1);
61IntArray Tr2Shell7PhFi :: ordering_gr(1);
62IntArray Tr2Shell7PhFi :: ordering_gr_edge(21);
63bool Tr2Shell7PhFi :: __initialized = Tr2Shell7PhFi :: initOrdering();
66Tr2Shell7PhFi:: Tr2Shell7PhFi(
int n,
Domain *aDomain) : Shell7BasePhFi(n, aDomain)
68 this->numberOfDofMans = 6;
70 this->ordering_damage.resize(0);
71 this->ordering_gr.resize(0);
72 this->ordering_disp_inv.resize(0);
77 localDisp.setValues(7, 1, 2, 3, 19, 20, 21, 37);
79 for (
int i = 1; i <= numberOfLayers; i++) {
84 int numDofsPerNode = 7 + numberOfLayers;
86 for (
int i = 1; i <= this->numberOfDofMans; i++) {
87 this->ordering_damage.followedBy(localDam);
88 this->ordering_gr.followedBy(localDisp);
89 this->ordering_gr.followedBy(localDam);
90 this->ordering_disp_inv.followedBy(localDisp);
100 localDam.
add(numberOfLayers);
104 this->ordering_all.resize(0);
105 this->ordering_all = this->ordering_disp;
106 this->ordering_all.followedBy(ordering_damage);
110 IntArray temp_x(0), temp_m(0), temp_dam(0), local_temp_x(0), local_temp_m(0), local_temp_gam(0), local_temp_dam(0);
111 temp_x.setValues(3, 1, 2, 3);
112 temp_m.setValues(3, 4, 5, 6);
115 for (
int i = 1; i <= numberOfLayers; i++) {
116 temp_dam.followedBy(7 + i);
119 for (
int i = 1; i <= this->numberOfDofMans; i++) {
120 local_temp_x.followedBy(temp_x);
121 local_temp_m.followedBy(temp_m);
122 local_temp_gam.followedBy(temp_gam);
123 local_temp_dam.followedBy(temp_dam);
124 temp_x.add(numDofsPerNode);
125 temp_m.add(numDofsPerNode);
126 temp_gam +=numDofsPerNode;
127 temp_dam.add(numDofsPerNode);
135 ordering_disp.resize(0);
136 ordering_damage.resize(0);
137 this->ordering_disp.followedBy(local_temp_x);
138 this->ordering_disp.followedBy(local_temp_m);
139 this->ordering_disp.followedBy(local_temp_gam);
140 this->ordering_damage = local_temp_dam;
147Tr2Shell7PhFi :: giveDofManDofIDMask_u(IntArray &answer)
149 Shell7BasePhFi :: giveDofManDofIDMask_u(answer);
153Tr2Shell7PhFi :: giveDofManDofIDMask_d(IntArray &answer)
155 Shell7BasePhFi :: giveDofManDofIDMask_d(answer);
159Tr2Shell7PhFi:: giveOrdering(SolutionField fieldType)
const
161 OOFEM_ERROR(
"Tr2Shell7PhFi :: giveOrdering not implemented: Use Tr2Shell7PhFi :: giveOrderingPhFi instead");
167Tr2Shell7PhFi:: giveOrderingPhFi(SolutionFieldPhFi fieldType)
const
169 if ( fieldType == All ) {
170 return this->ordering_all;
171 }
else if ( fieldType == Displacement ) {
172 return this->ordering_disp;
173 }
else if ( fieldType == Damage ) {
174 return this->ordering_damage;
175 }
else if ( fieldType == AllInv ) {
176 return this->ordering_gr;
178 OOFEM_ERROR(
"Tr2Shell7PhFi :: giveOrdering: the requested ordering is not implemented")
184Tr2Shell7PhFi :: giveOrdering_All()
const
186 return this->ordering_base;
190Tr2Shell7PhFi :: giveOrdering_AllInv()
const
193 return this->ordering_base_inv;
197Tr2Shell7PhFi :: giveOrdering_Disp()
const
199 return this->ordering_disp;
203Tr2Shell7PhFi :: giveOrdering_Damage()
const
205 return this->ordering_damage;
210Tr2Shell7PhFi:: giveLocalNodeCoords(FloatArray &nodeLocalXiCoords, FloatArray &nodeLocalEtaCoords)
212 nodeLocalXiCoords.setValues(6, 1., 0., 0., .5, 0., .5);
213 nodeLocalEtaCoords.setValues(6, 0., 1., 0., .5, .5, 0.);
217FEInterpolation *Tr2Shell7PhFi:: giveInterpolation()
const {
return & interpolation; }
221Tr2Shell7PhFi:: computeGaussPoints()
223 if ( !integrationRulesArray ) {
226 specialIntegrationRulesArray =
new IntegrationRule * [ 3 ];
231 specialIntegrationRulesArray [ 1 ] =
new GaussIntegrationRule(1,
this);
232 specialIntegrationRulesArray [ 1 ]->SetUpPointsOnWedge(nPointsTri, 1, _3dMat);
236 specialIntegrationRulesArray [ 2 ] =
new GaussIntegrationRule(1,
this);
237 specialIntegrationRulesArray [ 2 ]->SetUpPointsOnLine(nPointsEdge, _3dMat);
242 LayeredCrossSection *layeredCS =
dynamic_cast< LayeredCrossSection *
>( Tr2Shell7PhFi:: giveCrossSection() );
243 if ( layeredCS == NULL ) {
244 OOFEM_ERROR(
"Tr2Shell7PhFionly supports layered cross section");
246 this->numberOfIntegrationRules = layeredCS->giveNumberOfLayers();
247 this->numberOfGaussPoints = layeredCS->giveNumberOfLayers() * nPointsTri * layeredCS->giveNumIntegrationPointsInLayer();
248 layeredCS->setupLayeredIntegrationRule(integrationRulesArray,
this, nPointsTri);
252 specialIntegrationRulesArray [ 0 ] =
new GaussIntegrationRule(1,
this);
253 specialIntegrationRulesArray [ 0 ]->SetUpPointsOnLine(layeredCS->giveNumIntegrationPointsInLayer(), _3dMat);
259Tr2Shell7PhFi:: giveEdgeDofMapping(IntArray &answer,
int iEdge)
const
268 answer.setValues(21, 1, 2, 3, 8, 9, 10, 22, 23, 24, 4, 5, 6, 11, 12, 13, 25, 26, 27, 7, 14, 28);
269 }
else if ( iEdge == 2 ) {
271 answer.setValues(21, 8, 9, 10, 15, 16, 17, 29, 30, 31, 11, 12, 13, 18, 19, 20, 32, 33, 34, 14, 21, 35);
272 }
else if ( iEdge == 3 ) {
274 answer.setValues(21, 15, 16, 17, 1, 2, 3, 36, 37, 38, 18, 19, 20, 4, 5, 6, 39, 40, 41, 21, 7, 42);
276 _error(
"giveEdgeDofMapping: wrong edge number");
282Tr2Shell7PhFi::giveSurfaceDofMapping(IntArray &answer,
int iSurf)
const
285 for (
int i = 1; i <= 42; i++ ) {
292Tr2Shell7PhFi::computeAreaAround(GaussPoint *gp,
double xi)
294 FloatArray G1, G2, temp;
296 FloatArray lcoords(3);
297 lcoords.at(1) = gp->giveCoordinate(1);
298 lcoords.at(2) = gp->giveCoordinate(2);
300 this->evalInitialCovarBaseVectorsAt(lcoords, Gcov);
301 G1.beColumnOf(Gcov, 1);
302 G2.beColumnOf(Gcov, 2);
303 temp.beVectorProductOf(G1, G2);
304 double detJ = temp.computeNorm();
305 return detJ * gp->giveWeight();
310Tr2Shell7PhFi::computeVolumeAroundLayer(GaussPoint *gp,
int layer)
315 lcoords = * gp->giveCoordinates();
316 this->evalInitialCovarBaseVectorsAt(lcoords, Gcov);
317 detJ = Gcov.giveDeterminant() * 0.5 * this->layeredCS->giveLayerThickness(layer);
318 return detJ * gp->giveWeight();
323Tr2Shell7PhFi:: compareMatrices(
const FloatMatrix &matrix1,
const FloatMatrix &matrix2, FloatMatrix &answer)
326 answer.resize(ndofs, ndofs);
327 for (
int i = 1; i <= ndofs; i++ ) {
328 for (
int j = 1; j <= 18; j++ ) {
329 if ( fabs( matrix1.at(i, j) ) > 1.0e-12 ) {
330 double diff = ( matrix1.at(i, j) - matrix2.at(i, j) );
331 double relDiff = diff / matrix1.at(i, j);
332 if ( fabs(relDiff) < 1.0e-4 ) {
333 answer.at(i, j) = 0.0;
334 }
else if ( fabs(diff) < 1.0e3 ) {
335 answer.at(i, j) = 0.0;
337 answer.at(i, j) = relDiff;
340 answer.at(i, j) = -1.0;
#define REGISTER_Element(class)
void followedBy(const IntArray &b, int allocChunk=0)