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

Save before making subelement iterators

parent 64dbf266
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
TEMPLATE = app
TEMPLATE = app
CONFIG += console c++14
CONFIG += console c++17
CONFIG -= app_bundle
CONFIG -= app_bundle
CONFIG -= qt
CONFIG -= qt


+12 −12
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.9.1, 2019-06-14T12:01:23. -->
<!-- Written by QtCreator 4.10.0, 2019-09-10T15:52:36. -->
<qtcreator>
<qtcreator>
 <data>
 <data>
  <variable>EnvironmentId</variable>
  <variable>EnvironmentId</variable>
@@ -64,14 +64,14 @@
 <data>
 <data>
  <variable>ProjectExplorer.Project.Target.0</variable>
  <variable>ProjectExplorer.Project.Target.0</variable>
  <valuemap type="QVariantMap">
  <valuemap type="QVariantMap">
   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.6.2 MinGW 32bit</value>
   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.1 MinGW 64-bit</value>
   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.6.2 MinGW 32bit</value>
   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.1 MinGW 64-bit</value>
   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.56.win32_mingw49_kit</value>
   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5121.win64_mingw73_kit</value>
   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_6_2_MinGW_32bit-Ladu011bnu00ed</value>
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_12_1_MinGW_64_bit-Ladu011bnu00ed</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -127,7 +127,7 @@
    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
   </valuemap>
   </valuemap>
   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_6_2_MinGW_32bit-Vydu00e1nu00ed</value>
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_12_1_MinGW_64_bit-Vydu00e1nu00ed</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -138,7 +138,7 @@
      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
     </valuemap>
     </valuemap>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -183,7 +183,7 @@
    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
   </valuemap>
   </valuemap>
   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_6_2_MinGW_32bit-Profile</value>
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_12_1_MinGW_64_bit-Profile</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -194,7 +194,7 @@
      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
     </valuemap>
     </valuemap>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -317,7 +317,7 @@
    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
    <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
    <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
    <value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_6_2_MinGW_32bit-Ladu011bnu00ed</value>
    <value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Skola/Vyzkumak/nova sit/build-Unstructured_mesh-Desktop_Qt_5_12_1_MinGW_64_bit-Ladu011bnu00ed</value>
   </valuemap>
   </valuemap>
   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
  </valuemap>
  </valuemap>
@@ -328,10 +328,10 @@
 </data>
 </data>
 <data>
 <data>
  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
  <value type="int">21</value>
  <value type="int">22</value>
 </data>
 </data>
 <data>
 <data>
  <variable>Version</variable>
  <variable>Version</variable>
  <value type="int">21</value>
  <value type="int">22</value>
 </data>
 </data>
</qtcreator>
</qtcreator>
+2 −2
Original line number Original line Diff line number Diff line
@@ -3,13 +3,13 @@
#include "vertex.h"
#include "vertex.h"


