3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
29 #include "MED_GaussUtils.hxx"
30 #include "MED_Utilities.hxx"
33 static int MYDEBUG = 0;
34 static int MYVALUEDEBUG = 0;
36 static int MYDEBUG = 0;
37 static int MYVALUEDEBUG = 0;
40 //#define _DEBUG_REF_COORDS_
44 //---------------------------------------------------------------
47 TModeSwitchInfo(eFULL_INTERLACE),
57 ::Init(TInt theNbElem,
62 myModeSwitch = theMode;
65 myNbGauss = theNbGauss;
68 myGaussStep = myNbGauss*myDim;
70 myGaussCoord.resize(theNbElem*myGaussStep);
76 ::GetCoordSliceArr(TInt theElemId) const
78 TCCoordSliceArr aCoordSliceArr(myNbGauss);
79 if(GetModeSwitch() == eFULL_INTERLACE){
80 TInt anId = theElemId*myGaussStep;
81 for(TInt anGaussId = 0; anGaussId < myNbGauss; anGaussId++){
82 aCoordSliceArr[anGaussId] =
83 TCCoordSlice(myGaussCoord,std::slice(anId,myDim,1));
88 for(TInt anGaussId = 0; anGaussId < myNbGauss; anGaussId++){
89 aCoordSliceArr[anGaussId] =
90 TCCoordSlice(myGaussCoord,std::slice(theElemId,myDim,myGaussStep));
93 return aCoordSliceArr;
99 ::GetCoordSliceArr(TInt theElemId)
101 TCoordSliceArr aCoordSliceArr(myNbGauss);
102 if(GetModeSwitch() == eFULL_INTERLACE){
103 TInt anId = theElemId*myGaussStep;
104 for(TInt anGaussId = 0; anGaussId < myNbGauss; anGaussId++){
105 aCoordSliceArr[anGaussId] =
106 TCoordSlice(myGaussCoord,std::slice(anId,myDim,1));
111 for(TInt anGaussId = 0; anGaussId < myNbGauss; anGaussId++){
112 aCoordSliceArr[anGaussId] =
113 TCoordSlice(myGaussCoord,std::slice(theElemId,myDim,myGaussStep));
116 return aCoordSliceArr;
120 //---------------------------------------------------------------
123 IsEqual(TFloat theLeft, TFloat theRight)
125 static TFloat EPS = 1.0E-3;
126 if(fabs(theLeft) + fabs(theRight) > EPS)
127 return fabs(theLeft-theRight)/(fabs(theLeft)+fabs(theRight)) < EPS;
142 Init(TInt theNbGauss,
145 myFun.resize(theNbGauss*theNbRef);
150 GetFunSlice(TInt theGaussId) const
152 return TCFloatVecSlice(myFun,std::slice(theGaussId*myNbRef,myNbRef,1));
156 GetFunSlice(TInt theGaussId)
158 return TFloatVecSlice(myFun,std::slice(theGaussId*myNbRef,myNbRef,1));
162 typedef TVector<TCCoordSlice> TCCoordSliceArr;
163 typedef TVector<TCoordSlice> TCoordSliceArr;
165 TFloatVector myRefCoord;
169 TShapeFun(TInt theDim = 0, TInt theNbRef = 0):
172 myRefCoord(theNbRef*theDim)
182 GetCoord(TInt theRefId) const
184 return TCCoordSlice(myRefCoord,std::slice(theRefId*myDim,myDim,1));
188 GetCoord(TInt theRefId)
190 return TCoordSlice(myRefCoord,std::slice(theRefId*myDim,myDim,1));
194 GetFun(const TShapeFun::TCCoordSliceArr& theRef,
195 const TShapeFun::TCCoordSliceArr& theGauss,
198 TInt aNbRef = theRef.size();
199 TInt aNbGauss = theGauss.size();
200 theFun.Init(aNbGauss,aNbRef);
205 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
206 const TShapeFun::TCCoordSliceArr& theGauss,
207 TFun& theFun) const = 0;
211 IsSatisfy(const TShapeFun::TCCoordSliceArr& theRefCoord) const
213 TInt aNbRef = theRefCoord.size();
214 TInt aNbRef2 = GetNbRef();
215 INITMSG(MYDEBUG,"TShapeFun::IsSatisfy "<<
216 "- aNbRef("<<aNbRef<<")"<<
217 "; aNbRef2("<<aNbRef2<<")\n");
218 bool anIsSatisfy = (aNbRef == aNbRef2);
220 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
221 const TCCoordSlice& aCoord2 = theRefCoord[aRefId];
222 TCCoordSlice aCoord = GetCoord(aRefId);
223 TInt aDim = aCoord.size();
224 bool anIsEqual = false;
225 for(TInt anId = 0; anId < aDim; anId++){
226 anIsEqual = IsEqual(aCoord[anId],aCoord2[anId]);
233 TCCoordSlice aCoord = GetCoord(aRefId);
234 INITMSG(MYDEBUG,aRefId + 1<<": aCoord = {");
235 TInt aDim = aCoord.size();
236 for(TInt anId = 0; anId < aDim; anId++)
237 ADDMSG(MYDEBUG,"\t"<<aCoord[anId]);
238 const TCCoordSlice& aCoord2 = theRefCoord[aRefId];
239 ADDMSG(MYDEBUG,"}\t!=\taCoord2 = {");
240 for(TInt anId = 0; anId < aDim; anId++)
241 ADDMSG(MYDEBUG,"\t"<<aCoord2[anId]);
242 ADDMSG(MYDEBUG,"}\n");
254 Eval(const TCellInfo& theCellInfo,
255 const TNodeInfo& theNodeInfo,
256 const TElemNum& theElemNum,
257 const TShapeFun::TCCoordSliceArr& theRef,
258 const TShapeFun::TCCoordSliceArr& theGauss,
259 TGaussCoord& theGaussCoord,
262 INITMSG(MYDEBUG,"TShapeFun::Eval"<<endl);
264 if(IsSatisfy(theRef)){
265 const PMeshInfo& aMeshInfo = theCellInfo.GetMeshInfo();
266 TInt aDim = aMeshInfo->GetDim();
267 TInt aNbGauss = theGauss.size();
269 bool anIsSubMesh = !theElemNum.empty();
272 aNbElem = theElemNum.size();
274 aNbElem = theCellInfo.GetNbElem();
276 theGaussCoord.Init(aNbElem,aNbGauss,aDim,theMode);
279 InitFun(theRef,theGauss,aFun);
280 TInt aConnDim = theCellInfo.GetConnDim();
282 INITMSG(MYDEBUG,"aDim = "<<aDim<<
283 "; aNbGauss = "<<aNbGauss<<
284 "; aNbElem = "<<aNbElem<<
285 "; aNbNodes = "<<theNodeInfo.GetNbElem()<<
288 for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
289 TInt aCellId = anIsSubMesh? theElemNum[anElemId]-1: anElemId;
290 TCConnSlice aConnSlice = theCellInfo.GetConnSlice(aCellId);
291 TCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
293 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
294 TCoordSlice& aGaussCoordSlice = aCoordSliceArr[aGaussId];
295 TCFloatVecSlice aFunSlice = aFun.GetFunSlice(aGaussId);
297 for(TInt aConnId = 0; aConnId < aConnDim; aConnId++){
298 TInt aNodeId = aConnSlice[aConnId] - 1;
299 TCCoordSlice aNodeCoordSlice = theNodeInfo.GetCoordSlice(aNodeId);
301 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
302 aGaussCoordSlice[aDimId] += aNodeCoordSlice[aDimId]*aFunSlice[aConnId];
310 INITMSG(MYVALUEDEBUG,"theGauss: ");
311 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
312 TCCoordSlice aCoordSlice = theGauss[aGaussId];
313 ADDMSG(MYVALUEDEBUG,"{");
314 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
315 ADDMSG(MYVALUEDEBUG,aCoordSlice[aDimId]<<" ");
317 ADDMSG(MYVALUEDEBUG,"} ");
319 ADDMSG(MYVALUEDEBUG,endl);
321 for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
322 TCCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
323 INITMSG(MYVALUEDEBUG,"");
324 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
325 TCCoordSlice aCoordSlice = aCoordSliceArr[aGaussId];
326 ADDMSG(MYVALUEDEBUG,"{");
327 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
328 ADDMSG(MYVALUEDEBUG,aCoordSlice[aDimId]<<" ");
330 ADDMSG(MYVALUEDEBUG,"} ");
332 ADDMSG(MYVALUEDEBUG,endl);
343 //---------------------------------------------------------------
344 struct TSeg2a: TShapeFun
349 TInt aNbRef = GetNbRef();
350 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
351 TCoordSlice aCoord = GetCoord(aRefId);
353 case 0: aCoord[0] = -1.0; break;
354 case 1: aCoord[0] = 1.0; break;
361 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
362 const TShapeFun::TCCoordSliceArr& theGauss,
365 GetFun(theRef,theGauss,theFun);
367 TInt aNbGauss = theGauss.size();
368 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
369 const TCCoordSlice& aCoord = theGauss[aGaussId];
370 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
372 aSlice[0] = 0.5*(1.0 - aCoord[0]);
373 aSlice[1] = 0.5*(1.0 + aCoord[0]);
379 //---------------------------------------------------------------
380 struct TSeg3a: TShapeFun
385 TInt aNbRef = GetNbRef();
386 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
387 TCoordSlice aCoord = GetCoord(aRefId);
389 case 0: aCoord[0] = -1.0; break;
390 case 1: aCoord[0] = 1.0; break;
391 case 2: aCoord[0] = 0.0; break;
398 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
399 const TShapeFun::TCCoordSliceArr& theGauss,
402 GetFun(theRef,theGauss,theFun);
404 TInt aNbGauss = theGauss.size();
405 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
406 const TCCoordSlice& aCoord = theGauss[aGaussId];
407 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
409 aSlice[0] = 0.5*(1.0 - aCoord[0])*aCoord[0];
410 aSlice[1] = 0.5*(1.0 + aCoord[0])*aCoord[0];
411 aSlice[2] = (1.0 + aCoord[0])*(1.0 - aCoord[0]);
417 //---------------------------------------------------------------
418 struct TTria3a: TShapeFun
423 TInt aNbRef = GetNbRef();
424 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
425 TCoordSlice aCoord = GetCoord(aRefId);
427 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; break;
428 case 1: aCoord[0] = -1.0; aCoord[1] = -1.0; break;
429 case 2: aCoord[0] = 1.0; aCoord[1] = -1.0; break;
436 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
437 const TShapeFun::TCCoordSliceArr& theGauss,
440 GetFun(theRef,theGauss,theFun);
442 TInt aNbGauss = theGauss.size();
443 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
444 const TCCoordSlice& aCoord = theGauss[aGaussId];
445 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
447 aSlice[0] = 0.5*(1.0 + aCoord[1]);
448 aSlice[1] = -0.5*(aCoord[0] + aCoord[1]);
449 aSlice[2] = 0.5*(1.0 + aCoord[0]);
455 //---------------------------------------------------------------
456 struct TTria6a: TShapeFun
461 TInt aNbRef = GetNbRef();
462 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
463 TCoordSlice aCoord = GetCoord(aRefId);
465 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; break;
466 case 1: aCoord[0] = -1.0; aCoord[1] = -1.0; break;
467 case 2: aCoord[0] = 1.0; aCoord[1] = -1.0; break;
469 case 3: aCoord[0] = -1.0; aCoord[1] = 1.0; break;
470 case 4: aCoord[0] = 0.0; aCoord[1] = -1.0; break;
471 case 5: aCoord[0] = 0.0; aCoord[1] = 0.0; break;
478 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
479 const TShapeFun::TCCoordSliceArr& theGauss,
482 GetFun(theRef,theGauss,theFun);
484 TInt aNbGauss = theGauss.size();
485 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
486 const TCCoordSlice& aCoord = theGauss[aGaussId];
487 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
489 aSlice[0] = 0.5*(1.0 + aCoord[1])*aCoord[1];
490 aSlice[1] = 0.5*(aCoord[0] + aCoord[1])*(aCoord[0] + aCoord[1] + 1);
491 aSlice[2] = 0.5*(1.0 + aCoord[0])*aCoord[0];
493 aSlice[3] = -1.0*(1.0 + aCoord[1])*(aCoord[0] + aCoord[1]);
494 aSlice[4] = -1.0*(1.0 + aCoord[0])*(aCoord[0] + aCoord[1]);
495 aSlice[5] = (1.0 + aCoord[1])*(1.0 + aCoord[1]);
501 //---------------------------------------------------------------
502 struct TTria3b: TShapeFun
507 TInt aNbRef = GetNbRef();
508 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
509 TCoordSlice aCoord = GetCoord(aRefId);
511 case 0: aCoord[0] = 0.0; aCoord[1] = 0.0; break;
512 case 1: aCoord[0] = 1.0; aCoord[1] = 0.0; break;
513 case 2: aCoord[0] = 0.0; aCoord[1] = 1.0; break;
520 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
521 const TShapeFun::TCCoordSliceArr& theGauss,
524 GetFun(theRef,theGauss,theFun);
526 TInt aNbGauss = theGauss.size();
527 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
528 const TCCoordSlice& aCoord = theGauss[aGaussId];
529 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
531 aSlice[0] = 1.0 - aCoord[0] - aCoord[1];
532 aSlice[1] = aCoord[0];
533 aSlice[2] = aCoord[1];
539 //---------------------------------------------------------------
540 struct TTria6b: TShapeFun
545 TInt aNbRef = GetNbRef();
546 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
547 TCoordSlice aCoord = GetCoord(aRefId);
549 case 0: aCoord[0] = 0.0; aCoord[1] = 0.0; break;
550 case 1: aCoord[0] = 1.0; aCoord[1] = 0.0; break;
551 case 2: aCoord[0] = 0.0; aCoord[1] = 1.0; break;
553 case 3: aCoord[0] = 0.5; aCoord[1] = 0.0; break;
554 case 4: aCoord[0] = 0.5; aCoord[1] = 0.5; break;
555 case 5: aCoord[0] = 0.0; aCoord[1] = 0.5; break;
562 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
563 const TShapeFun::TCCoordSliceArr& theGauss,
566 GetFun(theRef,theGauss,theFun);
568 TInt aNbGauss = theGauss.size();
569 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
570 const TCCoordSlice& aCoord = theGauss[aGaussId];
571 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
573 aSlice[0] = (1.0 - aCoord[0] - aCoord[1])*(1.0 - 2.0*aCoord[0] - 2.0*aCoord[1]);
574 aSlice[1] = aCoord[0]*(2.0*aCoord[0] - 1.0);
575 aSlice[2] = aCoord[1]*(2.0*aCoord[1] - 1.0);
577 aSlice[3] = 4.0*aCoord[0]*(1.0 - aCoord[0] - aCoord[1]);
578 aSlice[4] = 4.0*aCoord[0]*aCoord[1];
579 aSlice[5] = 4.0*aCoord[1]*(1.0 - aCoord[0] - aCoord[1]);
585 //---------------------------------------------------------------
586 struct TQuad4a: TShapeFun
591 TInt aNbRef = GetNbRef();
592 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
593 TCoordSlice aCoord = GetCoord(aRefId);
595 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; break;
596 case 1: aCoord[0] = -1.0; aCoord[1] = -1.0; break;
597 case 2: aCoord[0] = 1.0; aCoord[1] = -1.0; break;
598 case 3: aCoord[0] = 1.0; aCoord[1] = 1.0; break;
605 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
606 const TShapeFun::TCCoordSliceArr& theGauss,
609 GetFun(theRef,theGauss,theFun);
611 TInt aNbGauss = theGauss.size();
612 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
613 const TCCoordSlice& aCoord = theGauss[aGaussId];
614 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
616 aSlice[0] = 0.25*(1.0 + aCoord[1])*(1.0 - aCoord[0]);
617 aSlice[1] = 0.25*(1.0 - aCoord[1])*(1.0 - aCoord[0]);
618 aSlice[2] = 0.25*(1.0 - aCoord[1])*(1.0 + aCoord[0]);
619 aSlice[3] = 0.25*(1.0 + aCoord[0])*(1.0 + aCoord[1]);
625 //---------------------------------------------------------------
626 struct TQuad8a: TShapeFun
631 TInt aNbRef = GetNbRef();
632 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
633 TCoordSlice aCoord = GetCoord(aRefId);
635 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; break;
636 case 1: aCoord[0] = -1.0; aCoord[1] = -1.0; break;
637 case 2: aCoord[0] = 1.0; aCoord[1] = -1.0; break;
638 case 3: aCoord[0] = 1.0; aCoord[1] = 1.0; break;
640 case 4: aCoord[0] = -1.0; aCoord[1] = 0.0; break;
641 case 5: aCoord[0] = 0.0; aCoord[1] = -1.0; break;
642 case 6: aCoord[0] = 1.0; aCoord[1] = 0.0; break;
643 case 7: aCoord[0] = 0.0; aCoord[1] = 1.0; break;
650 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
651 const TShapeFun::TCCoordSliceArr& theGauss,
654 GetFun(theRef,theGauss,theFun);
656 TInt aNbGauss = theGauss.size();
657 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
658 const TCCoordSlice& aCoord = theGauss[aGaussId];
659 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
661 aSlice[0] = 0.25*(1.0 + aCoord[1])*(1.0 - aCoord[0])*(aCoord[1] - aCoord[0] - 1.0);
662 aSlice[1] = 0.25*(1.0 - aCoord[1])*(1.0 - aCoord[0])*(-aCoord[1] - aCoord[0] - 1.0);
663 aSlice[2] = 0.25*(1.0 - aCoord[1])*(1.0 + aCoord[0])*(-aCoord[1] + aCoord[0] - 1.0);
664 aSlice[3] = 0.25*(1.0 + aCoord[1])*(1.0 + aCoord[0])*(aCoord[1] + aCoord[0] - 1.0);
666 aSlice[4] = 0.5*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[1]);
667 aSlice[5] = 0.5*(1.0 - aCoord[1])*(1.0 - aCoord[0])*(1.0 + aCoord[0]);
668 aSlice[6] = 0.5*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[1]);
669 aSlice[7] = 0.5*(1.0 + aCoord[1])*(1.0 - aCoord[0])*(1.0 + aCoord[0]);
675 //---------------------------------------------------------------
676 struct TQuad4b: TShapeFun
681 TInt aNbRef = GetNbRef();
682 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
683 TCoordSlice aCoord = GetCoord(aRefId);
685 case 0: aCoord[0] = -1.0; aCoord[1] = -1.0; break;
686 case 1: aCoord[0] = 1.0; aCoord[1] = -1.0; break;
687 case 2: aCoord[0] = 1.0; aCoord[1] = 1.0; break;
688 case 3: aCoord[0] = -1.0; aCoord[1] = 1.0; break;
695 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
696 const TShapeFun::TCCoordSliceArr& theGauss,
699 GetFun(theRef,theGauss,theFun);
701 TInt aNbGauss = theGauss.size();
702 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
703 const TCCoordSlice& aCoord = theGauss[aGaussId];
704 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
706 aSlice[0] = 0.25*(1.0 - aCoord[0])*(1.0 - aCoord[1]);
707 aSlice[1] = 0.25*(1.0 + aCoord[0])*(1.0 - aCoord[1]);
708 aSlice[2] = 0.25*(1.0 + aCoord[0])*(1.0 + aCoord[1]);
709 aSlice[3] = 0.25*(1.0 - aCoord[0])*(1.0 + aCoord[1]);
715 //---------------------------------------------------------------
716 struct TQuad8b: TShapeFun
721 TInt aNbRef = GetNbRef();
722 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
723 TCoordSlice aCoord = GetCoord(aRefId);
725 case 0: aCoord[0] = -1.0; aCoord[1] = -1.0; break;
726 case 1: aCoord[0] = 1.0; aCoord[1] = -1.0; break;
727 case 2: aCoord[0] = 1.0; aCoord[1] = 1.0; break;
728 case 3: aCoord[0] = -1.0; aCoord[1] = 1.0; break;
730 case 4: aCoord[0] = 0.0; aCoord[1] = -1.0; break;
731 case 5: aCoord[0] = 1.0; aCoord[1] = 0.0; break;
732 case 6: aCoord[0] = 0.0; aCoord[1] = 1.0; break;
733 case 7: aCoord[0] = -1.0; aCoord[1] = 0.0; break;
740 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
741 const TShapeFun::TCCoordSliceArr& theGauss,
744 GetFun(theRef,theGauss,theFun);
746 TInt aNbGauss = theGauss.size();
747 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
748 const TCCoordSlice& aCoord = theGauss[aGaussId];
749 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
751 aSlice[0] = 0.25*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(-1.0 - aCoord[0] - aCoord[1]);
752 aSlice[1] = 0.25*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(-1.0 + aCoord[0] - aCoord[1]);
753 aSlice[2] = 0.25*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(-1.0 + aCoord[0] + aCoord[1]);
754 aSlice[3] = 0.25*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(-1.0 - aCoord[0] + aCoord[1]);
756 aSlice[4] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1]);
757 aSlice[5] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 + aCoord[0]);
758 aSlice[6] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 + aCoord[1]);
759 aSlice[7] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[0]);
765 //---------------------------------------------------------------
766 struct TTetra4a: TShapeFun
771 TInt aNbRef = GetNbRef();
772 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
773 TCoordSlice aCoord = GetCoord(aRefId);
775 case 0: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
776 case 1: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
777 case 2: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
778 case 3: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
785 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
786 const TShapeFun::TCCoordSliceArr& theGauss,
789 GetFun(theRef,theGauss,theFun);
791 TInt aNbGauss = theGauss.size();
792 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
793 const TCCoordSlice& aCoord = theGauss[aGaussId];
794 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
796 aSlice[0] = aCoord[1];
797 aSlice[1] = aCoord[2];
798 aSlice[2] = 1.0 - aCoord[0] - aCoord[1] - aCoord[2];
799 aSlice[3] = aCoord[0];
805 //---------------------------------------------------------------
806 struct TTetra10a: TShapeFun
811 TInt aNbRef = GetNbRef();
812 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
813 TCoordSlice aCoord = GetCoord(aRefId);
815 case 0: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
816 case 1: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
817 case 2: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
818 case 3: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
820 case 4: aCoord[0] = 0.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
821 case 5: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
822 case 6: aCoord[0] = 0.0; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
824 case 7: aCoord[0] = 0.5; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
825 case 8: aCoord[0] = 0.5; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
826 case 9: aCoord[0] = 0.5; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
833 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
834 const TShapeFun::TCCoordSliceArr& theGauss,
837 GetFun(theRef,theGauss,theFun);
839 TInt aNbGauss = theGauss.size();
840 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
841 const TCCoordSlice& aCoord = theGauss[aGaussId];
842 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
844 aSlice[0] = aCoord[1]*(2.0*aCoord[1] - 1.0);
845 aSlice[1] = aCoord[2]*(2.0*aCoord[2] - 1.0);
846 aSlice[2] = (1.0 - aCoord[0] - aCoord[1] - aCoord[2])*(1.0 - 2.0*aCoord[0] - 2.0*aCoord[1] - 2.0*aCoord[2]);
847 aSlice[3] = aCoord[0]*(2.0*aCoord[0] - 1.0);
849 aSlice[4] = 4.0*aCoord[1]*aCoord[2];
850 aSlice[5] = 4.0*aCoord[2]*(1.0 - aCoord[0] - aCoord[1] - aCoord[2]);
851 aSlice[6] = 4.0*aCoord[1]*(1.0 - aCoord[0] - aCoord[1] - aCoord[2]);
853 aSlice[7] = 4.0*aCoord[0]*aCoord[1];
854 aSlice[8] = 4.0*aCoord[0]*aCoord[2];
855 aSlice[9] = 4.0*aCoord[0]*(1.0 - aCoord[0] - aCoord[1] - aCoord[2]);
861 //---------------------------------------------------------------
864 struct TTetra4b: TShapeFun
869 TInt aNbRef = GetNbRef();
870 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
871 TCoordSlice aCoord = GetCoord(aRefId);
873 case 0: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
874 case 2: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
875 case 1: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
876 case 3: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
883 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
884 const TShapeFun::TCCoordSliceArr& theGauss,
887 GetFun(theRef,theGauss,theFun);
889 TInt aNbGauss = theGauss.size();
890 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
891 const TCCoordSlice& aCoord = theGauss[aGaussId];
892 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
894 aSlice[0] = aCoord[1];
895 aSlice[2] = aCoord[2];
896 aSlice[1] = 1.0 - aCoord[0] - aCoord[1] - aCoord[2];
897 aSlice[3] = aCoord[0];
903 //---------------------------------------------------------------
904 struct TTetra10b: TShapeFun
909 TInt aNbRef = GetNbRef();
910 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
911 TCoordSlice aCoord = GetCoord(aRefId);
913 case 0: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
914 case 2: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
915 case 1: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
916 case 3: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
918 case 6: aCoord[0] = 0.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
919 case 5: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
920 case 4: aCoord[0] = 0.0; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
922 case 7: aCoord[0] = 0.5; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
923 case 9: aCoord[0] = 0.5; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
924 case 8: aCoord[0] = 0.5; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
931 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
932 const TShapeFun::TCCoordSliceArr& theGauss,
935 GetFun(theRef,theGauss,theFun);
937 TInt aNbGauss = theGauss.size();
938 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
939 const TCCoordSlice& aCoord = theGauss[aGaussId];
940 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
942 aSlice[0] = aCoord[1]*(2.0*aCoord[1] - 1.0);
943 aSlice[2] = aCoord[2]*(2.0*aCoord[2] - 1.0);
944 aSlice[1] = (1.0 - aCoord[0] - aCoord[1] - aCoord[2])*(1.0 - 2.0*aCoord[0] - 2.0*aCoord[1] - 2.0*aCoord[2]);
945 aSlice[3] = aCoord[0]*(2.0*aCoord[0] - 1.0);
947 aSlice[6] = 4.0*aCoord[1]*aCoord[2];
948 aSlice[5] = 4.0*aCoord[2]*(1.0 - aCoord[0] - aCoord[1] - aCoord[2]);
949 aSlice[4] = 4.0*aCoord[1]*(1.0 - aCoord[0] - aCoord[1] - aCoord[2]);
951 aSlice[7] = 4.0*aCoord[0]*aCoord[1];
952 aSlice[9] = 4.0*aCoord[0]*aCoord[2];
953 aSlice[8] = 4.0*aCoord[0]*(1.0 - aCoord[0] - aCoord[1] - aCoord[2]);
959 //---------------------------------------------------------------
960 struct THexa8a: TShapeFun
965 TInt aNbRef = GetNbRef();
966 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
967 TCoordSlice aCoord = GetCoord(aRefId);
969 case 0: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
970 case 1: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
971 case 2: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
972 case 3: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
973 case 4: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
974 case 5: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
975 case 6: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
976 case 7: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
983 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
984 const TShapeFun::TCCoordSliceArr& theGauss,
987 GetFun(theRef,theGauss,theFun);
989 TInt aNbGauss = theGauss.size();
990 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
991 const TCCoordSlice& aCoord = theGauss[aGaussId];
992 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
994 aSlice[0] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2]);
995 aSlice[1] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2]);
996 aSlice[2] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2]);
997 aSlice[3] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2]);
999 aSlice[4] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2]);
1000 aSlice[5] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2]);
1001 aSlice[6] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2]);
1002 aSlice[7] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2]);
1007 //---------------------------------------------------------------
1008 struct THexa20a: TShapeFun
1010 THexa20a(TInt theDim = 3, TInt theNbRef = 20):
1011 TShapeFun(theDim,theNbRef)
1013 TInt aNbRef = myRefCoord.size();
1014 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1015 TCoordSlice aCoord = GetCoord(aRefId);
1017 case 0: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1018 case 1: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1019 case 2: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1020 case 3: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1021 case 4: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1022 case 5: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1023 case 6: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1024 case 7: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1026 case 8: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1027 case 9: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = -1.0; break;
1028 case 10: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1029 case 11: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = -1.0; break;
1030 case 12: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1031 case 13: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1032 case 14: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1033 case 15: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1034 case 16: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1035 case 17: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1036 case 18: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1037 case 19: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1044 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1045 const TShapeFun::TCCoordSliceArr& theGauss,
1048 GetFun(theRef,theGauss,theFun);
1050 TInt aNbGauss = theGauss.size();
1051 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1052 const TCCoordSlice& aCoord = theGauss[aGaussId];
1053 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1055 aSlice[0] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2])*
1056 (-2.0 - aCoord[0] - aCoord[1] - aCoord[2]);
1057 aSlice[1] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2])*
1058 (-2.0 + aCoord[0] - aCoord[1] - aCoord[2]);
1059 aSlice[2] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2])*
1060 (-2.0 + aCoord[0] + aCoord[1] - aCoord[2]);
1061 aSlice[3] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2])*
1062 (-2.0 - aCoord[0] + aCoord[1] - aCoord[2]);
1063 aSlice[4] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2])*
1064 (-2.0 - aCoord[0] - aCoord[1] + aCoord[2]);
1065 aSlice[5] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2])*
1066 (-2.0 + aCoord[0] - aCoord[1] + aCoord[2]);
1067 aSlice[6] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2])*
1068 (-2.0 + aCoord[0] + aCoord[1] + aCoord[2]);
1069 aSlice[7] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2])*
1070 (-2.0 - aCoord[0] + aCoord[1] + aCoord[2]);
1072 aSlice[8] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2]);
1073 aSlice[9] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 + aCoord[0])*(1.0 - aCoord[2]);
1074 aSlice[10] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2]);
1075 aSlice[11] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[0])*(1.0 - aCoord[2]);
1076 aSlice[12] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 - aCoord[0])*(1.0 - aCoord[1]);
1077 aSlice[13] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 + aCoord[0])*(1.0 - aCoord[1]);
1078 aSlice[14] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 + aCoord[0])*(1.0 + aCoord[1]);
1079 aSlice[15] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 - aCoord[0])*(1.0 + aCoord[1]);
1080 aSlice[16] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2]);
1081 aSlice[17] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 + aCoord[0])*(1.0 + aCoord[2]);
1082 aSlice[18] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2]);
1083 aSlice[19] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[0])*(1.0 + aCoord[2]);
1089 //---------------------------------------------------------------
1090 struct THexa27a: THexa20a
1095 TInt aNbRef = myRefCoord.size();
1096 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1097 TCoordSlice aCoord = GetCoord(aRefId);
1099 case 20: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = -1.0; break;
1100 case 21: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1101 case 22: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1102 case 23: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1103 case 24: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1104 case 25: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1105 case 26: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1112 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1113 const TShapeFun::TCCoordSliceArr& theGauss,
1116 GetFun(theRef,theGauss,theFun);
1118 TInt aNbGauss = theGauss.size();
1119 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1120 const TCCoordSlice& aCoord = theGauss[aGaussId];
1121 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1123 aSlice[0] = 0.125*aCoord[0]*(aCoord[0] - 1.0)*aCoord[1]*(aCoord[1] - 1.0)*aCoord[2]*(aCoord[2] - 1.0);
1124 aSlice[1] = 0.125*aCoord[0]*(aCoord[0] + 1.0)*aCoord[1]*(aCoord[1] - 1.0)*aCoord[2]*(aCoord[2] - 1.0);
1125 aSlice[2] = 0.125*aCoord[0]*(aCoord[0] + 1.0)*aCoord[1]*(aCoord[1] + 1.0)*aCoord[2]*(aCoord[2] - 1.0);
1126 aSlice[3] = 0.125*aCoord[0]*(aCoord[0] - 1.0)*aCoord[1]*(aCoord[1] + 1.0)*aCoord[2]*(aCoord[2] - 1.0);
1127 aSlice[4] = 0.125*aCoord[0]*(aCoord[0] + 1.0)*aCoord[1]*(aCoord[1] - 1.0)*aCoord[2]*(aCoord[2] + 1.0);
1128 aSlice[5] = 0.125*aCoord[0]*(aCoord[0] + 1.0)*aCoord[1]*(aCoord[1] - 1.0)*aCoord[2]*(aCoord[2] + 1.0);
1129 aSlice[6] = 0.125*aCoord[0]*(aCoord[0] + 1.0)*aCoord[1]*(aCoord[1] + 1.0)*aCoord[2]*(aCoord[2] + 1.0);
1130 aSlice[7] = 0.125*aCoord[0]*(aCoord[0] - 1.0)*aCoord[1]*(aCoord[1] + 1.0)*aCoord[2]*(aCoord[2] + 1.0);
1132 aSlice[8] = 0.25*(1.0 - aCoord[0]*aCoord[0])*aCoord[1]*(aCoord[1] - 1.0)*aCoord[2]*(aCoord[2] - 1.0);
1133 aSlice[9] = 0.25*aCoord[0]*(aCoord[0] + 1.0)*(1.0 - aCoord[1]*aCoord[1])*aCoord[2]*(aCoord[2] - 1.0);
1134 aSlice[10]= 0.25*aCoord[0]*(aCoord[0] + 1.0)*(1.0 - aCoord[1]*aCoord[1])*aCoord[2]*(aCoord[2] - 1.0);
1135 aSlice[11]= 0.25*aCoord[0]*(aCoord[0] - 1.0)*(1.0 - aCoord[1]*aCoord[1])*aCoord[2]*(aCoord[2] - 1.0);
1136 aSlice[12]= 0.25*aCoord[0]*(aCoord[0] - 1.0)*aCoord[1]*(aCoord[1] - 1.0)*(1.0 - aCoord[2]*aCoord[2]);
1137 aSlice[13]= 0.25*aCoord[0]*(aCoord[0] + 1.0)*aCoord[1]*(aCoord[1] - 1.0)*(1.0 - aCoord[2]*aCoord[2]);
1138 aSlice[14]= 0.25*aCoord[0]*(aCoord[0] + 1.0)*aCoord[1]*(aCoord[1] + 1.0)*(1.0 - aCoord[2]*aCoord[2]);
1139 aSlice[15]= 0.25*aCoord[0]*(aCoord[0] - 1.0)*aCoord[1]*(aCoord[1] + 1.0)*(1.0 - aCoord[2]*aCoord[2]);
1140 aSlice[16]= 0.25*(1.0 - aCoord[0]*aCoord[0])*aCoord[1]*(aCoord[1] - 1.0)*aCoord[2]*(aCoord[2] + 1.0);
1141 aSlice[17]= 0.25*aCoord[0]*(aCoord[0] + 1.0)*(1.0 - aCoord[1]*aCoord[1])*aCoord[2]*(aCoord[2] + 1.0);
1142 aSlice[18]= 0.25*(1.0 - aCoord[0]*aCoord[0])*aCoord[1]*(aCoord[1] + 1.0)*aCoord[2]*(aCoord[2] + 1.0);
1143 aSlice[19]= 0.25*aCoord[0]*(aCoord[0] - 1.0)*(1.0 - aCoord[1]*aCoord[1])*aCoord[2]*(aCoord[2] + 1.0);
1144 aSlice[20]= 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1]*aCoord[1])*aCoord[2]*(aCoord[2] - 1.0);
1145 aSlice[21]= 0.25*(1.0 - aCoord[0]*aCoord[0])*aCoord[1]*(aCoord[1] - 1.0)*(1.0 - aCoord[2]*aCoord[2]);
1146 aSlice[22]= 0.25*aCoord[0]*(aCoord[0] + 1.0)*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[2]*aCoord[2]);
1147 aSlice[23]= 0.25*(1.0 - aCoord[0]*aCoord[0])*aCoord[1]*(aCoord[1] + 1.0)*(1.0 - aCoord[2]*aCoord[2]);
1148 aSlice[24]= 0.25*aCoord[0]*(aCoord[0] - 1.0)*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[2]*aCoord[2]);
1149 aSlice[25]= 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1]*aCoord[1])*aCoord[2]*(aCoord[2] + 1.0);
1150 aSlice[26]= 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[1]*aCoord[1]);
1156 //---------------------------------------------------------------
1157 struct THexa8b: TShapeFun
1162 TInt aNbRef = GetNbRef();
1163 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1164 TCoordSlice aCoord = GetCoord(aRefId);
1166 case 0: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1167 case 3: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1168 case 2: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1169 case 1: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1170 case 4: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1171 case 7: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1172 case 6: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1173 case 5: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1180 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1181 const TShapeFun::TCCoordSliceArr& theGauss,
1184 GetFun(theRef,theGauss,theFun);
1186 TInt aNbGauss = theGauss.size();
1187 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1188 const TCCoordSlice& aCoord = theGauss[aGaussId];
1189 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1191 aSlice[0] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2]);
1192 aSlice[3] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2]);
1193 aSlice[2] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2]);
1194 aSlice[1] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2]);
1196 aSlice[4] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2]);
1197 aSlice[7] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2]);
1198 aSlice[6] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2]);
1199 aSlice[5] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2]);
1205 //---------------------------------------------------------------
1206 struct THexa20b: TShapeFun
1208 THexa20b(TInt theDim = 3, TInt theNbRef = 20):
1209 TShapeFun(theDim,theNbRef)
1211 TInt aNbRef = myRefCoord.size();
1212 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1213 TCoordSlice aCoord = GetCoord(aRefId);
1215 case 0: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1216 case 3: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1217 case 2: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1218 case 1: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1219 case 4: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1220 case 7: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1221 case 6: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1222 case 5: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1224 case 11: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = -1.0; break;
1225 case 10: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = -1.0; break;
1226 case 9: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = -1.0; break;
1227 case 8: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = -1.0; break;
1228 case 16: aCoord[0] = -1.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1229 case 19: aCoord[0] = 1.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1230 case 18: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1231 case 17: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1232 case 15: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = 1.0; break;
1233 case 14: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1234 case 13: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 1.0; break;
1235 case 12: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1242 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1243 const TShapeFun::TCCoordSliceArr& theGauss,
1246 GetFun(theRef,theGauss,theFun);
1248 TInt aNbGauss = theGauss.size();
1249 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1250 const TCCoordSlice& aCoord = theGauss[aGaussId];
1251 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1253 aSlice[0] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2])*
1254 (-2.0 - aCoord[0] - aCoord[1] - aCoord[2]);
1255 aSlice[3] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2])*
1256 (-2.0 + aCoord[0] - aCoord[1] - aCoord[2]);
1257 aSlice[2] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2])*
1258 (-2.0 + aCoord[0] + aCoord[1] - aCoord[2]);
1259 aSlice[1] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2])*
1260 (-2.0 - aCoord[0] + aCoord[1] - aCoord[2]);
1261 aSlice[4] = 0.125*(1.0 - aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2])*
1262 (-2.0 - aCoord[0] - aCoord[1] + aCoord[2]);
1263 aSlice[7] = 0.125*(1.0 + aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2])*
1264 (-2.0 + aCoord[0] - aCoord[1] + aCoord[2]);
1265 aSlice[6] = 0.125*(1.0 + aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2])*
1266 (-2.0 + aCoord[0] + aCoord[1] + aCoord[2]);
1267 aSlice[5] = 0.125*(1.0 - aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2])*
1268 (-2.0 - aCoord[0] + aCoord[1] + aCoord[2]);
1270 aSlice[11] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1])*(1.0 - aCoord[2]);
1271 aSlice[10] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 + aCoord[0])*(1.0 - aCoord[2]);
1272 aSlice[9] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 + aCoord[1])*(1.0 - aCoord[2]);
1273 aSlice[8] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[0])*(1.0 - aCoord[2]);
1274 aSlice[16] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 - aCoord[0])*(1.0 - aCoord[1]);
1275 aSlice[19] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 + aCoord[0])*(1.0 - aCoord[1]);
1276 aSlice[18] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 + aCoord[0])*(1.0 + aCoord[1]);
1277 aSlice[17] = 0.25*(1.0 - aCoord[2]*aCoord[2])*(1.0 - aCoord[0])*(1.0 + aCoord[1]);
1278 aSlice[15] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 - aCoord[1])*(1.0 + aCoord[2]);
1279 aSlice[14] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 + aCoord[0])*(1.0 + aCoord[2]);
1280 aSlice[13] = 0.25*(1.0 - aCoord[0]*aCoord[0])*(1.0 + aCoord[1])*(1.0 + aCoord[2]);
1281 aSlice[12] = 0.25*(1.0 - aCoord[1]*aCoord[1])*(1.0 - aCoord[0])*(1.0 + aCoord[2]);
1287 //---------------------------------------------------------------
1288 struct TPenta6a: TShapeFun
1293 TInt aNbRef = myRefCoord.size();
1294 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1295 TCoordSlice aCoord = GetCoord(aRefId);
1297 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1298 case 1: aCoord[0] = -1.0; aCoord[1] = -0.0; aCoord[2] = 1.0; break;
1299 case 2: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1300 case 3: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1301 case 4: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1302 case 5: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1309 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1310 const TShapeFun::TCCoordSliceArr& theGauss,
1313 GetFun(theRef,theGauss,theFun);
1315 TInt aNbGauss = theGauss.size();
1316 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1317 const TCCoordSlice& aCoord = theGauss[aGaussId];
1318 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1320 aSlice[0] = 0.5*aCoord[1]*(1.0 - aCoord[0]);
1321 aSlice[1] = 0.5*aCoord[2]*(1.0 - aCoord[0]);
1322 aSlice[2] = 0.5*(1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]);
1324 aSlice[3] = 0.5*aCoord[1]*(aCoord[0] + 1.0);
1325 aSlice[4] = 0.5*aCoord[2]*(aCoord[0] + 1.0);
1326 aSlice[5] = 0.5*(1.0 - aCoord[1] - aCoord[2])*(1.0 + aCoord[0]);
1332 //---------------------------------------------------------------
1333 struct TPenta6b: TShapeFun
1338 TInt aNbRef = myRefCoord.size();
1339 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1340 TCoordSlice aCoord = GetCoord(aRefId);
1342 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1343 case 2: aCoord[0] = -1.0; aCoord[1] = -0.0; aCoord[2] = 1.0; break;
1344 case 1: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1345 case 3: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1346 case 5: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1347 case 4: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1354 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1355 const TShapeFun::TCCoordSliceArr& theGauss,
1358 GetFun(theRef,theGauss,theFun);
1360 TInt aNbGauss = theGauss.size();
1361 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1362 const TCCoordSlice& aCoord = theGauss[aGaussId];
1363 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1365 aSlice[0] = 0.5*aCoord[1]*(1.0 - aCoord[0]);
1366 aSlice[2] = 0.5*aCoord[2]*(1.0 - aCoord[0]);
1367 aSlice[1] = 0.5*(1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]);
1369 aSlice[3] = 0.5*aCoord[1]*(aCoord[0] + 1.0);
1370 aSlice[5] = 0.5*aCoord[2]*(aCoord[0] + 1.0);
1371 aSlice[4] = 0.5*(1.0 - aCoord[1] - aCoord[2])*(1.0 + aCoord[0]);
1377 //---------------------------------------------------------------
1378 struct TPenta15a: TShapeFun
1383 TInt aNbRef = myRefCoord.size();
1384 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1385 TCoordSlice aCoord = GetCoord(aRefId);
1387 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1388 case 1: aCoord[0] = -1.0; aCoord[1] = -0.0; aCoord[2] = 1.0; break;
1389 case 2: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1390 case 3: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1391 case 4: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1392 case 5: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1394 case 6: aCoord[0] = -1.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
1395 case 7: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1396 case 8: aCoord[0] = -1.0; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1397 case 9: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1398 case 10: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1399 case 11: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1400 case 12: aCoord[0] = 1.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
1401 case 13: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1402 case 14: aCoord[0] = 1.0; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1409 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1410 const TShapeFun::TCCoordSliceArr& theGauss,
1413 GetFun(theRef,theGauss,theFun);
1415 TInt aNbGauss = theGauss.size();
1416 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1417 const TCCoordSlice& aCoord = theGauss[aGaussId];
1418 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1420 aSlice[0] = 0.5*aCoord[1]*(1.0 - aCoord[0])*(2.0*aCoord[1] - 2.0 - aCoord[0]);
1421 aSlice[1] = 0.5*aCoord[2]*(1.0 - aCoord[0])*(2.0*aCoord[2] - 2.0 - aCoord[0]);
1422 aSlice[2] = 0.5*(aCoord[0] - 1.0)*(1.0 - aCoord[1] - aCoord[2])*(aCoord[0] + 2.0*aCoord[1] + 2.0*aCoord[2]);
1424 aSlice[3] = 0.5*aCoord[1]*(1.0 + aCoord[0])*(2.0*aCoord[1] - 2.0 - aCoord[0]);
1425 aSlice[4] = 0.5*aCoord[2]*(1.0 + aCoord[0])*(2.0*aCoord[2] - 2.0 - aCoord[0]);
1426 aSlice[5] = -0.5*(aCoord[0] + 1.0)*(1.0 - aCoord[1] - aCoord[2])*(-aCoord[0] + 2.0*aCoord[1] + 2.0*aCoord[2]);
1428 aSlice[6] = 2.0*aCoord[1]*aCoord[2]*(1.0 - aCoord[0]);
1429 aSlice[7] = 2.0*aCoord[2]*(1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]);
1430 aSlice[8] = 2.0*aCoord[1]*(1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]);
1432 aSlice[9] = aCoord[1]*(1.0 - aCoord[0]*aCoord[0]);
1433 aSlice[10] = aCoord[2]*(1.0 - aCoord[0]*aCoord[0]);
1434 aSlice[11] = (1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]*aCoord[0]);
1436 aSlice[12] = 2.0*aCoord[1]*aCoord[2]*(1.0 + aCoord[0]);
1437 aSlice[13] = 2.0*aCoord[2]*(1.0 - aCoord[1] - aCoord[2])*(1.0 + aCoord[0]);
1438 aSlice[14] = 2.0*aCoord[1]*(1.0 - aCoord[1] - aCoord[2])*(1.0 + aCoord[0]);
1444 //---------------------------------------------------------------
1445 struct TPenta15b: TShapeFun
1450 TInt aNbRef = myRefCoord.size();
1451 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1452 TCoordSlice aCoord = GetCoord(aRefId);
1454 case 0: aCoord[0] = -1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1455 case 2: aCoord[0] = -1.0; aCoord[1] = -0.0; aCoord[2] = 1.0; break;
1456 case 1: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1457 case 3: aCoord[0] = 1.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1458 case 5: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1459 case 4: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1461 case 8: aCoord[0] = -1.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
1462 case 7: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1463 case 6: aCoord[0] = -1.0; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1464 case 12: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1465 case 14: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1466 case 13: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1467 case 11: aCoord[0] = 1.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
1468 case 10: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1469 case 9: aCoord[0] = 1.0; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1476 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1477 const TShapeFun::TCCoordSliceArr& theGauss,
1480 GetFun(theRef,theGauss,theFun);
1482 TInt aNbGauss = theGauss.size();
1483 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1484 const TCCoordSlice& aCoord = theGauss[aGaussId];
1485 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1487 aSlice[0] = 0.5*aCoord[1]*(1.0 - aCoord[0])*(2.0*aCoord[1] - 2.0 - aCoord[0]);
1488 aSlice[2] = 0.5*aCoord[2]*(1.0 - aCoord[0])*(2.0*aCoord[2] - 2.0 - aCoord[0]);
1489 aSlice[1] = 0.5*(aCoord[0] - 1.0)*(1.0 - aCoord[1] - aCoord[2])*(aCoord[0] + 2.0*aCoord[1] + 2.0*aCoord[2]);
1491 aSlice[3] = 0.5*aCoord[1]*(1.0 + aCoord[0])*(2.0*aCoord[1] - 2.0 - aCoord[0]);
1492 aSlice[5] = 0.5*aCoord[2]*(1.0 + aCoord[0])*(2.0*aCoord[2] - 2.0 - aCoord[0]);
1493 aSlice[4] = -0.5*(aCoord[0] + 1.0)*(1.0 - aCoord[1] - aCoord[2])*(-aCoord[0] + 2.0*aCoord[1] + 2.0*aCoord[2]);
1495 aSlice[8] = 2.0*aCoord[1]*aCoord[2]*(1.0 - aCoord[0]);
1496 aSlice[7] = 2.0*aCoord[2]*(1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]);
1497 aSlice[6] = 2.0*aCoord[1]*(1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]);
1499 aSlice[12] = aCoord[1]*(1.0 - aCoord[0]*aCoord[0]);
1500 aSlice[14] = aCoord[2]*(1.0 - aCoord[0]*aCoord[0]);
1501 aSlice[13] = (1.0 - aCoord[1] - aCoord[2])*(1.0 - aCoord[0]*aCoord[0]);
1503 aSlice[11] = 2.0*aCoord[1]*aCoord[2]*(1.0 + aCoord[0]);
1504 aSlice[10] = 2.0*aCoord[2]*(1.0 - aCoord[1] - aCoord[2])*(1.0 + aCoord[0]);
1505 aSlice[9] = 2.0*aCoord[1]*(1.0 - aCoord[1] - aCoord[2])*(1.0 + aCoord[0]);
1511 //---------------------------------------------------------------
1512 struct TPyra5a: TShapeFun
1517 TInt aNbRef = myRefCoord.size();
1518 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1519 TCoordSlice aCoord = GetCoord(aRefId);
1521 case 0: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1522 case 1: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1523 case 2: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1524 case 3: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1525 case 4: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1532 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1533 const TShapeFun::TCCoordSliceArr& theGauss,
1536 GetFun(theRef,theGauss,theFun);
1538 TInt aNbGauss = theGauss.size();
1539 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1540 const TCCoordSlice& aCoord = theGauss[aGaussId];
1541 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1543 aSlice[0] = 0.25*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1544 aSlice[1] = 0.25*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1545 aSlice[2] = 0.25*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1546 aSlice[3] = 0.25*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1547 aSlice[4] = 1.0 - aCoord[2];
1553 //---------------------------------------------------------------
1554 struct TPyra5b: TShapeFun
1559 TInt aNbRef = myRefCoord.size();
1560 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1561 TCoordSlice aCoord = GetCoord(aRefId);
1563 case 0: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1564 case 3: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1565 case 2: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1566 case 1: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1567 case 4: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1574 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1575 const TShapeFun::TCCoordSliceArr& theGauss,
1578 GetFun(theRef,theGauss,theFun);
1580 TInt aNbGauss = theGauss.size();
1581 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1582 const TCCoordSlice& aCoord = theGauss[aGaussId];
1583 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1585 aSlice[0] = 0.25*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1586 aSlice[3] = 0.25*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1587 aSlice[2] = 0.25*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1588 aSlice[1] = 0.25*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1589 aSlice[4] = 1.0 - aCoord[2];
1595 //---------------------------------------------------------------
1596 struct TPyra13a: TShapeFun
1601 TInt aNbRef = myRefCoord.size();
1602 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1603 TCoordSlice aCoord = GetCoord(aRefId);
1605 case 0: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1606 case 1: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1607 case 2: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1608 case 3: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1609 case 4: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1611 case 5: aCoord[0] = 0.5; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1612 case 6: aCoord[0] = -0.5; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1613 case 7: aCoord[0] = -0.5; aCoord[1] = -0.5; aCoord[2] = 0.0; break;
1614 case 8: aCoord[0] = 0.5; aCoord[1] = -0.5; aCoord[2] = 0.0; break;
1615 case 9: aCoord[0] = 0.5; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1616 case 10: aCoord[0] = 0.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
1617 case 11: aCoord[0] = -0.5; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1618 case 12: aCoord[0] = 0.0; aCoord[1] = -0.5; aCoord[2] = 0.5; break;
1625 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1626 const TShapeFun::TCCoordSliceArr& theGauss,
1629 GetFun(theRef,theGauss,theFun);
1631 TInt aNbGauss = theGauss.size();
1632 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1633 const TCCoordSlice& aCoord = theGauss[aGaussId];
1634 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1636 aSlice[0] = 0.5*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1637 (aCoord[0] - 0.5)/(1.0 - aCoord[2]);
1638 aSlice[1] = 0.5*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1639 (aCoord[1] - 0.5)/(1.0 - aCoord[2]);
1640 aSlice[2] = 0.5*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1641 (-aCoord[0] - 0.5)/(1.0 - aCoord[2]);
1642 aSlice[3] = 0.5*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1643 (-aCoord[1] - 0.5)/(1.0 - aCoord[2]);
1645 aSlice[4] = 2.0*aCoord[2]*(aCoord[2] - 0.5);
1647 aSlice[5] = 0.5*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1648 (aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1649 aSlice[6] = 0.5*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1650 (aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1651 aSlice[7] = 0.5*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1652 (-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1653 aSlice[8] = 0.5*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1654 (-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1656 aSlice[9] = 0.5*aCoord[2]*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/
1658 aSlice[10] = 0.5*aCoord[2]*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/
1660 aSlice[11] = 0.5*aCoord[2]*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/
1662 aSlice[12] = 0.5*aCoord[2]*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/
1669 //---------------------------------------------------------------
1670 struct TPyra13b: TShapeFun
1675 TInt aNbRef = myRefCoord.size();
1676 for(TInt aRefId = 0; aRefId < aNbRef; aRefId++){
1677 TCoordSlice aCoord = GetCoord(aRefId);
1679 case 0: aCoord[0] = 1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1680 case 3: aCoord[0] = 0.0; aCoord[1] = 1.0; aCoord[2] = 0.0; break;
1681 case 2: aCoord[0] = -1.0; aCoord[1] = 0.0; aCoord[2] = 0.0; break;
1682 case 1: aCoord[0] = 0.0; aCoord[1] = -1.0; aCoord[2] = 0.0; break;
1683 case 4: aCoord[0] = 0.0; aCoord[1] = 0.0; aCoord[2] = 1.0; break;
1685 case 8: aCoord[0] = 0.5; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1686 case 7: aCoord[0] = -0.5; aCoord[1] = 0.5; aCoord[2] = 0.0; break;
1687 case 6: aCoord[0] = -0.5; aCoord[1] = -0.5; aCoord[2] = 0.0; break;
1688 case 5: aCoord[0] = 0.5; aCoord[1] = -0.5; aCoord[2] = 0.0; break;
1689 case 9: aCoord[0] = 0.5; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1690 case 12: aCoord[0] = 0.0; aCoord[1] = 0.5; aCoord[2] = 0.5; break;
1691 case 11: aCoord[0] = -0.5; aCoord[1] = 0.0; aCoord[2] = 0.5; break;
1692 case 10: aCoord[0] = 0.0; aCoord[1] = -0.5; aCoord[2] = 0.5; break;
1699 InitFun(const TShapeFun::TCCoordSliceArr& theRef,
1700 const TShapeFun::TCCoordSliceArr& theGauss,
1703 GetFun(theRef,theGauss,theFun);
1705 TInt aNbGauss = theGauss.size();
1706 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1707 const TCCoordSlice& aCoord = theGauss[aGaussId];
1708 TFloatVecSlice aSlice = theFun.GetFunSlice(aGaussId);
1710 aSlice[0] = 0.5*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1711 (aCoord[0] - 0.5)/(1.0 - aCoord[2]);
1712 aSlice[3] = 0.5*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1713 (aCoord[1] - 0.5)/(1.0 - aCoord[2]);
1714 aSlice[2] = 0.5*(+aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1715 (-aCoord[0] - 0.5)/(1.0 - aCoord[2]);
1716 aSlice[1] = 0.5*(+aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1717 (-aCoord[1] - 0.5)/(1.0 - aCoord[2]);
1719 aSlice[4] = 2.0*aCoord[2]*(aCoord[2] - 0.5);
1721 aSlice[8] = 0.5*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1722 (aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1723 aSlice[7] = 0.5*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*
1724 (aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1725 aSlice[6] = 0.5*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1726 (-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1727 aSlice[5] = 0.5*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*
1728 (-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/(1.0 - aCoord[2]);
1730 aSlice[9] = 0.5*aCoord[2]*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/
1732 aSlice[12] = 0.5*aCoord[2]*(-aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)/
1734 aSlice[11] = 0.5*aCoord[2]*(aCoord[0] - aCoord[1] + aCoord[2] - 1.0)*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/
1736 aSlice[10] = 0.5*aCoord[2]*(aCoord[0] + aCoord[1] + aCoord[2] - 1.0)*(-aCoord[0] + aCoord[1] + aCoord[2] - 1.0)/
1743 //---------------------------------------------------------------
1745 GetGaussCoord3D(const TGaussInfo& theGaussInfo,
1746 const TCellInfo& theCellInfo,
1747 const TNodeInfo& theNodeInfo,
1748 TGaussCoord& theGaussCoord,
1749 const TElemNum& theElemNum,
1750 EModeSwitch theMode)
1752 INITMSG(MYDEBUG,"GetGaussCoord3D\n");
1754 if(theGaussInfo.myGeom == theCellInfo.myGeom){
1755 EGeometrieElement aGeom = theGaussInfo.myGeom;
1757 TInt aNbRef = theGaussInfo.GetNbRef();
1758 TCCoordSliceArr aRefSlice(aNbRef);
1759 for(TInt anId = 0; anId < aNbRef; anId++)
1760 aRefSlice[anId] = theGaussInfo.GetRefCoordSlice(anId);
1762 TInt aNbGauss = theGaussInfo.GetNbGauss();
1763 TCCoordSliceArr aGaussSlice(aNbGauss);
1764 for(TInt anId = 0; anId < aNbGauss; anId++)
1765 aGaussSlice[anId] = theGaussInfo.GetGaussCoordSlice(anId);
1769 INITMSG(MYDEBUG,"eSEG2"<<endl);
1771 if(TSeg2a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1777 INITMSG(MYDEBUG,"eSEG3"<<endl);
1779 if(TSeg3a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1785 INITMSG(MYDEBUG,"eTRIA3"<<endl);
1787 if(TTria3a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1790 if(TTria3b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1796 INITMSG(MYDEBUG,"eTRIA6"<<endl);
1798 if(TTria6a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1801 if(TTria6b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1807 INITMSG(MYDEBUG,"eQUAD4"<<endl);
1809 if(TQuad4a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1812 if(TQuad4b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1818 INITMSG(MYDEBUG,"eQUAD8"<<endl);
1820 if(TQuad8a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1823 if(TQuad8b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1829 INITMSG(MYDEBUG,"eTETRA4"<<endl);
1831 if(TTetra4a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1834 if(TTetra4b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1840 INITMSG(MYDEBUG,"ePYRA5"<<endl);
1842 if(TPyra5a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1845 if(TPyra5b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1851 INITMSG(MYDEBUG,"ePENTA6"<<endl);
1853 if(TPenta6a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1856 if(TPenta6b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1862 INITMSG(MYDEBUG,"eHEXA8"<<endl);
1864 if(THexa8a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1867 if(THexa8b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1873 INITMSG(MYDEBUG,"eTETRA10"<<endl);
1875 if(TTetra10a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1878 if(TTetra10b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1884 INITMSG(MYDEBUG,"ePYRA13"<<endl);
1886 if(TPyra13a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1889 if(TPyra13b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1895 INITMSG(MYDEBUG,"ePENTA15"<<endl);
1897 if(TPenta15a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1900 if(TPenta15b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1906 INITMSG(MYDEBUG,"eHEXA20"<<endl);
1908 if(THexa20a().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1911 if(THexa20b().Eval(theCellInfo,theNodeInfo,theElemNum,aRefSlice,aGaussSlice,theGaussCoord,theMode))
1917 INITMSG(MYDEBUG,"eNONE"<<endl);
1925 //---------------------------------------------------------------
1927 GetBaryCenter(const TCellInfo& theCellInfo,
1928 const TNodeInfo& theNodeInfo,
1929 TGaussCoord& theGaussCoord,
1930 const TElemNum& theElemNum,
1931 EModeSwitch theMode)
1933 INITMSG(MYDEBUG,"GetBaryCenter\n");
1934 const PMeshInfo& aMeshInfo = theCellInfo.GetMeshInfo();
1935 TInt aDim = aMeshInfo->GetDim();
1936 static TInt aNbGauss = 1;
1938 bool anIsSubMesh = !theElemNum.empty();
1941 aNbElem = theElemNum.size();
1943 aNbElem = theCellInfo.GetNbElem();
1945 theGaussCoord.Init(aNbElem,aNbGauss,aDim,theMode);
1947 TInt aConnDim = theCellInfo.GetConnDim();
1951 "; aNbGauss = "<<aNbGauss<<
1952 "; aNbElem = "<<aNbElem<<
1953 "; aNbNodes = "<<theNodeInfo.GetNbElem()<<
1956 for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
1957 TInt aCellId = anIsSubMesh? theElemNum[anElemId]-1: anElemId;
1958 TCConnSlice aConnSlice = theCellInfo.GetConnSlice(aCellId);
1959 TCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
1961 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1962 TCoordSlice& aGaussCoordSlice = aCoordSliceArr[aGaussId];
1964 for(TInt aConnId = 0; aConnId < aConnDim; aConnId++){
1965 TInt aNodeId = aConnSlice[aConnId] - 1;
1966 TCCoordSlice aNodeCoordSlice = theNodeInfo.GetCoordSlice(aNodeId);
1968 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
1969 aGaussCoordSlice[aDimId] += aNodeCoordSlice[aDimId];
1973 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
1974 aGaussCoordSlice[aDimId] /= aConnDim;
1980 for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
1981 TCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
1982 INITMSG(MYVALUEDEBUG,"");
1983 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
1984 TCoordSlice& aCoordSlice = aCoordSliceArr[aGaussId];
1985 ADDMSG(MYVALUEDEBUG,"{");
1986 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
1987 ADDMSG(MYVALUEDEBUG,aCoordSlice[aDimId]<<" ");
1989 ADDMSG(MYVALUEDEBUG,"} ");
1991 ADDMSG(MYVALUEDEBUG,endl);
1999 //---------------------------------------------------------------
2001 GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
2002 const TNodeInfo& theNodeInfo,
2003 TGaussCoord& theGaussCoord,
2004 const TElemNum& theElemNum,
2005 EModeSwitch theMode)
2007 INITMSG(MYDEBUG,"GetBaryCenter\n");
2008 const PMeshInfo& aMeshInfo = thePolygoneInfo.GetMeshInfo();
2009 TInt aDim = aMeshInfo->GetDim();
2010 static TInt aNbGauss = 1;
2012 bool anIsSubMesh = !theElemNum.empty();
2015 aNbElem = theElemNum.size();
2017 aNbElem = thePolygoneInfo.GetNbElem();
2019 theGaussCoord.Init(aNbElem,aNbGauss,aDim,theMode);
2023 "; aNbGauss = "<<aNbGauss<<
2024 "; aNbElem = "<<aNbElem<<
2025 "; aNbNodes = "<<theNodeInfo.GetNbElem()<<
2028 for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
2029 TInt aCellId = anIsSubMesh? theElemNum[anElemId]-1: anElemId;
2031 TCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
2032 TCConnSlice aConnSlice = thePolygoneInfo.GetConnSlice(aCellId);
2033 TInt aNbConn = thePolygoneInfo.GetNbConn(aCellId);
2034 TInt aNbNodes = thePolygoneInfo.GetNbConn(aCellId);
2036 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
2037 TCoordSlice& aGaussCoordSlice = aCoordSliceArr[aGaussId];
2039 for(TInt aConnId = 0; aConnId < aNbConn; aConnId++){
2040 TInt aNodeId = aConnSlice[aConnId] - 1;
2041 TCCoordSlice aNodeCoordSlice = theNodeInfo.GetCoordSlice(aNodeId);
2043 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
2044 aGaussCoordSlice[aDimId] += aNodeCoordSlice[aDimId];
2048 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
2049 aGaussCoordSlice[aDimId] /= aNbNodes;
2058 //---------------------------------------------------------------
2060 GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
2061 const TNodeInfo& theNodeInfo,
2062 TGaussCoord& theGaussCoord,
2063 const TElemNum& theElemNum,
2064 EModeSwitch theMode)
2066 INITMSG(MYDEBUG,"GetBaryCenter\n");
2067 const PMeshInfo& aMeshInfo = thePolyedreInfo.GetMeshInfo();
2068 TInt aDim = aMeshInfo->GetDim();
2069 static TInt aNbGauss = 1;
2071 bool anIsSubMesh = !theElemNum.empty();
2074 aNbElem = theElemNum.size();
2076 aNbElem = thePolyedreInfo.GetNbElem();
2078 theGaussCoord.Init(aNbElem,aNbGauss,aDim,theMode);
2082 "; aNbGauss = "<<aNbGauss<<
2083 "; aNbElem = "<<aNbElem<<
2084 "; aNbNodes = "<<theNodeInfo.GetNbElem()<<
2087 for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
2088 TInt aCellId = anIsSubMesh? theElemNum[anElemId]-1: anElemId;
2090 TCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
2091 TCConnSliceArr aConnSliceArr = thePolyedreInfo.GetConnSliceArr(aCellId);
2092 TInt aNbFaces = aConnSliceArr.size();
2094 TInt aNbNodes = thePolyedreInfo.GetNbNodes(aCellId);
2096 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
2097 TCoordSlice& aGaussCoordSlice = aCoordSliceArr[aGaussId];
2099 for(TInt aFaceId = 0; aFaceId < aNbFaces; aFaceId++){
2100 TCConnSlice aConnSlice = aConnSliceArr[aFaceId];
2101 TInt aNbConn = aConnSlice.size();
2102 for(TInt aConnId = 0; aConnId < aNbConn; aConnId++){
2103 TInt aNodeId = aConnSlice[aConnId] - 1;
2104 TCCoordSlice aNodeCoordSlice = theNodeInfo.GetCoordSlice(aNodeId);
2106 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
2107 aGaussCoordSlice[aDimId] += aNodeCoordSlice[aDimId];
2111 for(TInt aDimId = 0; aDimId < aDim; aDimId++){
2112 aGaussCoordSlice[aDimId] /= aNbNodes;