// Accessor methods 
void mgrid::BoundaryConditions::set(BoundaryFlag bFlag, const Boundary& referent) {
    // Check lengths before assignment
    if (boundaries(bFlag).extent(0) != referent.extent(0)) {
        throw InvalidBoundaryCondition();
    } else { 
        Boundary::iterator boundIter = boundaries(bFlag).begin();  
        for (Boundary::const_iterator refIter = referent.begin(); 
             refIter != referent.end(); 
             refIter++, boundIter++) 
        {
            boundIter->value = refIter->value;
            boundIter->conditionType = refIter->conditionType;
        }       
    }
} 
Esempio n. 2
0
        void computeKappa(const ElementaryCube& cube, int id)
        {
            if (computedBoundaries.find(id) != computedBoundaries.end())
            {
                return;
            }

            computedBoundaries.insert(id);

            typedef std::map<ElementaryCube, int> Boundary;
            Boundary boundary;
            cube.boundary(boundary);

            for (Boundary::iterator bIt = boundary.begin(), bEnd = boundary.end(); bIt != bEnd; ++bIt)
            {
                const int bId = getId(bIt->first);
                kappaMap.push_back(boost::make_tuple(id, bId, bIt->second));
                computeKappa(bIt->first, bId);
            }

        }