コード例 #1
0
ファイル: Subdomain.cpp プロジェクト: lcpt/xc
//! @brief Return the Vector obtained by calling getLastSysResponse() on
//! the associated FE\_Element.
const XC::Vector &XC::Subdomain::getLastExternalSysResponse(void)
  {
    if(!theFEele)
      {
        std::cerr << Domain::getClassName() << "::" << __FUNCTION__
		  << "; FATAL ERROR: "
		  << "; no FE_Element *exists for a subdomain.\n"
		  << " This is the responsibilty of the"
	          << " FE_ELement constructor.\n";
        exit(0);
      }

    // get the response from the FE_ele for the nodal
    // quantities - WARNING this is expressed in global dof

    if(mapBuilt == false)
      this->buildMap();

    ID &theMap = *map;
    const XC::Vector &localResponse = theFEele->getLastResponse();
    int numDOF = this->getNumDOF();
    for(int i=0; i<numDOF; i++)
      (*mappedVect)(theMap(i)) = localResponse(i);
    return *mappedVect;
  }
コード例 #2
0
ファイル: ActorSubdomain.cpp プロジェクト: DBorello/OpenSees
const Vector &
ActorSubdomain::getLastExternalSysResponse(void)
{
    int numDOF = this->getNumDOF();
    numDOF = this->getNumDOF();

    if (lastResponse == 0)
	lastResponse = new Vector(numDOF);
    else if (lastResponse->Size() != numDOF) {
	delete lastResponse;
	lastResponse = new Vector(numDOF);
    }
    
    if (mapBuilt == false)
      this->buildMap();

    ID &theMap = *map;
    Vector &localResponse = *lastResponse;
    int numberDOF = this->getNumDOF();
    for (int i=0; i<numberDOF; i++)
      (*mappedVect)(theMap(i)) = localResponse(i);

    return *mappedVect;

}
コード例 #3
0
ファイル: Subdomain.cpp プロジェクト: lcpt/xc
//! @brief Return the Matrix obtained from invoking getTangent() on
//! the DomainDecompositionAnalysis object.
const XC::Matrix &XC::Subdomain::getTang(void)
  {
    if(!theAnalysis)
      {
        std::cerr << Domain::getClassName() << "::" << __FUNCTION__
		  << "; no StaticCondensationAnalysis has been set.\n";
        exit(-1);
      }

    if(mapBuilt == false)
        this->buildMap();

    ID &theMap = *map;
    const XC::Matrix &anaTang = theAnalysis->getTangent();
    int numDOF = this->getNumDOF();
    for(int i=0; i<numDOF; i++)
      for(int j=0; j<numDOF; j++)
        (*mappedMatrix)(i,j) = anaTang(theMap(i),theMap(j));
    return *mappedMatrix;
  }
コード例 #4
0
double WayMergeManipulation::_calculateExpertProbability(ConstOsmMapPtr map) const
{
  OsmMapPtr theMap(new OsmMap());
  CopyMapSubsetOp(map,
               ElementId(ElementType::Way, _left),
               ElementId(ElementType::Way, _right)).apply(theMap);

  WayPtr left = theMap->getWay(_left);
  WayPtr right = theMap->getWay(_right);

  // use the maximal nearest subline code to find the best subline
  WayPtr mnsLeft = MaximalNearestSubline::getMaximalNearestSubline(theMap, left, right,
    _minSplitSize, left->getCircularError() + right->getCircularError());
  if (mnsLeft == 0)
  {
    return 0.0;
  }
  WayPtr mnsRight = MaximalNearestSubline::getMaximalNearestSubline(theMap, right, mnsLeft,
    _minSplitSize, left->getCircularError() + right->getCircularError());
  if (mnsRight == 0)
  {
    return 0.0;
  }

  // what portion of the original lines is the MNS
  double pl = ElementConverter(theMap).convertToLineString(mnsLeft)->getLength() /
      ElementConverter(theMap).convertToLineString(left)->getLength();
  double pr = ElementConverter(theMap).convertToLineString(mnsRight)->getLength() /
      ElementConverter(theMap).convertToLineString(right)->getLength();

  // give it a score
  double ps = std::min(pl, pr) / 2.0 + 0.5;

  double p;

  // if either of the lines are zero in length.
  if (pl == 0 || pr == 0)
  {
    p = 0.0;
  }
  else
  {
    p = ps * ProbabilityOfMatch::getInstance().expertProbability(theMap, mnsLeft, mnsRight);
  }

  return p;
}
コード例 #5
0
ファイル: Subdomain.cpp プロジェクト: lcpt/xc
//! @brief Return the Vector obtained from invoking getCondensedRHS() on
//! the DomainDecompositionAnalysis object.
const XC::Vector &XC::Subdomain::getResistingForce(void) const
  {
    if(!theAnalysis)
      {
        std::cerr << Domain::getClassName() << "::" << __FUNCTION__
		  << "; no StaticCondensationAnalysis has been set.\n";
        exit(-1);
      }

    if(!mapBuilt)
      this->buildMap();

    ID &theMap = *map;
    const Vector &anaResidual = theAnalysis->getResidual();
    int numDOF = this->getNumDOF();
    for(int i=0; i<numDOF; i++)
      (*mappedVect)(i) = anaResidual(theMap(i));
    //std::cerr << Domain::getClassName() << "::" << __FUNCTION__
    //          << ": " << *mappedVect;
    return *mappedVect;
  }