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

Mesh connections has now template argument specifying the ordering of

the elements.
parent d7ca70e5
Loading
Loading
Loading
Loading
+54 −2
Original line number Diff line number Diff line
@@ -284,6 +284,7 @@ struct _ComputeMeasures<1, Dimension>{




template <unsigned int Dimension,typename IndexType, typename Real, unsigned int ...Reserve>
MakeMeshDataContainer_t<Real, make_custom_integer_sequence_t<unsigned int, 1, Dimension>> ComputeMeasures(MeshElements<Dimension, IndexType, Real, Reserve...>& mesh){
    MakeMeshDataContainer_t<Real, make_custom_integer_sequence_t<unsigned int, 1, Dimension>> measures(mesh);
@@ -298,6 +299,7 @@ MakeMeshDataContainer_t<Real, make_custom_integer_sequence_t<unsigned int, 1, Di




template <unsigned int Dimension>
struct _ComputeNormals{
    template <typename IndexType, typename Real, unsigned int ...Reserve>
@@ -308,6 +310,9 @@ struct _ComputeNormals{
};





template <>
struct _ComputeNormals<2>{
    template <typename IndexType, typename Real, unsigned int ...Reserve>
@@ -324,6 +329,9 @@ struct _ComputeNormals<2>{
};





template <>
struct _ComputeNormals<3>{
    template <typename IndexType, typename Real, unsigned int ...Reserve>
@@ -385,6 +393,9 @@ struct _ComputeNormals<3>{






template <unsigned int Dimension,typename IndexType, typename Real, unsigned int ...Reserve>
MeshDataContainer<Vector<Dimension, Real>, Dimension-1> ComputeFaceNormals(MeshElements<Dimension, IndexType, Real, Reserve...>& mesh){

@@ -398,6 +409,8 @@ MeshDataContainer<Vector<Dimension, Real>, Dimension-1> ComputeFaceNormals(MeshE





template <unsigned int Dimension,typename IndexType, typename Real, unsigned int ...Reserve>
MeshDataContainer<Real, Dimension-1> ComputeCellsDistance(MeshElements<Dimension, IndexType, Real, Reserve...>& mesh){

@@ -469,6 +482,10 @@ struct MeshRun {
    }
};





template <unsigned int StartDimension, unsigned int TargetDimension, unsigned int MeshDimension, bool Descend>
struct MeshRun<MeshDimension, StartDimension, TargetDimension, MeshDimension, false, Descend> {

@@ -489,6 +506,9 @@ struct MeshRun<MeshDimension, StartDimension, TargetDimension, MeshDimension, fa
};





template <unsigned int StartDimension, unsigned int TargetDimension, unsigned int MeshDimension, bool Descend>
struct MeshRun<1, StartDimension, TargetDimension, MeshDimension, false, Descend> {

@@ -506,6 +526,8 @@ struct MeshRun<1, StartDimension, TargetDimension, MeshDimension, false, Descend





template <unsigned int CurrentDimension,unsigned int StartDimension, unsigned int TargetDimension, unsigned int MeshDimension, bool Descend>
struct MeshRun<CurrentDimension, StartDimension, TargetDimension, MeshDimension, true, Descend> {

@@ -544,7 +566,16 @@ struct MeshApply {
};


template<unsigned int StartDim, unsigned int TargetDim>




enum Ordering{
    ORDER_ASCEND,
    ORDER_ORIGINAL
};

template<unsigned int StartDim, unsigned int TargetDim, Ordering order = Ordering::ORDER_ASCEND>
struct MeshConnections {
    /**
     * @brief connections<HR>
@@ -565,6 +596,11 @@ struct MeshConnections {

        return result;
    }
};


template<unsigned int StartDim, unsigned int TargetDim>
struct MeshConnections<StartDim, TargetDim, Ordering::ORDER_ORIGINAL> {

    /**
     * @brief orderedConnections<HR>
@@ -573,7 +609,7 @@ struct MeshConnections {
     * @return
     */
    template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve>
    static MeshDataContainer<std::vector<IndexType>, StartDim> orderedConnections(
    static MeshDataContainer<std::vector<IndexType>, StartDim> connections(
            MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh
            ) {
        MeshDataContainer<std::map<IndexType, IndexType>, StartDim> tempMap(mesh);
@@ -599,6 +635,22 @@ struct MeshConnections {

};






template <unsigned int StartDim, unsigned int ConnectingDim, unsigned int ConnectedDim = StartDim, Ordering order = Ordering::ORDER_ASCEND>
class MeshNegborhood{
    template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve>
    static MeshDataContainer<std::vector<IndexType>, StartDim> connections();

};





template<unsigned int FromDim, unsigned int ToDim, bool Descend = true>
struct MeshColouring {

+1 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2019-10-14T11:17:53. -->
<!-- Written by QtCreator 4.10.0, 2019-10-15T12:09:44. -->
<qtcreator>
 <data>
  <variable>EnvironmentId</variable>