tdegeus / GooseFEM

Several types of Finite Element simulations in C++ (with a Python interface)
http://goosefem.rtfd.io
GNU General Public License v3.0
9 stars 6 forks source link

Using CRTP for Mesh #216

Closed tdegeus closed 3 years ago

tdegeus commented 3 years ago

Try to re-document:

    /**
    DOF-numbers for the case that the periodicity if fully eliminated. Such that:

        dofs[nodesRightOpenEdge(), :] = dofs[nodesLeftOpenEdge(), :]
        dofs[nodesTopOpenEdge(), :] = dofs[nodesBottomOpenEdge(), :]
        dofs[nodesBottomRightCorner(), :] = dofs[nodesBottomLeftCorner(), :]
        dofs[nodesTopRightCorner(), :] = dofs[nodesBottomLeftCorner(), :]
        dofs[nodesTopLeftCorner(), :] = dofs[nodesBottomLeftCorner(), :]

    \return DOF numbers for each node [#nnode, #ndim].
    */
    xt::xtensor<size_t, 2> dofsPeriodic() const;

    /**
    Periodic node pairs, in two columns: (independent, dependent).

    -   nodesRightOpenEdge() are tied to nodesLeftOpenEdge().
    -   nodesTopOpenEdge() are tied to nodesBottomOpenEdge().
    -   nodesBottomRightCorner() are tied to nodesBottomLeftCorner().
    -   nodesTopRightCorner() are tied to nodesBottomLeftCorner().
    -   nodesTopLeftCorner() are tied to nodesBottomLeftCorner().

    \return [ntyings, #ndim].
    */
    xt::xtensor<size_t, 2> nodesPeriodic() const;

    /**
    Reference node to use for periodicity, because all corners are tied to it.

    \return Alias of nodesBottomLeftCorner().
    */
    size_t nodesOrigin() const;

   /**
    DOF-numbers for the case that the periodicity if fully eliminated. Such that:

        dofs[nodesBackFace(), :] = dofs[nodesFrontFace(), :]
        dofs[nodesRightFace(), :] = dofs[nodesLeftFace(), :]
        dofs[nodesTopFace(), :] = dofs[nodesBottomFace(), :]
        dofs[nodesBackBottomOpenEdge(), :] = dofs[nodesFrontBottomOpenEdge(), :]
        dofs[nodesBackTopOpenEdge(), :] = dofs[nodesFrontBottomOpenEdge(), :]
        dofs[nodesFrontTopOpenEdge(), :] = dofs[nodesFrontBottomOpenEdge(), :]
        dofs[nodesBottomRightOpenEdge(), :] = dofs[nodesBottomLeftOpenEdge(), :]
        dofs[nodesTopRightOpenEdge(), :] = dofs[nodesBottomLeftOpenEdge(), :]
        dofs[nodesTopLeftOpenEdge(), :] = dofs[nodesBottomLeftOpenEdge(), :]
        dofs[nodesFrontRightOpenEdge(), :] = dofs[nodesFrontLeftOpenEdge(), :]
        dofs[nodesBackRightOpenEdge(), :] = dofs[nodesFrontLeftOpenEdge(), :]
        dofs[nodesBackLeftOpenEdge(), :] = dofs[nodesFrontLeftOpenEdge(), :]
        dofs[nodesFrontBottomRightCorner(), :] = dofs[nodesFrontBottomLeftCorner(), :]
        dofs[nodesBackBottomRightCorner(), :] = dofs[nodesFrontBottomLeftCorner(), :]
        dofs[nodesBackBottomLeftCorner(), :] = dofs[nodesFrontBottomLeftCorner(), :]
        dofs[nodesFrontTopLeftCorner(), :] = dofs[nodesFrontBottomLeftCorner(), :]
        dofs[nodesFrontTopRightCorner(), :] = dofs[nodesFrontBottomLeftCorner(), :]
        dofs[nodesBackTopRightCorner(), :] = dofs[nodesFrontBottomLeftCorner(), :]
        dofs[nodesBackTopLeftCorner(), :] = dofs[nodesFrontBottomLeftCorner(), :]

    \return DOF numbers for each node [#nnode, #ndim].
    */
    xt::xtensor<size_t, 2> dofsPeriodic() const;

    /**
    Periodic node pairs, in two columns: (independent, dependent).

    -   nodesBackFace() are tied to nodesFrontFace().
    -   nodesRightFace() are tied to nodesLeftFace().
    -   nodesTopFace() are tied to nodesBottomFace().
    -   nodesBackBottomOpenEdge() are tied to nodesFrontBottomOpenEdge().
    -   nodesBackTopOpenEdge() are tied to nodesFrontBottomOpenEdge().
    -   nodesFrontTopOpenEdge() are tied to nodesFrontBottomOpenEdge().
    -   nodesBottomRightOpenEdge() are tied to nodesBottomLeftOpenEdge().
    -   nodesTopRightOpenEdge() are tied to nodesBottomLeftOpenEdge().
    -   nodesTopLeftOpenEdge() are tied to nodesBottomLeftOpenEdge().
    -   nodesFrontRightOpenEdge() are tied to nodesFrontLeftOpenEdge().
    -   nodesBackRightOpenEdge() are tied to nodesFrontLeftOpenEdge().
    -   nodesBackLeftOpenEdge() are tied to nodesFrontLeftOpenEdge().
    -   nodesFrontBottomRightCorner() are tied to nodesFrontBottomLeftCorner().
    -   nodesBackBottomRightCorner() are tied to nodesFrontBottomLeftCorner().
    -   nodesBackBottomLeftCorner() are tied to nodesFrontBottomLeftCorner().
    -   nodesFrontTopLeftCorner() are tied to nodesFrontBottomLeftCorner().
    -   nodesFrontTopRightCorner() are tied to nodesFrontBottomLeftCorner().
    -   nodesBackTopRightCorner() are tied to nodesFrontBottomLeftCorner().
    -   nodesBackTopLeftCorner() are tied to nodesFrontBottomLeftCorner().

    \return [ntyings, #ndim].
    */
    xt::xtensor<size_t, 2> nodesPeriodic() const;

    /**
    Reference node to use for periodicity, because all corners are tied to it.

    \return Alias of nodesFrontBottomLeftCorner().
    */
    size_t nodesOrigin() const;

See https://stackoverflow.com/questions/67753281/crtp-function-specialisation-add-to-the-docstring-of-the-interface-function