Commit d2a508d3 authored by Tomáš Jakubec's avatar Tomáš Jakubec
Browse files

omit getIndex from MeshApply

fix of methods setting up the boundary cells
parent 72800df0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -427,6 +427,7 @@ void testMesh3D() {
    using sit3 = UnstructuredMesh<3, size_t, double, 6>;
    UnstructuredMesh<3, size_t, double, 6> mesh3;
    twoPrisms(mesh3);
    mesh3.setupBoundaryCells();
    size_t tmp_face = mesh3.getCells().at(0).getBoundaryElementIndex();

    do {
+3 −3
Original line number Diff line number Diff line
@@ -407,12 +407,12 @@ public:

    void setupBoundaryCells(){
        for (Face& face : getFaces()){
            if (face.getCellLeftIndex == INVALID_INDEX(IndexType)){
            if (face.getCellLeftIndex() == INVALID_INDEX(IndexType)){
                IndexType cellIndex = BoundaryCells.size() | BOUNDARY_INDEX(IndexType);
                face.setCellLeftIndex(cellIndex);
                appendBoundaryCell(cellIndex, face.getIndex());
            }
            if (face.getCellRightIndex == INVALID_INDEX(IndexType)){
            if (face.getCellRightIndex() == INVALID_INDEX(IndexType)){
                IndexType cellIndex = BoundaryCells.size() | BOUNDARY_INDEX(IndexType);
                face.setCellRightIndex(cellIndex);
                appendBoundaryCell(cellIndex, face.getIndex());
@@ -424,7 +424,7 @@ public:

    void setupBoundaryCellsCenters() {
        for(Cell& cell : BoundaryCells){
            cell.SetCenter(getFaces().at(cell.getBoundaryElementIndex()).GetCenter());
            cell.setCenter(getFaces().at(cell.getBoundaryElementIndex()).getCenter());
        }
    }

+3 −3
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ struct MeshRun<MeshDimension, StartDimension, TargetDimension, MeshDimension, fa
        IndexType tmpFace = cell.getBoundaryElementIndex();
        do {
            MeshRun<MeshDimension - 1, StartDimension, TargetDimension, MeshDimension, TargetDimension == MeshDimension - 1, Descend>::run(mesh, origElementIndex, tmpFace, fun);
            tmpFace = mesh.getFaces().at(tmpFace).getNextBElem(cell.getIndex());
            tmpFace = mesh.getFaces().at(tmpFace).getNextBElem(index);
        } while (tmpFace != cell.getBoundaryElementIndex());

    }
@@ -111,14 +111,14 @@ struct MeshApply {
    template<typename Functor, typename IndexType, typename Real, unsigned int ...Reserve>
    static void apply(const MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh,
                      Functor f) {
        for (auto& startElement : mesh.template getElements<(StartDimension > TargetDimension) ? StartDimension : TargetDimension>()){
        for (IndexType currElement = 0; currElement < mesh.template getElements<(StartDimension > TargetDimension) ? StartDimension : TargetDimension>().size(); currElement++){
            MeshRun<
                    (StartDimension > TargetDimension) ? StartDimension : TargetDimension,
                    (StartDimension > TargetDimension) ? StartDimension : TargetDimension,
                    (StartDimension > TargetDimension) ? TargetDimension : StartDimension,
                    MeshDimension,
                    StartDimension == TargetDimension,
                    (StartDimension > TargetDimension)>::run(mesh, startElement.getIndex(), startElement.getIndex(), f);
                    (StartDimension > TargetDimension)>::run(mesh, currElement, currElement, f);
        }
    }