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 Original line Diff line number Diff line
@@ -284,6 +284,7 @@ struct _ComputeMeasures<1, Dimension>{







template <unsigned int Dimension,typename IndexType, typename Real, unsigned int ...Reserve>
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>> ComputeMeasures(MeshElements<Dimension, IndexType, Real, Reserve...>& mesh){
    MakeMeshDataContainer_t<Real, make_custom_integer_sequence_t<unsigned int, 1, Dimension>> measures(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>
template <unsigned int Dimension>
struct _ComputeNormals{
struct _ComputeNormals{
    template <typename IndexType, typename Real, unsigned int ...Reserve>
    template <typename IndexType, typename Real, unsigned int ...Reserve>
@@ -308,6 +310,9 @@ struct _ComputeNormals{
};
};







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







template <>
template <>
struct _ComputeNormals<3>{
struct _ComputeNormals<3>{
    template <typename IndexType, typename Real, unsigned int ...Reserve>
    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>
template <unsigned int Dimension,typename IndexType, typename Real, unsigned int ...Reserve>
MeshDataContainer<Vector<Dimension, Real>, Dimension-1> ComputeFaceNormals(MeshElements<Dimension, IndexType, Real, Reserve...>& mesh){
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>
template <unsigned int Dimension,typename IndexType, typename Real, unsigned int ...Reserve>
MeshDataContainer<Real, Dimension-1> ComputeCellsDistance(MeshElements<Dimension, IndexType, Real, Reserve...>& mesh){
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>
template <unsigned int StartDimension, unsigned int TargetDimension, unsigned int MeshDimension, bool Descend>
struct MeshRun<MeshDimension, StartDimension, TargetDimension, MeshDimension, false, 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>
template <unsigned int StartDimension, unsigned int TargetDimension, unsigned int MeshDimension, bool Descend>
struct MeshRun<1, StartDimension, TargetDimension, MeshDimension, false, 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>
template <unsigned int CurrentDimension,unsigned int StartDimension, unsigned int TargetDimension, unsigned int MeshDimension, bool Descend>
struct MeshRun<CurrentDimension, StartDimension, TargetDimension, MeshDimension, true, 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 {
struct MeshConnections {
    /**
    /**
     * @brief connections<HR>
     * @brief connections<HR>
@@ -565,6 +596,11 @@ struct MeshConnections {


        return result;
        return result;
    }
    }
};


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


    /**
    /**
     * @brief orderedConnections<HR>
     * @brief orderedConnections<HR>
@@ -573,7 +609,7 @@ struct MeshConnections {
     * @return
     * @return
     */
     */
    template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve>
    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
            MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh
            ) {
            ) {
        MeshDataContainer<std::map<IndexType, IndexType>, StartDim> tempMap(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>
template<unsigned int FromDim, unsigned int ToDim, bool Descend = true>
struct MeshColouring {
struct MeshColouring {


+1 −1
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!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>
<qtcreator>
 <data>
 <data>
  <variable>EnvironmentId</variable>
  <variable>EnvironmentId</variable>