本文整理汇总了C++中SpatialLocalizer::giveAllNodesWithinBox方法的典型用法代码示例。如果您正苦于以下问题:C++ SpatialLocalizer::giveAllNodesWithinBox方法的具体用法?C++ SpatialLocalizer::giveAllNodesWithinBox怎么用?C++ SpatialLocalizer::giveAllNodesWithinBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpatialLocalizer
的用法示例。
在下文中一共展示了SpatialLocalizer::giveAllNodesWithinBox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findInitiationFronts
void
Delamination :: findInitiationFronts(bool &failureChecked, const IntArray &CSnumbers, std :: vector< IntArray > &CSinterfaceNumbers, std :: vector< IntArray > &CSDofManNumbers, std :: vector< FloatArray > &initiationFactors, TimeStep *tStep)
{
// Loop through all cross sections associated with delaminations
// Returns
// CSinterfaceNumbers: the failed interface number associated with the cross sections.
// CSDofManNumbers: the dofmanagers that should be enriched (associated with the cross sections)
IntArray failedElementInterfaces;
IntArray elementNumbers;
SpatialLocalizer *localizer = this->giveDomain()->giveSpatialLocalizer();
// NB: Assumes that elements can only be included in one cross section.
for ( int iCS = 1 ; iCS <= CSnumbers.giveSize() ; iCS++ ) {
int eltSetNumber = this->giveDomain()->giveCrossSection(CSnumbers.at(iCS))->giveSetNumber();
//printf("Cross section No. %i, set No. %i \n",CSnumbers.at(iCS),eltSetNumber);
IntArray elementNumbers = this->giveDomain()->giveSet(eltSetNumber)->giveElementList();
for ( auto eltNumber : elementNumbers ) {
Element *elt = this->giveDomain()->giveGlobalElement(eltNumber);
if ( Shell7BaseXFEM *shellElt = dynamic_cast < Shell7BaseXFEM * > (elt) ) {
//bool recoverStresses = true;
shellElt->giveFailedInterfaceNumber(failedElementInterfaces, initiationFactors[iCS-1], tStep, this->recoverStresses);
//failedElementInterfaces.printYourself("failedElementInterfaces");
for (int eltInt : failedElementInterfaces ) {
CSinterfaceNumbers[iCS-1].insertSortedOnce(eltInt);
}
if ( !failedElementInterfaces.isEmpty() ) {
for (int iDF : shellElt->giveDofManArray() ) {
//printf("element node %d \n",iDF);
if ( this->initiationRadius > 0.0 ) {
const FloatArray gCoords = this->giveDomain()->giveNode(iDF)->giveNodeCoordinates();
std :: list< int > nodeList;
localizer->giveAllNodesWithinBox(nodeList,gCoords,initiationRadius);
for ( int jNode : nodeList ) {
//printf("nodeList node %d \n",jNode);
CSDofManNumbers[iCS-1].insertSortedOnce(jNode);
}
} else {
CSDofManNumbers[iCS-1].insertSortedOnce(iDF);
}
}
}
}
}
}
failureChecked = true;
}
示例2: propagateInterface
bool PLnodeRadius :: propagateInterface(Domain &iDomain, EnrichmentFront &iEnrFront, TipPropagation &oTipProp)
{
if ( !iEnrFront.propagationIsAllowed() ) {
printf("EnrichmentFront.propagationIsAllowed is false \n");
return false;
}
const TipInfo &tipInfo = iEnrFront.giveTipInfo(); // includes the dofman numbers which represent the boundary of the EI.
//tipInfo.mTipDofManNumbers.printYourself();
// No listbased tip (or EI) present, so nothing to propagate.
if ( tipInfo.mTipDofManNumbers.giveSize() == 0 ) {
printf("No dofmans in tip; nothing to propagate. \n");
return false;
}
// Localise nodes within certain radius from tip nodes
oTipProp.mPropagationDofManNumbers.clear();
SpatialLocalizer *localizer = iDomain.giveSpatialLocalizer();
for ( int i = 1 ; i <= tipInfo.mTipDofManNumbers.giveSize() ; i++ ) {
//DofManager *dofMan = iDomain.giveDofManager(tipInfo.mTipDofManNumbers.at(i));
//const FloatArray gCoords = dofMan->giveCoordinates();
Node *iNode = iDomain.giveNode(tipInfo.mTipDofManNumbers.at(i));
const FloatArray gCoords = iNode->giveNodeCoordinates();
std :: list< int > nodeList;
localizer->giveAllNodesWithinBox(nodeList,gCoords,mRadius);
for ( int jNode : nodeList ) {
//printf("nodeList node %d \n",jNode);
oTipProp.mPropagationDofManNumbers.insertSortedOnce(jNode);
}
}
//oTipProp.mPropagationDofManNumbers.printYourself(" The following noded will be propagated to:");
return true;
}