template <unsigned int MeshDim, typename Real>
template <unsigned int MeshDim, typename Real>
class ComputationalySignificantElement
class ComputationallySignificantElement
{
{
protected:
protected:
    Vertex<MeshDim, Real> Center;
    Vertex<MeshDim, Real> Center;
    int Flag;
    int Flag;
public:
public:
    ComputationalySignificantElement() {
    ComputationallySignificantElement() {
        Center = {};
        Center = {};
        Flag = int();
        Flag = int();
    }
    }
+96 −2
Original line number Original line Diff line number Diff line
#include <iostream>
#include <iostream>
#include "../debug/debug.h"
#include "../debug/debug.h"
#include "unstructuredmesh.h"
#include "unstructuredmesh.h"
#include "mesh_functions.h"
using namespace std;
using namespace std;


int main()
int main()
{
{

    using sit = UnstructuredMesh<2, size_t, double>;
    UnstructuredMesh<2, size_t, double> mesh;
    sit mesh;


    mesh.GetVertices().resize(4);
    mesh.GetVertices().resize(4);


@@ -68,4 +69,97 @@ int main()
    DBGVAR(mesh.CalculateEdgeMeasure(2)/mesh.CalculateCellDist(0,1));
    DBGVAR(mesh.CalculateEdgeMeasure(2)/mesh.CalculateCellDist(0,1));
    DBGVAR(mesh.CalculateFaceMeasureOverCellDist(2));
    DBGVAR(mesh.CalculateFaceMeasureOverCellDist(2));


    UnstructuredMesh<3, size_t, double, 6> mesh3;
    size_t index = 0;
DBGCHECK;
    mesh3.GetVertices().push_back({index, {0,0,0}});
    mesh3.GetVertices().push_back({1, {1,0,0}});
    mesh3.GetVertices().push_back({2, {0,1,0}});
    mesh3.GetVertices().push_back({3, {1,1,0}});
    mesh3.GetVertices().push_back({4, {0,0,1}});
    mesh3.GetVertices().push_back({5, {1,0,1}});
    mesh3.GetVertices().push_back({6, {0,1,1}});
    mesh3.GetVertices().push_back({7, {1,1,1}});
DBGCHECK;
    mesh3.GetEdges().push_back({0,0,1});
    mesh3.GetEdges().push_back({1,0,2});
    mesh3.GetEdges().push_back({2,1,3});
    mesh3.GetEdges().push_back({3,2,3});
    mesh3.GetEdges().push_back({4,0,4});
    mesh3.GetEdges().push_back({5,1,5});
    mesh3.GetEdges().push_back({6,3,4});
    mesh3.GetEdges().push_back({7,2,6});
    mesh3.GetEdges().push_back({8,4,5});
    mesh3.GetEdges().push_back({9,5,7});
    mesh3.GetEdges().push_back({10,6,7});
    mesh3.GetEdges().push_back({11,4,6});
DBGCHECK;
    mesh3.GetFaces().push_back(0);
    mesh3.GetFaces().at(0).GetSubelements().AddSubelement(0,true);
    mesh3.GetFaces().at(0).GetSubelements().AddSubelement(1,true);
    mesh3.GetFaces().at(0).GetSubelements().AddSubelement(2,true);
    mesh3.GetFaces().at(0).GetSubelements().AddSubelement(3,true);
    mesh3.GetFaces().push_back(1);
    mesh3.GetFaces().at(1).GetSubelements().AddSubelement(0,true);
    mesh3.GetFaces().at(1).GetSubelements().AddSubelement(3,true);
    mesh3.GetFaces().at(1).GetSubelements().AddSubelement(8,true);
    mesh3.GetFaces().at(1).GetSubelements().AddSubelement(4,true);
    mesh3.GetFaces().push_back(2);
    mesh3.GetFaces().at(2).GetSubelements().AddSubelement(1,true);
    mesh3.GetFaces().at(2).GetSubelements().AddSubelement(4,true);
    mesh3.GetFaces().at(2).GetSubelements().AddSubelement(11,true);
    mesh3.GetFaces().at(2).GetSubelements().AddSubelement(7,true);
    mesh3.GetFaces().push_back(3);
    mesh3.GetFaces().at(3).GetSubelements().AddSubelement(3,true);
    mesh3.GetFaces().at(3).GetSubelements().AddSubelement(6,true);
    mesh3.GetFaces().at(3).GetSubelements().AddSubelement(10,true);
    mesh3.GetFaces().at(3).GetSubelements().AddSubelement(7,true);
    mesh3.GetFaces().push_back(4);
    mesh3.GetFaces().at(4).GetSubelements().AddSubelement(2,true);
    mesh3.GetFaces().at(4).GetSubelements().AddSubelement(6,true);
    mesh3.GetFaces().at(4).GetSubelements().AddSubelement(9,true);
    mesh3.GetFaces().at(4).GetSubelements().AddSubelement(5,true);
    mesh3.GetFaces().push_back(5);
    mesh3.GetFaces().at(5).GetSubelements().AddSubelement(8,true);
    mesh3.GetFaces().at(5).GetSubelements().AddSubelement(9,true);
    mesh3.GetFaces().at(5).GetSubelements().AddSubelement(10,true);
    mesh3.GetFaces().at(5).GetSubelements().AddSubelement(11,true);
DBGCHECK;

    mesh3.GetFaces().at(0).SetNextBElem(1,0);
    mesh3.GetFaces().at(1).SetNextBElem(2,0);
    mesh3.GetFaces().at(2).SetNextBElem(3,0);
    mesh3.GetFaces().at(3).SetNextBElem(4,0);
    mesh3.GetFaces().at(4).SetNextBElem(5,0);
    mesh3.GetFaces().at(5).SetNextBElem(0,0);

    mesh3.GetCells().push_back(0);
    mesh3.GetCells().at(0).SetBoundaryElementIndex(3);
DBGCHECK;
    size_t tmp_face = mesh3.GetCells().at(0).GetBoundaryElementIndex();

    do {
        DBGVAR(tmp_face);
        for (auto& sube : mesh3.GetFaces().at(tmp_face).GetSubelements()) {
            DBGVAR(sube.index);
            if (sube.index < 12 ){
                DBGVAR(sube.index, mesh3.GetVertices().at(mesh3.GetEdges().at(sube.index).GetVertexAIndex()),mesh3.GetVertices().at(mesh3.GetEdges().at(sube.index).GetVertexBIndex()));
            }
        }

        tmp_face = mesh3.GetFaces().at(tmp_face).GetNextBElem(0);
    } while (tmp_face != mesh3.GetCells().at(0).GetBoundaryElementIndex());
//    mesh3.GetElements<0>().at(0).;


    MeshDataContainer<double, 3,2> cont(mesh3);

    //cont.GetDataDim<3>().resize(20);
    DBG(cont.GetDataPos<1>().size());

    DBG(cont.GetDataPos<0>().size());

    //auto centers = ComputeCenters(mesh3);

    //DBGVAR(centers.template GetDataDim<3>().at(0));
}
}
+209 −192

File changed.

Preview size limit exceeded, changes collapsed.

Loading