Revision 5f8d2b0031527aa8309599ab2429ec62e423b88d authored by Dmitry Yu. Naumov on 08 November 2021, 09:21:04 UTC, committed by Dmitry Yu. Naumov on 08 November 2021, 09:21:04 UTC
mention plane strain in smalldef verification example (tiny change)

It is customary in geomechanics to use plane strain assumptions for modeling mechanics in 2D.
However, users with another background than geosciences should be able find somewhere in the documentation (search function) which assumptions are made.
Topically this belongs to mechanics, so the best place for this hint seems the first benchmark example of the small deformation process, which is the verification.

See merge request ogs/ogs!3873
2 parent s b07d415 + 66570a2
Raw File
SimplePolygonTree.cpp
/**
 * \file
 * \author Thomas Fischer
 * \date   2010-06-22
 * \brief  Implementation of the SimplePolygonTree class.
 *
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#include "SimplePolygonTree.h"

namespace GeoLib
{
SimplePolygonTree::SimplePolygonTree(Polygon* polygon,
                                     SimplePolygonTree* parent)
    : _node_polygon(polygon), _parent(parent)
{
}

SimplePolygonTree::~SimplePolygonTree()
{
    for (auto* child : _children)
    {
        delete child;
    }
}

bool SimplePolygonTree::isRoot() const
{
    return _parent == nullptr;
}

bool SimplePolygonTree::isPolygonInside(
    const SimplePolygonTree* polygon_hierarchy) const
{
    return _node_polygon->isPolylineInPolygon(polygon_hierarchy->polygon());
}

const SimplePolygonTree* SimplePolygonTree::parent() const
{
    return _parent;
}

void SimplePolygonTree::insertSimplePolygonTree(
    SimplePolygonTree* polygon_hierarchy)
{
    Polygon const& polygon = polygon_hierarchy->polygon();
    bool nfound(true);
    for (auto* child : _children)
    {
        if (child->polygon().isPolylineInPolygon(polygon))
        {
            child->insertSimplePolygonTree(polygon_hierarchy);
            nfound = false;
            break;
        }
    }
    if (nfound)
    {
        _children.push_back(polygon_hierarchy);
        polygon_hierarchy->_parent = this;
    }
}

Polygon& SimplePolygonTree::polygon()
{
    return *_node_polygon;
}
Polygon const& SimplePolygonTree::polygon() const
{
    return *_node_polygon;
}

}  // end namespace GeoLib
back to top