MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / getCharacteristicLength

Method getCharacteristicLength

DEVELOPER/core/Element.cpp:674–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672}
673
674double Element::getCharacteristicLength(void)
675{
676 int numNodes = this->getNumExternalNodes();
677 Node **theNodes = this->getNodePtrs();
678 double cLength = 0.0;
679 double minSize = 10e14; //Tesser
680
681 for (int i=0; i<numNodes; i++) {
682 Node *nodeI = theNodes[i];
683 Vector iCoords = nodeI->getCrds();
684 int iDOF = nodeI->getNumberDOF();
685 for (int j=i+1; j<numNodes; j++) {
686 Node *nodeJ = theNodes[j];
687 Vector jCoords = nodeJ->getCrds();
688 int jDOF = nodeI->getNumberDOF();
689 double ijLength = 0;
690 for (int k=0; k<iDOF && k<jDOF; k++) {
691 ijLength += (jCoords(k)-iCoords(k))*(jCoords(k)-iCoords(k)); //Tesser
692 }
693 ijLength = sqrt(ijLength);
694 if (ijLength > cLength)
695 cLength = ijLength;
696 if (ijLength < minSize)
697 minSize = ijLength;
698 }
699 }
700 return minSize;
701}
702
703
704

Callers

nothing calls this directly

Calls 4

getCrdsMethod · 0.80
getNumExternalNodesMethod · 0.45
getNodePtrsMethod · 0.45
getNumberDOFMethod · 0.45

Tested by

no test coverage detected