├── ArcGIS ├── NetworkGT_Example.gdb │ ├── gdb │ ├── _gdb.GEO3100909.3244.2392.sr.lock │ ├── timestamps │ ├── a00000004.spx │ ├── a0000000a.spx │ ├── a00000011.spx │ ├── a00000037.spx │ ├── a00000001.freelist │ ├── a00000001.gdbtable │ ├── a00000001.gdbtablx │ ├── a00000002.gdbtable │ ├── a00000002.gdbtablx │ ├── a00000003.gdbtable │ ├── a00000003.gdbtablx │ ├── a00000004.freelist │ ├── a00000004.gdbtable │ ├── a00000004.gdbtablx │ ├── a00000005.gdbtable │ ├── a00000005.gdbtablx │ ├── a00000006.freelist │ ├── a00000006.gdbtable │ ├── a00000006.gdbtablx │ ├── a00000007.gdbtable │ ├── a00000007.gdbtablx │ ├── a0000000a.freelist │ ├── a0000000a.gdbtable │ ├── a0000000a.gdbtablx │ ├── a00000011.freelist │ ├── a00000011.gdbtable │ ├── a00000011.gdbtablx │ ├── a00000037.gdbtable │ ├── a00000037.gdbtablx │ ├── a00000001.gdbindexes │ ├── a00000003.gdbindexes │ ├── a00000004.gdbindexes │ ├── a00000005.gdbindexes │ ├── a00000006.gdbindexes │ ├── a00000007.gdbindexes │ ├── a0000000a.gdbindexes │ ├── a00000011.gdbindexes │ ├── a00000037.gdbindexes │ ├── a00000001.TablesByName.atx │ ├── a00000007.CatRelTypesByName.atx │ ├── a00000005.CatItemTypesByName.atx │ ├── a00000004.CatItemsByPhysicalName.atx │ ├── a00000007.CatRelTypesByForwardLabel.atx │ ├── a00000007.CatRelTypesByBackwardLabel.atx │ ├── a00000004.FDO_UUID.atx │ ├── a00000006.FDO_UUID.atx │ ├── a00000004.CatItemsByType.atx │ ├── a00000006.CatRelsByOriginID.atx │ ├── a00000006.CatRelsByType.atx │ ├── a00000005.CatItemTypesByUUID.atx │ ├── a00000006.CatRelsByDestinationID.atx │ ├── a00000007.CatRelTypesByUUID.atx │ ├── a00000005.CatItemTypesByParentTypeID.atx │ ├── a00000007.CatRelTypesByDestItemTypeID.atx │ └── a00000007.CatRelTypesByOriginItemTypeID.atx ├── Symbology Layers │ ├── Templates.gdb │ │ ├── gdb │ │ ├── timestamps │ │ ├── a00000004.spx │ │ ├── a0000000b.spx │ │ ├── a00000001.freelist │ │ ├── a00000001.gdbindexes │ │ ├── a00000001.gdbtable │ │ ├── a00000001.gdbtablx │ │ ├── a00000002.gdbtable │ │ ├── a00000002.gdbtablx │ │ ├── a00000003.gdbindexes │ │ ├── a00000003.gdbtable │ │ ├── a00000004.freelist │ │ ├── a00000004.gdbindexes │ │ ├── a00000004.gdbtable │ │ ├── a00000004.gdbtablx │ │ ├── a00000005.gdbindexes │ │ ├── a00000005.gdbtable │ │ ├── a00000005.gdbtablx │ │ ├── a00000006.freelist │ │ ├── a00000006.gdbindexes │ │ ├── a00000006.gdbtable │ │ ├── a00000007.gdbindexes │ │ ├── a00000007.gdbtable │ │ ├── a00000007.gdbtablx │ │ ├── a0000000b.freelist │ │ ├── a0000000b.gdbindexes │ │ ├── a0000000b.gdbtable │ │ ├── a0000000b.gdbtablx │ │ ├── a00000004.FDO_UUID.atx │ │ ├── a00000006.FDO_UUID.atx │ │ ├── a00000001.TablesByName.atx │ │ ├── a00000006.CatRelsByType.atx │ │ ├── a00000004.CatItemsByType.atx │ │ ├── a00000005.CatItemTypesByName.atx │ │ ├── a00000006.CatRelsByOriginID.atx │ │ ├── a00000007.CatRelTypesByName.atx │ │ ├── a00000004.CatItemsByPhysicalName.atx │ │ ├── a00000006.CatRelsByDestinationID.atx │ │ ├── a00000007.CatRelTypesByBackwardLabel.atx │ │ ├── a00000007.CatRelTypesByForwardLabel.atx │ │ ├── a00000005.CatItemTypesByUUID.atx │ │ ├── a00000007.CatRelTypesByUUID.atx │ │ ├── a00000005.CatItemTypesByParentTypeID.atx │ │ ├── a00000007.CatRelTypesByDestItemTypeID.atx │ │ └── a00000007.CatRelTypesByOriginItemTypeID.atx │ ├── Network_Nodes.lyr │ └── Network_Branches.lyr ├── README.pdf ├── NetworkGT.tbx ├── UserGuide.pdf ├── Practicals_V1.pdf ├── Scripts │ ├── EnvelopeNetworkArea.py │ ├── PlotTopology.py │ ├── DistributionAnalysis.py │ ├── Histogram.py │ ├── HistogramPlotData.py │ ├── Sets.py │ ├── LineFrequencyPlot.py │ ├── WeightedRoseDiagramPlots.py │ └── SimpleGrid.py └── Install │ ├── Pathway2Anaconda.py │ └── Install.py ├── QGIS ├── Dataset │ ├── Interpretation.cpg │ ├── Fracture_Network.dbf │ ├── Fracture_Network.shp │ ├── Fracture_Network.shx │ ├── Interpretation.dbf │ ├── Interpretation.shp │ ├── Interpretation.shx │ ├── Interpretation.prj │ ├── Fracture_Network.prj │ └── Interpretation.qpj ├── network_gt │ ├── networkgt │ │ └── flow │ │ │ ├── porepy │ │ │ ├── fracs │ │ │ │ └── __init__.py │ │ │ ├── grids │ │ │ │ ├── __init__.py │ │ │ │ ├── gmsh │ │ │ │ │ └── __init__.py │ │ │ │ ├── standard_grids │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── utils.py │ │ │ │ ├── point_grid.py │ │ │ │ ├── constants.py │ │ │ │ ├── remove_grids.py │ │ │ │ └── fv_sub_grid.py │ │ │ ├── models │ │ │ │ ├── __init__.py │ │ │ │ ├── .#contact_mechanics_model.py │ │ │ │ └── run_models.py │ │ │ ├── numerics │ │ │ │ ├── __init__.py │ │ │ │ ├── fv │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── invert_diagonal_blocks.pyx │ │ │ │ ├── linalg │ │ │ │ │ └── __init__.py │ │ │ │ ├── mixed_dim │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── README.md │ │ │ │ ├── nonlinear │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── nonlinear_solvers.py │ │ │ │ ├── fem │ │ │ │ │ └── __init__.py │ │ │ │ ├── contact_mechanics │ │ │ │ │ └── __init__.py │ │ │ │ ├── vem │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── README.md │ │ │ │ │ └── vem_source.py │ │ │ │ ├── interface_laws │ │ │ │ │ └── __init__.py │ │ │ │ ├── README.md │ │ │ │ ├── linear_solvers.py │ │ │ │ └── discretization.py │ │ │ ├── params │ │ │ │ ├── __init__.py │ │ │ │ ├── fluid.py │ │ │ │ └── parameter_dictionaries.py │ │ │ ├── utils │ │ │ │ ├── __init__.py │ │ │ │ ├── derived_discretizations │ │ │ │ │ └── __init__.py │ │ │ │ ├── read_config.py │ │ │ │ ├── grid_utils.py │ │ │ │ ├── matrix_compression.py │ │ │ │ ├── permutations.py │ │ │ │ ├── mcolon.py │ │ │ │ ├── common_constants.py │ │ │ │ ├── graph.py │ │ │ │ ├── tags.py │ │ │ │ ├── error.py │ │ │ │ └── accumarray.py │ │ │ ├── ad │ │ │ │ ├── __init__.py │ │ │ │ ├── utils.py │ │ │ │ └── functions.py │ │ │ ├── geometry │ │ │ │ ├── __init__.py │ │ │ │ └── bounding_box.py │ │ │ └── viz │ │ │ │ └── __init__.py │ │ │ └── fcts.py │ ├── icons │ │ ├── BA.jpg │ │ ├── BN.jpg │ │ ├── CG.jpg │ │ ├── CL.jpg │ │ ├── DA.jpg │ │ ├── FM.jpg │ │ ├── H.jpg │ │ ├── IB.jpg │ │ ├── LF.jpg │ │ ├── LG.jpg │ │ ├── N.jpg │ │ ├── RD.jpg │ │ ├── RT.jpg │ │ ├── SN.jpg │ │ ├── SP.jpg │ │ ├── T.jpg │ │ ├── TP.jpg │ │ ├── Sets.jpg │ │ ├── icon.png │ │ └── Ynode.jpg │ ├── help │ │ └── source │ │ │ └── index.rst │ ├── __init__.py │ ├── metadata.txt │ └── network_gt.py └── README.pdf ├── Images ├── Read.jpg ├── Analyze.jpg ├── Figure.jpg ├── Flow │ ├── 1a.JPG │ ├── 1b.JPG │ ├── 2a.JPG │ ├── 2b.JPG │ ├── 3a.JPG │ ├── 3b.JPG │ ├── 3c.JPG │ ├── 4a.JPG │ ├── 4b.JPG │ ├── 4c.JPG │ ├── Figure 1.JPG │ └── Figure 2.JPG ├── Install.jpg ├── FlowWorkflow.png ├── RepairNetwork.png ├── AutoDigitisation.png ├── GeometryWorkflow.png ├── NetworkGT_Logo1.png ├── Samplingmethods.png ├── TopologyWorkflow.png ├── DigitisingWorkflow.png ├── Graphical_Abstract.png └── Graphical_Abstract-01.png ├── _config.yml ├── README.md └── .gitignore /ArcGIS/NetworkGT_Example.gdb/gdb: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /QGIS/Dataset/Interpretation.cpg: -------------------------------------------------------------------------------- 1 | UTF-8 -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/gdb: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/fracs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/models/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/params/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/_gdb.GEO3100909.3244.2392.sr.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/gmsh/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/fv/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/linalg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/mixed_dim/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/nonlinear/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/fem/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/standard_grids/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/contact_mechanics/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/derived_discretizations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Images/Read.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Read.jpg -------------------------------------------------------------------------------- /QGIS/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/README.pdf -------------------------------------------------------------------------------- /ArcGIS/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/README.pdf -------------------------------------------------------------------------------- /Images/Analyze.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Analyze.jpg -------------------------------------------------------------------------------- /Images/Figure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Figure.jpg -------------------------------------------------------------------------------- /Images/Flow/1a.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/1a.JPG -------------------------------------------------------------------------------- /Images/Flow/1b.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/1b.JPG -------------------------------------------------------------------------------- /Images/Flow/2a.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/2a.JPG -------------------------------------------------------------------------------- /Images/Flow/2b.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/2b.JPG -------------------------------------------------------------------------------- /Images/Flow/3a.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/3a.JPG -------------------------------------------------------------------------------- /Images/Flow/3b.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/3b.JPG -------------------------------------------------------------------------------- /Images/Flow/3c.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/3c.JPG -------------------------------------------------------------------------------- /Images/Flow/4a.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/4a.JPG -------------------------------------------------------------------------------- /Images/Flow/4b.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/4b.JPG -------------------------------------------------------------------------------- /Images/Flow/4c.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/4c.JPG -------------------------------------------------------------------------------- /Images/Install.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Install.jpg -------------------------------------------------------------------------------- /ArcGIS/NetworkGT.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT.tbx -------------------------------------------------------------------------------- /ArcGIS/UserGuide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/UserGuide.pdf -------------------------------------------------------------------------------- /Images/FlowWorkflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/FlowWorkflow.png -------------------------------------------------------------------------------- /ArcGIS/Practicals_V1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Practicals_V1.pdf -------------------------------------------------------------------------------- /Images/Flow/Figure 1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/Figure 1.JPG -------------------------------------------------------------------------------- /Images/Flow/Figure 2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Flow/Figure 2.JPG -------------------------------------------------------------------------------- /Images/RepairNetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/RepairNetwork.png -------------------------------------------------------------------------------- /Images/AutoDigitisation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/AutoDigitisation.png -------------------------------------------------------------------------------- /Images/GeometryWorkflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/GeometryWorkflow.png -------------------------------------------------------------------------------- /Images/NetworkGT_Logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/NetworkGT_Logo1.png -------------------------------------------------------------------------------- /Images/Samplingmethods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Samplingmethods.png -------------------------------------------------------------------------------- /Images/TopologyWorkflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/TopologyWorkflow.png -------------------------------------------------------------------------------- /QGIS/network_gt/icons/BA.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/BA.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/BN.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/BN.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/CG.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/CG.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/CL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/CL.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/DA.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/DA.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/FM.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/FM.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/H.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/H.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/IB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/IB.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/LF.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/LF.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/LG.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/LG.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/N.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/N.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/RD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/RD.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/RT.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/RT.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/SN.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/SN.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/SP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/SP.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/T.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/T.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/TP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/TP.jpg -------------------------------------------------------------------------------- /Images/DigitisingWorkflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/DigitisingWorkflow.png -------------------------------------------------------------------------------- /Images/Graphical_Abstract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Graphical_Abstract.png -------------------------------------------------------------------------------- /QGIS/network_gt/icons/Sets.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/Sets.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/icon.png -------------------------------------------------------------------------------- /Images/Graphical_Abstract-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/Images/Graphical_Abstract-01.png -------------------------------------------------------------------------------- /QGIS/Dataset/Fracture_Network.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/Dataset/Fracture_Network.dbf -------------------------------------------------------------------------------- /QGIS/Dataset/Fracture_Network.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/Dataset/Fracture_Network.shp -------------------------------------------------------------------------------- /QGIS/Dataset/Fracture_Network.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/Dataset/Fracture_Network.shx -------------------------------------------------------------------------------- /QGIS/Dataset/Interpretation.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/Dataset/Interpretation.dbf -------------------------------------------------------------------------------- /QGIS/Dataset/Interpretation.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/Dataset/Interpretation.shp -------------------------------------------------------------------------------- /QGIS/Dataset/Interpretation.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/Dataset/Interpretation.shx -------------------------------------------------------------------------------- /QGIS/network_gt/icons/Ynode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/QGIS/network_gt/icons/Ynode.jpg -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/models/.#contact_mechanics_model.py: -------------------------------------------------------------------------------- 1 | ivar@ivar-HP-EliteBook-Folio-1040-G3.8217:1576658750 -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/timestamps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/timestamps -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000004.spx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a0000000a.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a0000000a.spx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000011.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000011.spx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000037.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000037.spx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Network_Nodes.lyr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Network_Nodes.lyr -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/vem/__init__.py: -------------------------------------------------------------------------------- 1 | """ Implementation of methods related to the virtual element method. 2 | """ 3 | -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Network_Branches.lyr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Network_Branches.lyr -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000001.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000001.freelist -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000001.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000001.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000001.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000001.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000002.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000002.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000002.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000002.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000003.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000003.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000003.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000003.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000004.freelist -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000004.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000004.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000005.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000005.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000005.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000005.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000006.freelist -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000006.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000006.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000007.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000007.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a0000000a.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a0000000a.freelist -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a0000000a.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a0000000a.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a0000000a.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a0000000a.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000011.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000011.freelist -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000011.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000011.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000011.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000011.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000037.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000037.gdbtable -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000037.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000037.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/timestamps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/timestamps -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000001.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000001.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000003.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000003.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000004.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000005.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000005.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000006.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000007.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a0000000a.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a0000000a.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000011.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000011.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000037.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000037.gdbindexes -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/interface_laws/__init__.py: -------------------------------------------------------------------------------- 1 | """ Discretization of coupling terms for mixed-dimensional problems. 2 | """ 3 | -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.spx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a0000000b.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a0000000b.spx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000001.TablesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000001.TablesByName.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000001.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000001.freelist -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000001.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000001.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000001.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000001.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000001.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000001.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000002.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000002.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000002.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000002.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000003.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000003.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000003.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000003.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.freelist -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000005.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000005.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000005.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000005.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000005.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000005.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000006.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000006.freelist -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000006.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000006.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000006.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000006.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000007.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000007.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000007.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a0000000b.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a0000000b.freelist -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a0000000b.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a0000000b.gdbindexes -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a0000000b.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a0000000b.gdbtable -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a0000000b.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a0000000b.gdbtablx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByName.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.FDO_UUID.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.FDO_UUID.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000006.FDO_UUID.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000006.FDO_UUID.atx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000005.CatItemTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000005.CatItemTypesByName.atx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.CatItemsByPhysicalName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000004.CatItemsByPhysicalName.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000001.TablesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000001.TablesByName.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000006.CatRelsByType.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000006.CatRelsByType.atx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByForwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByForwardLabel.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.CatItemsByType.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.CatItemsByType.atx -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByBackwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByBackwardLabel.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000005.CatItemTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000005.CatItemTypesByName.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000006.CatRelsByOriginID.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000006.CatRelsByOriginID.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByName.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000004.CatItemsByPhysicalName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000004.CatItemsByPhysicalName.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000006.CatRelsByDestinationID.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000006.CatRelsByDestinationID.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByBackwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByBackwardLabel.atx -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByForwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BjornNyberg/NetworkGT/HEAD/ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByForwardLabel.atx -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/ad/__init__.py: -------------------------------------------------------------------------------- 1 | from porepy.ad.forward_mode import Ad_array, initAdArrays 2 | 3 | from porepy.ad.functions import exp, log, sign, abs 4 | from porepy.ad.utils import concatenate 5 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/geometry/__init__.py: -------------------------------------------------------------------------------- 1 | """ This package contains various modules related to geometry modifications. 2 | 3 | As a historical comment, many of the functions were previously located 4 | in pp.utils.comp_geom.py 5 | """ 6 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/README.md: -------------------------------------------------------------------------------- 1 | # Numerical schemes 2 | * finite volumes schemes for flow, elasticity, and transport [fv](fv) 3 | * virtual element methods for flow [vem](vem) 4 | * solver and mixed-dimensional interfaces [mixed_dim](mixed_dim) 5 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman 2 | title: NetworkGT 3 | 4 | navbar-links: 5 | Home: "https://bjornnyberg.github.io/NetworkGT/" 6 | Download: "https://github.com/BjornNyberg/NetworkGT/archive/V0.1.1.zip" 7 | Wiki: "https://github.com/BjornNyberg/NetworkGT/wiki" 8 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/read_config.py: -------------------------------------------------------------------------------- 1 | import multiprocessing,os,tempfile 2 | def read(): 3 | outDir = os.path.join(tempfile.gettempdir(),'porepy') 4 | config_file = os.path.join(outDir,'config_file.txt') 5 | f = open(config_file,'r') 6 | config = {'gmsh_path': r'%s'%(f.read()), 7 | 'num_processors': multiprocessing.cpu_count() } 8 | f.close() 9 | return config 10 | -------------------------------------------------------------------------------- /QGIS/Dataset/Interpretation.prj: -------------------------------------------------------------------------------- 1 | PROJCS["OSGB_1936_British_National_Grid",GEOGCS["GCS_OSGB 1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["Meter",1]] -------------------------------------------------------------------------------- /QGIS/Dataset/Fracture_Network.prj: -------------------------------------------------------------------------------- 1 | PROJCS["OSGB_1936_British_National_Grid",GEOGCS["GCS_OSGB 1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["Meter",1]] -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/vem/README.md: -------------------------------------------------------------------------------- 1 | # Virtual element methods for Darcy problems 2 | 3 | In this part the basic tools to create the matrix and right-had side for a Darcy problem. 4 | 5 | We have: 6 | * mixed virtual element method with hybrid-dimensional coupler [dual.py](dual.py) 7 | * hybridized mixed virtual element method [hybrid.py](hybrid.py) 8 | 9 | Dimensions available: 0d, 1d, 2d, 3d. In 1d and 2d also not on the (x,y) plane. 10 | 11 | Examples are reported in [examples](examples) folder. 12 | -------------------------------------------------------------------------------- /QGIS/network_gt/help/source/index.rst: -------------------------------------------------------------------------------- 1 | .. NetworkGT documentation master file, created by 2 | sphinx-quickstart on Sun Feb 12 17:11:03 2012. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to NetworkGT's documentation! 7 | ============================================ 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | Indices and tables 15 | ================== 16 | 17 | * :ref:`genindex` 18 | * :ref:`modindex` 19 | * :ref:`search` 20 | 21 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/ad/utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import scipy.sparse as sps 3 | 4 | from porepy.ad.forward_mode import Ad_array, initAdArrays 5 | 6 | 7 | def concatenate(variables, axis=0): 8 | vals = [var.val for var in variables] 9 | jacs = np.array([var.jac for var in variables]) 10 | 11 | vals_stacked = np.concatenate(vals, axis=axis) 12 | jacs_stacked = [] 13 | jacs_stacked = sps.vstack(jacs) 14 | # for i in range(jacs.shape[1]): 15 | # jacs_stacked.append(sps.vstack(jacs[:, i])) 16 | 17 | return Ad_array(vals_stacked, jacs_stacked) 18 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/viz/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Modules for visualization in the form of plotting in Python and exporting to the vtu 3 | format. 4 | 5 | Modules: 6 | exporter: Export of grids or grid buckets with associated data to vtu files. 7 | fracture_visualization: Visualization of fracture networks and wells by plotting in 8 | Python. 9 | plot_grid: Python plotting of grids and grid buckets. Both the geometry and data can 10 | be shown. The latter is represented either by cell-wise color maps or cell- or 11 | face-wise arrows for vectors. 12 | """ 13 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/mixed_dim/README.md: -------------------------------------------------------------------------------- 1 | # Solver and mixed-dimensional interfaces 2 | 3 | In this part the basic classes to be inherited by the solvers and the couplers, and the main mixed-dimensional coupler. 4 | 5 | We have: 6 | * abstract interface for numerical solvers [solver.py](solver.py) 7 | * abstract interface for numerical couplers between solvers for the mixed-dimensional [abstract_coupling.py](abstract_coupling.py) 8 | * coupler for the mixed-dimensional approach [coupler.py](coupler.py) 9 | * static condensation or Schur complement proceedure [condensation.py](condensation.py) 10 | -------------------------------------------------------------------------------- /QGIS/Dataset/Interpretation.qpj: -------------------------------------------------------------------------------- 1 | PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy 1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],TOWGS84[446.448,-125.157,542.06,0.15,0.247,0.842,-20.489],AUTHORITY["EPSG","6277"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4277"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","27700"]] 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NetworkGT 2 | The NetworkGT (Network Geometry and Topology) Toolbox is a set of tools designed for the geometric and topological analysis of fracture networks. 3 | 4 | The toolbox is available as a plugin for QGIS 3.4 > under the GNU General Public License V3. Please refer to the [wiki](https://github.com/BjornNyberg/NetworkGT/wiki) for installation, workflow and user guide. 5 | 6 | Current version - v0.1 (13.03.2018) 7 | 8 | 9 | 10 | 11 | ### Citation 12 | 13 | Nyberg, B., Nixon, C.W., Sanderson, D.J., 2018, NetworkGT: A GIS tool for geometric and topological analyses of two-dimensional fracture networks. Geosphere, v. 14, no. 4, doi:10.1130/GES01595.1. 14 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/point_grid.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import scipy.sparse as sps 3 | 4 | from porepy.grids.grid import Grid 5 | 6 | 7 | class PointGrid(Grid): 8 | 9 | # ------------------------------------------------------------------------------# 10 | 11 | def __init__(self, pt, name=None): 12 | """ 13 | Constructor for 0D grid 14 | 15 | Parameters 16 | pt (np.array): Point which represent the grid 17 | name (str): Name of grid, passed to super constructor 18 | """ 19 | 20 | name = "PointGrid" if name is None else name 21 | 22 | face_nodes = sps.identity(1, int, "csr") 23 | cell_faces = sps.identity(1, int, "csr") 24 | pt = np.asarray(pt).reshape((3, 1)) 25 | 26 | super(PointGrid, self).__init__(0, pt, face_nodes, cell_faces, name) 27 | 28 | 29 | # ------------------------------------------------------------------------------# 30 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/ad/functions.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from porepy.ad.forward_mode import Ad_array 4 | 5 | 6 | def exp(var): 7 | if isinstance(var, Ad_array): 8 | val = np.exp(var.val) 9 | der = var.diagvec_mul_jac(np.exp(var.val)) 10 | return Ad_array(val, der) 11 | else: 12 | return np.exp(var) 13 | 14 | 15 | def log(var): 16 | if not isinstance(var, Ad_array): 17 | return np.log(var) 18 | 19 | val = np.log(var.val) 20 | der = var.diagvec_mul_jac(1 / var.val) 21 | return Ad_array(val, der) 22 | 23 | 24 | def sign(var): 25 | if not isinstance(var, Ad_array): 26 | return np.sign(var) 27 | else: 28 | return np.sign(var.val) 29 | 30 | 31 | def abs(var): 32 | if not isinstance(var, Ad_array): 33 | return np.abs(var) 34 | else: 35 | val = np.abs(var.val) 36 | jac = var.diagvec_mul_jac(sign(var)) 37 | return Ad_array(val, jac) 38 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/geometry/bounding_box.py: -------------------------------------------------------------------------------- 1 | """ 2 | Compute bounding boxes of geometric objects. 3 | """ 4 | 5 | 6 | def from_points(pts, overlap=0, extend_to_3d=False): 7 | """ Obtain a bounding box for a point cloud. 8 | 9 | Parameters: 10 | pts: np.ndarray (nd x npt). Point cloud. nd should be 2 or 3 11 | overlap (double, defaults to 0): Extension of the bounding box outside 12 | the point cloud. Scaled with extent of the point cloud in the 13 | respective dimension. 14 | extend_to_3d: if the pts are given as 2d add also the zmin and zmax 15 | 16 | Returns: 17 | domain (dictionary): Containing keywords xmin, xmax, ymin, ymax, and 18 | possibly zmin and zmax (if nd == 3) 19 | 20 | """ 21 | max_coord = pts.max(axis=1) 22 | min_coord = pts.min(axis=1) 23 | dx = max_coord - min_coord 24 | domain = { 25 | "xmin": min_coord[0] - dx[0] * overlap, 26 | "xmax": max_coord[0] + dx[0] * overlap, 27 | "ymin": min_coord[1] - dx[1] * overlap, 28 | "ymax": max_coord[1] + dx[1] * overlap, 29 | } 30 | 31 | if extend_to_3d and max_coord.size == 2: 32 | domain["zmin"] = 0 33 | domain["zmax"] = 0 34 | 35 | if max_coord.size == 3: 36 | domain["zmin"] = min_coord[2] - dx[2] * overlap 37 | domain["zmax"] = max_coord[2] + dx[2] * overlap 38 | return domain 39 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/constants.py: -------------------------------------------------------------------------------- 1 | class GmshConstants(object): 2 | """ 3 | This class is a container for storing constant values that are used in 4 | the meshing algorithm. The intention is to make them available to all 5 | functions and modules. 6 | 7 | This may not be the most pythonic way of doing this, but it works. 8 | """ 9 | 10 | def __init__(self): 11 | self.DOMAIN_BOUNDARY_TAG = 1 12 | self.COMPARTMENT_BOUNDARY_TAG = 2 13 | self.FRACTURE_TAG = 3 14 | # Tag for objects on the fracture tip 15 | self.FRACTURE_TIP_TAG = 4 16 | # Tag for objcets on the intersection between two fractures 17 | # (co-dimension n-2) 18 | self.FRACTURE_INTERSECTION_LINE_TAG = 5 19 | # Tag for objects on the intersection between three fractures 20 | # (co-dimension n-3) 21 | self.FRACTURE_INTERSECTION_POINT_TAG = 6 22 | # General auxiliary tag 23 | self.AUXILIARY_TAG = 7 24 | 25 | self.PHYSICAL_NAME_DOMAIN = "DOMAIN" 26 | self.PHYSICAL_NAME_DOMAIN_BOUNDARY = "DOMAIN_BOUNDARY_" 27 | self.PHYSICAL_NAME_FRACTURES = "FRACTURE_" 28 | self.PHYSICAL_NAME_AUXILIARY = "AUXILIARY_" 29 | 30 | # Physical name for fracture tips 31 | self.PHYSICAL_NAME_FRACTURE_TIP = "FRACTURE_TIP_" 32 | self.PHYSICAL_NAME_FRACTURE_LINE = "FRACTURE_LINE_" 33 | self.PHYSICAL_NAME_AUXILIARY_LINE = "AUXILIARY_LINE_" 34 | self.PHYSICAL_NAME_FRACTURE_POINT = "FRACTURE_POINT_" 35 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/grid_utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import scipy.sparse as sps 3 | 4 | 5 | def switch_sign_if_inwards_normal(g, nd, faces): 6 | """ Construct a matrix that changes sign of quantities on faces with a 7 | normal that points into the grid. 8 | 9 | Parameters: 10 | g (pp.Grid): Grid. 11 | nd (int): Number of quantities per face; this will for instance be the 12 | number of components in a face-vector. 13 | faces (np.array-like of ints): Index for which faces to be considered. Should only 14 | contain boundary faces. 15 | 16 | Returns: 17 | sps.dia_matrix: Diagonal matrix which switches the sign of faces if the 18 | normal vector of the face points into the grid g. Faces not considered 19 | will have a 0 diagonal term. If nd > 1, the first nd rows are associated 20 | with the first face, then nd elements of the second face etc. 21 | 22 | """ 23 | 24 | faces = np.asarray(faces) 25 | 26 | # Find out whether the boundary faces have outwards pointing normal vectors 27 | # Negative sign implies that the normal vector points inwards. 28 | sgn = g.sign_of_faces(faces) 29 | 30 | # Create vector with the sign in the places of faces under consideration, 31 | # zeros otherwise 32 | sgn_mat = np.zeros(g.num_faces) 33 | sgn_mat[faces] = sgn 34 | # Duplicate the numbers, the operator is intended for vector quantities 35 | sgn_mat = np.tile(sgn_mat, (nd, 1)).ravel(order="F") 36 | 37 | # Create the diagonal matrix. 38 | return sps.dia_matrix((sgn_mat, 0), shape=(sgn_mat.size, sgn_mat.size)) 39 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/matrix_compression.py: -------------------------------------------------------------------------------- 1 | """ Functions for compressing matrices to compact format, and recover them. 2 | 3 | Acknowledgements: 4 | The functions are a python translation of the corresponding matlab 5 | functions found in the Matlab Reservoir Simulation Toolbox (MRST) developed 6 | by SINTEF ICT, see www.sintef.no/projectweb/mrst/ . 7 | 8 | """ 9 | 10 | import numpy as np 11 | 12 | 13 | def rldecode(A, n): 14 | """ Decode compressed information. 15 | 16 | The code is heavily inspired by MRST's function with the same name, 17 | however, requirements on the shape of functions are probably somewhat 18 | different. 19 | 20 | >>> rldecode(np.array([1, 2, 3]), np.array([2, 3, 1])) 21 | [1, 1, 2, 2, 2, 3] 22 | 23 | >>> rldecode(np.array([1, 2]), np.array([1, 3])) 24 | [1, 2, 2, 2] 25 | 26 | Args: 27 | A (double, m x k), compressed matrix to be recovered. The 28 | compression should be along dimension 1 29 | n (int): Number of occurences for each element 30 | """ 31 | r = n > 0 32 | i = np.cumsum(np.hstack((np.zeros(1, dtype=int), n[r])), dtype=int) 33 | j = np.zeros(i[-1], dtype=int) 34 | j[i[1:-1:]] = 1 35 | B = A[np.cumsum(j)] 36 | return B 37 | 38 | 39 | def rlencode(A): 40 | """ Compress matrix by looking for identical columns. """ 41 | comp = A[::, 0:-1] != A[::, 1::] 42 | i = np.any(comp, axis=0) 43 | i = np.hstack((np.argwhere(i).ravel(), (A.shape[1] - 1))) 44 | 45 | num = np.diff(np.hstack((np.array([-1]), i))) 46 | 47 | return A[::, i], num 48 | 49 | 50 | if __name__ == "__main__": 51 | import doctest 52 | 53 | doctest.testmod() 54 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/permutations.py: -------------------------------------------------------------------------------- 1 | """ Utility function for permutation of numbers. 2 | """ 3 | 4 | 5 | def multinary_permutations(base, length): 6 | """ 7 | Define a generator over all numbers of a certain length for a number system 8 | with a specified base. 9 | 10 | For details on the decomposition into an arbitrary base see 11 | http://math.stackexchange.com/questions/111150/changing-a-number-between-arbitrary-bases 12 | 13 | Note that the generator will loop over base**length combinations. 14 | 15 | Examples: 16 | 17 | Construct the numbers [00] to [11] in binary numbers 18 | >>> multinary_permutations(2, 2) 19 | [array([ 0., 0.]), array([ 1., 0.]), array([ 0., 1.]), array([ 1., 1.])] 20 | 21 | Construct the numbers from 0 to 99 (permuted) in the decimal number 22 | system. 23 | >>> it = multinary_permutation(10, 2) 24 | 25 | Parameters: 26 | base (int): Base of the number system 27 | length (int): Number of digits in the numbers 28 | 29 | Yields: 30 | array, size length: Array describing the next number combination. 31 | 32 | """ 33 | 34 | # There are in total base ** length numbers to be covered, these need to be 35 | # rewritten into the base number system 36 | for iter1 in range(base ** length): 37 | 38 | # Array to store the multi-d index of the current index 39 | bit_val = [0] * length 40 | # Number to be decomposed 41 | v = iter1 42 | 43 | # Loop over all digits, find the expression of v in that system 44 | for iter2 in range(length): 45 | bit_val[iter2] = v % base 46 | v = v // base 47 | # Yield the next value 48 | yield bit_val 49 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/EnvelopeNetworkArea.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import arcpy 23 | 24 | def main (infc,outfc): 25 | try: 26 | 27 | if 'shp' in outfc: 28 | arcpy.AddError('Output parameter must be saved in a geodatabase') 29 | sys.exit() 30 | 31 | arcpy.Buffer_analysis(infc,"in_memory\\buffer",1, "FULL", "ROUND") 32 | arcpy.MinimumBoundingGeometry_management("in_memory\\buffer", outfc, "ENVELOPE", "ALL") 33 | except Exception,e: 34 | arcpy.AddError('%s'%(e)) 35 | 36 | finally: 37 | del_files = ["in_memory\\buffer"] 38 | for fname in del_files: 39 | try: 40 | arcpy.DeleteFeatures_management(fname) 41 | except Exception: 42 | continue 43 | 44 | if __name__ == "__main__": 45 | ###Inputs### 46 | 47 | infc = arcpy.GetParameterAsText(0) 48 | outfc = arcpy.GetParameterAsText(1) 49 | 50 | main(infc,outfc) 51 | 52 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/models/run_models.py: -------------------------------------------------------------------------------- 1 | """ This module contains functions to run stationary and time-dependent models. 2 | 3 | """ 4 | import logging 5 | 6 | import porepy as pp 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | def run_stationary_model(setup, params): 12 | setup.prepare_simulation() 13 | 14 | nl_solver = pp.NewtonSolver(params) 15 | 16 | nl_solver.solve(setup) 17 | 18 | setup.after_simulation() 19 | 20 | 21 | def run_time_dependent_model(setup, params): 22 | """ 23 | Time loop for the model classes. 24 | 25 | Args: 26 | setup: Model class containing all information on parameters, variables, discretization, 27 | geometry. Various methods such as those relating to solving the system, see the appropriate 28 | solver for documentation. 29 | params: Parameters related to the solution proceedure. # Why not just set these as e.g. setup.solution_parameters, EK? And then specify (here, or at top level of the respective solvers) which parameters are required. 30 | non_line 31 | """ 32 | # Assign parameters, variables and discretizations. Discretize time-indepedent terms 33 | if params.get("prepare_simulation", True): 34 | setup.prepare_simulation() 35 | 36 | # Prepare for the time loop 37 | t_end = setup.end_time 38 | k = 0 39 | if setup._is_nonlinear_problem(): 40 | solver = pp.NewtonSolver(params) 41 | else: 42 | solver = pp.LinearSolver(params) 43 | while setup.time < t_end: 44 | setup.time += setup.time_step 45 | k += 1 46 | logger.info( 47 | "\nTime step {} at time {:.1e} of {:.1e} with time step {:.1e}".format( 48 | k, setup.time, t_end, setup.time_step 49 | ) 50 | ) 51 | solver.solve(setup) 52 | 53 | setup.after_simulation() 54 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/fv/invert_diagonal_blocks.pyx: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | cimport numpy as np 3 | 4 | def inv_python(indptr, int[:] ind, double[:] data, long[:] sz): 5 | """ 6 | Invert block matrices by explicitly forming local matrices. The code 7 | in itself is not efficient, but it is hopefully well suited for 8 | speeding up with numba. 9 | 10 | It may be possible to restruct the code to further help numba, 11 | this has not been investigated. 12 | 13 | The computation can easily be parallelized, consider this later. 14 | """ 15 | 16 | cdef unsigned int iter1, iter2, iter3 17 | 18 | inv_vals = np.zeros(np.sum(np.square(sz))) 19 | 20 | # Bookkeeping 21 | num_per_row = indptr[1:] - indptr[0:-1] 22 | cdef int row_next = 0 23 | cdef int global_counter = 0 24 | cdef int block_size_prev = 0 25 | cdef int next_imat = 0 26 | 27 | # Loop over all blocks 28 | for iter1 in range(sz.size): 29 | n = sz[iter1] 30 | loc_mat = np.zeros((n, n)) 31 | row_loc = 0 32 | # Fill in non-zero elements in local matrix 33 | for iter2 in range(n): 34 | for iter3 in range(num_per_row[row_next]): 35 | loc_col = ind[global_counter] - block_size_prev 36 | loc_mat[row_loc, loc_col] = data[global_counter] 37 | global_counter += 1 38 | row_next += 1 39 | row_loc += 1 40 | 41 | # Compute inverse. np.linalg.inv is supported by numba (May 42 | # 2016), it is not clear if this is the best option. To be 43 | # revised 44 | inv_mat = np.linalg.inv(loc_mat).reshape(n**2) 45 | 46 | loc_ind = next_imat + np.arange(n**2) 47 | inv_vals[loc_ind] = inv_mat 48 | # Update fields 49 | next_imat += n**2 50 | block_size_prev += n 51 | return inv_vals 52 | -------------------------------------------------------------------------------- /QGIS/network_gt/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | /*************************************************************************** 4 | NetworkGT 5 | A QGIS plugin 6 | The NetworkGT (Network Geometry and Typology) Toolbox is a set of tools designed for the geometric and topological analysis of fracture networks. 7 | Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ 8 | ------------------- 9 | begin : 2019-08-22 10 | copyright : (C) 2019 by Bjorn Nyberg 11 | email : bjorn.nyberg@uib.no 12 | ***************************************************************************/ 13 | 14 | /*************************************************************************** 15 | * * 16 | * This program is free software; you can redistribute it and/or modify * 17 | * it under the terms of the GNU General Public License as published by * 18 | * the Free Software Foundation; either version 2 of the License, or * 19 | * (at your option) any later version. * 20 | * * 21 | ***************************************************************************/ 22 | This script initializes the plugin, making it known to QGIS. 23 | """ 24 | 25 | __author__ = 'Bjorn Nyberg' 26 | __date__ = '2019-08-22' 27 | __copyright__ = '(C) 2019 by Bjorn Nyberg' 28 | 29 | 30 | # noinspection PyPep8Naming 31 | def classFactory(iface): # pylint: disable=invalid-name 32 | """Load NetworkGT class from file NetworkGT. 33 | 34 | :param iface: A QGIS interface instance. 35 | :type iface: QgsInterface 36 | """ 37 | # 38 | from .network_gt import NetworkGTPlugin 39 | return NetworkGTPlugin() 40 | -------------------------------------------------------------------------------- /QGIS/network_gt/metadata.txt: -------------------------------------------------------------------------------- 1 | # This file contains metadata for your plugin. 2 | 3 | # This file should be included when you package your plugin.# Mandatory items: 4 | 5 | [general] 6 | name=NetworkGT 7 | qgisMinimumVersion=3.10 8 | description=NetworkGT (Network Geometry and Topology) Toolbox is a set of tools designed for the geometric and topological analysis of fracture networks. 9 | version=1.0 10 | author=Bjorn Nyberg 11 | email=bjorn.nyberg@uib.no 12 | 13 | about=Citation - Nyberg, B., Nixon, C.W., Sanderson, D.J., 2018, NetworkGT: A GIS tool for geometric and topological analyses of two-dimensional fracture networks. Geosphere, v. 14, no. 4, doi:10.1130/GES01595.1. 14 | 15 | tracker=https://github.com/BjornNyberg/NetworkGT/issues 16 | repository=https://github.com/BjornNyberg/NetworkGT/tree/master/QGIS/network_gt 17 | # End of mandatory metadata 18 | 19 | # Recommended items: 20 | 21 | hasProcessingProvider=yes 22 | # Uncomment the following line and add your changelog: 23 | # changelog= 24 | 25 | # Tags are comma separated with spaces allowed 26 | tags=topology, geometry, fracture networks, nodes, branches, distribution analyses, rose diagram, sets, histogram, line frequency, clusters, blocks, contour grids,tortuosity, shortest pathway, skeleton, repair, snap, flow, aperture, permeability, percolation 27 | 28 | homepage=https://github.com/BjornNyberg/NetworkGT/wiki 29 | category=Analysis 30 | icon=icon.png 31 | # experimental flag 32 | experimental=False 33 | 34 | # deprecated flag (applies to the whole plugin, not just a single version) 35 | deprecated=False 36 | 37 | # Since QGIS 3.8, a comma separated list of plugins to be installed 38 | # (or upgraded) can be specified. 39 | # Check the documentation for more information. 40 | # plugin_dependencies= 41 | 42 | #Category of the plugin: Raster, Vector, Database or Web 43 | #category=Vector 44 | 45 | # If the plugin can run on QGIS Server. 46 | server=False 47 | 48 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/linear_solvers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module for the Linear Solver class, which is used to solve the linear 3 | system when using the model classes for linear systems. Note that the 4 | setup object has its own system to assemble and solve the system; this 5 | is just a wrapper around that, mostly for compliance with the nonlinear 6 | case, see numerics.nonlinear.nonlinear_solvers. 7 | """ 8 | from typing import Dict, Tuple 9 | 10 | from porepy.models.abstract_model import AbstractModel 11 | 12 | 13 | class LinearSolver: 14 | def __init__(self, params: Dict = None) -> None: 15 | """ Define linear solver. 16 | 17 | Parameters: 18 | params (dict): Parameters for the linear solver. Will be passed on to the 19 | model class. Thus the contect should be adapted to whatever needed for 20 | the problem at hand. 21 | 22 | """ 23 | if params is None: 24 | params = {} 25 | # default_options.update(params) 26 | self.params = params # default_options 27 | 28 | def solve(self, setup: AbstractModel) -> Tuple[float, bool]: 29 | """ Solve a linear problem defined by the current state of the model. 30 | 31 | Parameters: 32 | setup (subclass of pp.AbstractModel): Model to be solved. 33 | 34 | Returns: 35 | float: Norm of the error. 36 | boolean: True if the linear solver converged. 37 | 38 | """ 39 | 40 | setup.before_newton_loop() 41 | prev_sol = setup.get_state_vector() 42 | # For linear problems, the tolerance is irrelevant 43 | sol = setup.assemble_and_solve_linear_system(tol=0) 44 | error_norm, is_converged, _ = setup.check_convergence( 45 | sol, prev_sol, prev_sol, self.params 46 | ) 47 | 48 | if is_converged: 49 | setup.after_newton_convergence(sol, error_norm, iteration_counter=1) 50 | else: 51 | setup.after_newton_failure() 52 | return error_norm, is_converged 53 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/PlotTopology.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | import os,arcpy, subprocess,tempfile 22 | 23 | def main (shp): 24 | curfields = set([f.name for f in arcpy.ListFields(shp)]) 25 | fields = set(['I','Y','X','No__Branch']) 26 | check = fields - curfields 27 | if len(check) != 0: 28 | arcpy.AddError("Feature layer attributes not valid - run Topology Parameters tool") 29 | sys.exit() 30 | outDir = os.path.join(tempfile.gettempdir(),'NetworkGT') 31 | if not os.path.exists(outDir): 32 | os.mkdir(outDir) 33 | 34 | fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),'plottopologydata.py') 35 | table = os.path.join(outDir,'topology_table.xls') 36 | python_executer = r"C:\Python27\ArcGISx6410.6\python.exe" 37 | 38 | arcpy.env.workspace = os.path.dirname(table) 39 | 40 | 41 | arcpy.TableToExcel_conversion(shp,os.path.basename(table)) 42 | 43 | expression = [python_executer,fname,table] 44 | DETACHED_PROCESS = 0x00000008 45 | P=subprocess.Popen(expression, shell=False, stdin=None, stdout=None, stderr=None, close_fds=True,creationflags=DETACHED_PROCESS) 46 | 47 | if __name__ == "__main__": 48 | ###Inputs### 49 | 50 | shp = arcpy.GetParameterAsText(0) 51 | 52 | main(shp) 53 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/DistributionAnalysis.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import os,arcpy,subprocess,tempfile 23 | 24 | def main (infc,fields,groupby): 25 | 26 | outDir = os.path.join(tempfile.gettempdir(),'NetworkGT') 27 | if not os.path.exists(outDir): 28 | os.mkdir(outDir) 29 | 30 | fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),'DistributionPlotData.py') 31 | temp_csv = os.path.join(outDir,'temp_csv.csv') 32 | python_executer = r"C:\Python27\ArcGISx6410.6\python.exe" 33 | 34 | 35 | if groupby: 36 | fields.append(groupby) 37 | 38 | with open(temp_csv,'w') as f: 39 | with arcpy.da.SearchCursor(infc,fields) as cursor: 40 | for row in cursor: 41 | if groupby: 42 | ID = row[1] 43 | else: 44 | ID = 0 45 | f.write('%s:%s\n'%(row[0],ID)) 46 | 47 | expression = [python_executer,fname,temp_csv] 48 | DETACHED_PROCESS = 0x00000008 49 | P=subprocess.Popen(expression, shell=False, stdin=None, stdout=None, stderr=None, close_fds=True,creationflags=DETACHED_PROCESS) 50 | 51 | if __name__ == "__main__": 52 | ###Inputs### 53 | 54 | infc = arcpy.GetParameterAsText(0) 55 | field = [arcpy.GetParameterAsText(1)] 56 | grp = arcpy.GetParameterAsText(2) 57 | 58 | main(infc,field,grp) 59 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/standard_grids/utils.py: -------------------------------------------------------------------------------- 1 | import porepy as pp 2 | 3 | 4 | def set_mesh_sizes(mesh_args): 5 | """ 6 | Checks whether mesh_size_min and mesh_size_bound are present in the mesh_args dictionary. 7 | If not, they are set to 1/5 and 2 of the mesh_size_frac value, respectively. 8 | """ 9 | if not "mesh_size_frac" in mesh_args: 10 | raise ValueError("Mesh size parameters should be specified via mesh_size_frac") 11 | if "mesh_size_bound" not in mesh_args: 12 | mesh_args["mesh_size_bound"] = 2 * mesh_args["mesh_size_frac"] 13 | if "mesh_size_min" not in mesh_args: 14 | mesh_args["mesh_size_min"] = 1 / 5 * mesh_args["mesh_size_frac"] 15 | 16 | 17 | def make_gb_2d_simplex(mesh_args, points, edges, domain): 18 | """ 19 | Construct a grid bucket with triangle grid in the 2d domain. 20 | 21 | Args: 22 | mesh_args (dict): Contains at least "mesh_size_frac". If the optional values of 23 | "mesh_size_bound" and "mesh_size_min" are not provided, these are set by 24 | set_mesh_sizes. 25 | points (): Fracture endpoints. 26 | fractures (): Connectivity list of the fractures, pointing to the provided 27 | endpoint list. 28 | domain (dict): Defines the size of the rectangular domain. 29 | 30 | Returns: Grid bucket with geometry computation and node ordering performed. 31 | """ 32 | set_mesh_sizes(mesh_args) 33 | network = pp.FractureNetwork2d(points, edges, domain) 34 | gb = network.mesh(mesh_args) 35 | gb.compute_geometry() 36 | return gb 37 | 38 | 39 | def make_gb_2d_cartesian(n_cells, fractures, domain): 40 | """ 41 | Construct a grid bucket with Cartesian grid in the 2d domain. 42 | 43 | Args: 44 | n_cells list: Contains number of cells in x and y direction. 45 | fractures (list): Each element is an np.array([[x0, x1],[y0,y1]]) 46 | domain (dict): Defines the size of the rectangular domain. 47 | 48 | Returns: Grid bucket with geometry computation and node ordering performed. 49 | """ 50 | gb = pp.meshing.cart_grid( 51 | fractures, n_cells, physdims=[domain["xmax"], domain["ymax"]] 52 | ) 53 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/mcolon.py: -------------------------------------------------------------------------------- 1 | """ Efficient numpy.arange for arrays of start and end indices. 2 | 3 | Acknowledgements: 4 | The functions are a python translation of the corresponding matlab 5 | functions found in the Matlab Reservoir Simulation Toolbox (MRST) developed 6 | by SINTEF ICT, see www.sintef.no/projectweb/mrst/ . 7 | 8 | """ 9 | 10 | import numpy as np 11 | 12 | 13 | def mcolon(lo, hi): 14 | """ Expansion of np.arange(a, b) for arrays a and b. 15 | 16 | The code is equivalent to the following (less efficient) loop: 17 | arr = np.empty(0) 18 | for l, h in zip(lo, hi): 19 | arr = np.hstack((arr, np.arange(l, h, 1))) 20 | 21 | Parameters: 22 | lo (np.ndarray, int): Lower bounds of the arrays to be created. 23 | hi (np.ndarray, int): Upper bounds of the arrays to be created. The 24 | elements in hi will *not* be included in the resulting array. 25 | 26 | lo and hi should either have 1 or n elements. If their size are both 27 | larger than one, they should have the same length. 28 | 29 | Examples: 30 | >>> mcolon(np.array([0, 0, 0]), np.array([2, 4, 3])) 31 | array([0, 1, 0, 1, 2, 3, 0, 1, 2]) 32 | 33 | >>> mcolon(np.array([0, 1]), np.array([2])) 34 | array([0, 1, 1]) 35 | 36 | >>> mcolon(np.array([0, 1, 1, 1]), np.array([1, 3, 3, 3])) 37 | array([0, 1, 2, 1, 2, 1, 2]) 38 | 39 | """ 40 | if lo.size == 1: 41 | lo = lo * np.ones(hi.size, dtype="int64") 42 | if hi.size == 1: 43 | hi = hi * np.ones(lo.size, dtype="int64") 44 | if lo.size != hi.size: 45 | raise ValueError( 46 | "Low and high should have same number of elements, " "or a single item " 47 | ) 48 | 49 | i = hi >= lo + 1 50 | if not any(i): 51 | return np.array([], dtype=np.int32) 52 | 53 | lo = lo[i].astype(int) 54 | hi = (hi[i] - 1).astype(int) 55 | d = hi - lo + 1 56 | n = np.sum(d) 57 | 58 | x = np.ones(n, dtype=int) 59 | x[0] = lo[0] 60 | x[np.cumsum(d[0:-1])] = lo[1:] - hi[0:-1] 61 | return np.cumsum(x) 62 | 63 | 64 | if __name__ == "__main__": 65 | import doctest 66 | 67 | doctest.testmod() 68 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/common_constants.py: -------------------------------------------------------------------------------- 1 | """ 2 | The module is intended to give access to a set of unified keywords, units etc. 3 | 4 | To access the quantities, invoke pp.KEY. 5 | 6 | IMPLEMENTATION NOTE: This module may in the future be moved to an appropriate 7 | submodule. The access via pp.will remain. 8 | 9 | """ 10 | 11 | """ Global keywords 12 | 13 | Define unified keywords used throughout the software. 14 | """ 15 | # Used in data dictionary to identify discretization objects internally to a 16 | # grid or mortar grid 17 | DISCRETIZATION = "discretization" 18 | 19 | # Used in data dictionary to identify discretization objects on couplings 20 | # between grids and mortar grids 21 | COUPLING_DISCRETIZATION = "coupling_discretization" 22 | 23 | # Used in data dictionary to declear and keep track of primary variables 24 | PRIMARY_VARIABLES = "primary_variables" 25 | 26 | # Used in data dictionary to store parameters for discretizations 27 | PARAMETERS = "parameters" 28 | 29 | # Used in data dictionary to store computed discretization matrices 30 | DISCRETIZATION_MATRICES = "discretization_matrices" 31 | 32 | # Used in data dictionary to store the system state, e.g. primary variables. 33 | STATE = "state" 34 | 35 | """ Units """ 36 | # SI Prefixes 37 | NANO = 1e-9 38 | MICRO = 1e-6 39 | MILLI = 1e-3 40 | CENTI = 1e-2 41 | DECI = 1e-1 42 | KILO = 1e3 43 | MEGA = 1e6 44 | GIGA = 1e9 45 | 46 | # Time 47 | SECOND = 1.0 48 | MINUTE = 60 * SECOND 49 | HOUR = 60 * MINUTE 50 | DAY = 24 * HOUR 51 | YEAR = 365 * DAY 52 | 53 | # Weight 54 | KILOGRAM = 1.0 55 | GRAM = 1e-3 * KILOGRAM 56 | 57 | # Length 58 | METER = 1.0 59 | CENTIMETER = CENTI * METER 60 | MILLIMETER = MILLI * METER 61 | KILOMETER = KILO * METER 62 | 63 | # Pressure related quantities 64 | DARCY = 9.869233e-13 65 | MILLIDARCY = MILLI * DARCY 66 | 67 | PASCAL = 1.0 68 | BAR = 100000 * PASCAL 69 | ATMOSPHERIC_PRESSURE = BAR 70 | 71 | 72 | GRAVITY_ACCELERATION = 9.80665 * METER / SECOND ** 2 73 | 74 | # Temperature 75 | CELSIUS = 1.0 76 | 77 | 78 | def CELSIUS_to_KELVIN(celsius): 79 | return celsius + 273.15 80 | 81 | 82 | def KELKIN_to_CELSIUS(kelvin): 83 | return kelvin - 273.15 84 | 85 | 86 | # Force 87 | NEWTON = KILOGRAM * METER / SECOND ** 2 88 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/Histogram.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import os,arcpy,math,subprocess,tempfile 23 | 24 | def main (infc,bins,field,groupby): 25 | 26 | fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),'HistogramPlotData.py') 27 | outDir = os.path.join(tempfile.gettempdir(),'NetworkGT') 28 | if not os.path.exists(outDir): 29 | os.mkdir(outDir) 30 | temp_csv = os.path.join(outDir,'temp_csv.csv') 31 | python_executer = r"C:\Python27\ArcGISx6410.6\python.exe" 32 | 33 | if groupby: 34 | fields = [groupby] 35 | else: 36 | fields = [] 37 | 38 | fields.append(field) 39 | 40 | with open(temp_csv,'w') as f: 41 | with arcpy.da.SearchCursor(infc,fields) as cursor: 42 | for row in cursor: 43 | if groupby: 44 | f.write('%s:%s\n'%(row[0],row[1])) 45 | else: 46 | f.write('%s:%s\n'%(0,row[0])) 47 | 48 | expression = [python_executer,fname,temp_csv, bins] 49 | DETACHED_PROCESS = 0x00000008 50 | P=subprocess.Popen(expression, shell=False, stdin=None, stdout=None, stderr=None, close_fds=True,creationflags=DETACHED_PROCESS) 51 | 52 | if __name__ == "__main__": 53 | ###Inputs### 54 | 55 | infc = arcpy.GetParameterAsText(0) 56 | bins = arcpy.GetParameterAsText(1) 57 | field = arcpy.GetParameterAsText(2) 58 | grp = arcpy.GetParameterAsText(3) 59 | 60 | main(infc,bins,field,grp) 61 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/HistogramPlotData.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import sys,time,os 23 | import matplotlib.pyplot as plt 24 | import pandas as pd 25 | import numpy as np 26 | 27 | def main (data,bins): 28 | 29 | try: 30 | df = pd.read_csv(data,header=None,sep=':') 31 | os.remove(data) 32 | 33 | for n,g in df.groupby(0): 34 | fig = plt.figure('%s'%(n)) 35 | counts, bins2 = np.histogram(g[1], bins=eval(bins), range=(0, max(g[1]))) 36 | bins2 = list(bins2) 37 | bins2.append(max(bins2)+bins2[1]) 38 | ax = g[1].hist(bins=bins2,color = '0.75') 39 | ax.set_xlabel('Bins') 40 | ax.set_ylabel('Frequency') 41 | #ax.set_xticks(bins2) 42 | 43 | ax.set_ylim(0,max(counts)+1) 44 | ax.set_xlim(0,bins2[-1]) 45 | plt.title('Histogram Distribution') 46 | 47 | info = g[1].describe() 48 | row_labels = list(info.index) 49 | table_vals = [[round(x,2)] for x in list(info)] 50 | table = plt.table(colWidths = [0.2], cellText=table_vals,rowLabels=row_labels,colLabels=['Summary'],loc='upper right') 51 | #table.set_fontsize(15) 52 | #table.scale(1.2, 1.2) 53 | 54 | x,y = max(g[1])*0.75, len(g[1])*0.75 55 | plt.show() 56 | 57 | except Exception,e: 58 | print e 59 | time.sleep(10) 60 | 61 | if __name__ == "__main__": 62 | ###Inputs### 63 | 64 | inFC = sys.argv[1] 65 | bins = sys.argv[2] 66 | 67 | main(inFC,bins) 68 | 69 | -------------------------------------------------------------------------------- /QGIS/network_gt/network_gt.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | /*************************************************************************** 5 | NetworkGT 6 | A QGIS plugin 7 | The NetworkGT (Network Geometry and Typology) Toolbox is a set of tools designed for the geometric and topological analysis of fracture networks. 8 | Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ 9 | ------------------- 10 | begin : 2019-08-22 11 | copyright : (C) 2019 by Bjorn Nyberg 12 | email : bjorn.nyberg@uib.no 13 | ***************************************************************************/ 14 | 15 | /*************************************************************************** 16 | * * 17 | * This program is free software; you can redistribute it and/or modify * 18 | * it under the terms of the GNU General Public License as published by * 19 | * the Free Software Foundation; either version 2 of the License, or * 20 | * (at your option) any later version. * 21 | * * 22 | ***************************************************************************/ 23 | """ 24 | 25 | __author__ = 'Bjorn Nyberg' 26 | __date__ = '2019-08-22' 27 | __copyright__ = '(C) 2019 by Bjorn Nyberg' 28 | 29 | # This will get replaced with a git SHA1 when you do a git archive 30 | 31 | __revision__ = '$Format:%H$' 32 | 33 | import os 34 | import sys 35 | import inspect 36 | 37 | from qgis.core import QgsProcessingAlgorithm, QgsApplication 38 | from .network_gt_provider import NetworkGTProvider 39 | 40 | cmd_folder = os.path.split(inspect.getfile(inspect.currentframe()))[0] 41 | 42 | if cmd_folder not in sys.path: 43 | sys.path.insert(0, cmd_folder) 44 | 45 | 46 | class NetworkGTPlugin(object): 47 | 48 | def __init__(self): 49 | self.provider = None 50 | 51 | def initProcessing(self): 52 | """Init Processing provider for QGIS >= 3.8.""" 53 | self.provider = NetworkGTProvider() 54 | QgsApplication.processingRegistry().addProvider(self.provider) 55 | 56 | def initGui(self): 57 | self.initProcessing() 58 | 59 | def unload(self): 60 | QgsApplication.processingRegistry().removeProvider(self.provider) 61 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/Sets.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import os,arcpy,math 23 | 24 | def main (infc,bins): 25 | 26 | bins = eval('['+ bins + ']') 27 | 28 | for bin in bins: 29 | if bin[0] > 180 or bin[1] > 180: 30 | arcpy.AddError('Bins must range between 0 and 180') 31 | 32 | curfields = [f.name.lower() for f in arcpy.ListFields(infc)] 33 | 34 | 35 | if 'sets' not in curfields: 36 | arcpy.AddField_management(infc, 'Sets', "LONG") 37 | 38 | 39 | if 'orient' not in curfields: 40 | arcpy.AddField_management(infc, "Orient", "DOUBLE") 41 | 42 | 43 | with arcpy.da.UpdateCursor(infc, ['Shape@','Sets','Orient']) as cursor: 44 | 45 | for row in cursor: 46 | 47 | sx,sy = row[0].firstPoint.X,row[0].firstPoint.Y 48 | ex,ey = row[0].lastPoint.X,row[0].lastPoint.Y 49 | 50 | dx = ex - sx 51 | dy = ey - sy 52 | 53 | angle = math.degrees(math.atan2(dy,dx)) 54 | Bearing = (90.0 - angle) % 360 55 | 56 | if Bearing >= 180: 57 | Bearing -= 180 58 | 59 | Value = -1 60 | 61 | for enum, bin in enumerate(bins): 62 | if bin[0] > bin[1]: 63 | if Bearing > bin[0] or Bearing <= bin[1]: 64 | Value = enum 65 | break 66 | 67 | elif Bearing > bin[0] and Bearing <= bin[1]: 68 | Value = enum 69 | break 70 | 71 | row[1] = Value 72 | row[2] = round(Bearing,2) 73 | 74 | cursor.updateRow(row) 75 | 76 | 77 | if __name__ == "__main__": 78 | ###Inputs### 79 | 80 | infc = arcpy.GetParameterAsText(0) 81 | bins = arcpy.GetParameterAsText(1) 82 | 83 | main(infc,bins) 84 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/graph.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from scipy import sparse as sps 3 | 4 | from porepy.utils.mcolon import mcolon 5 | from porepy.utils import sparse_mat 6 | 7 | 8 | class Graph: 9 | """ 10 | A graph class. 11 | 12 | The graph class stores the nodes and edges of the graph in a sparse 13 | array (equivalently to face_nodes in the Grid class). 14 | 15 | Attributes: 16 | node_connections (sps.csc-matrix): Should be given at construction. 17 | node_node connections. Matrix size: num_nodes x num_nodes. 18 | node_connections[i,j] should be true if there is an edge 19 | connecting node i and j. 20 | regions (int) the number of regions. A region is a set of nodes 21 | that can be reached by traversing the graph. Two nodes are 22 | int different regions if they can not be reached by traversing 23 | the graph. 24 | color (int) the color of each region. Initialized as (NaN). By 25 | calling color_nodes() all nodes in a region are given the 26 | same colors and nodes in different regions are given different 27 | colors. 28 | """ 29 | 30 | def __init__(self, node_connections): 31 | if node_connections.getformat() != "csr": 32 | self.node_connections = node_connections.tocsr() 33 | else: 34 | self.node_connections = node_connections 35 | self.regions = 0 36 | self.color = np.array([np.NaN] * node_connections.shape[1]) 37 | 38 | def color_nodes(self): 39 | """ 40 | Color the nodes in each region 41 | """ 42 | color = 0 43 | while self.regions <= self.node_connections.shape[1]: 44 | start = np.ravel(np.argwhere(np.isnan(self.color))) 45 | if start.size != 0: 46 | self.bfs(start[0], color) 47 | color += 1 48 | self.regions += 1 49 | else: 50 | return 51 | raise RuntimeWarning( 52 | "number of regions can not be greater than " "number of nodes" 53 | ) 54 | 55 | def bfs(self, start, color): 56 | """ 57 | Breadth first search 58 | """ 59 | visited, queue = [], [start] 60 | while queue: 61 | node = queue.pop(0) 62 | if node not in visited: 63 | visited.append(node) 64 | neighbours = sparse_mat.slice_indices(self.node_connections, node) 65 | queue.extend(neighbours) 66 | self.color[visited] = color 67 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/nonlinear/nonlinear_solvers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Fri Sep 6 11:21:54 2019 5 | 6 | @author: eke001 7 | """ 8 | import numpy as np 9 | import logging 10 | 11 | 12 | # Module-wide logger 13 | logger = logging.getLogger(__name__) 14 | 15 | 16 | class NewtonSolver: 17 | def __init__(self, params=None): 18 | if params is None: 19 | params = {} 20 | 21 | default_options = { 22 | "max_iterations": 10, 23 | "nl_convergence_tol": 1e-10, 24 | "nl_divergence_tol": 1e5, 25 | } 26 | default_options.update(params) 27 | self.params = default_options 28 | 29 | def solve(self, setup): 30 | setup.before_newton_loop() 31 | 32 | iteration_counter = 0 33 | 34 | is_converged = False 35 | 36 | prev_sol = setup.get_state_vector() 37 | init_sol = prev_sol 38 | errors = [] 39 | error_norm = 1 40 | 41 | while iteration_counter <= self.params["max_iterations"] and not is_converged: 42 | logger.info( 43 | "Newton iteration number {} of {}".format( 44 | iteration_counter, self.params["max_iterations"] 45 | ) 46 | ) 47 | 48 | # Re-discretize the nonlinear term 49 | setup.before_newton_iteration() 50 | 51 | lin_tol = np.minimum(1e-4, error_norm) 52 | sol = self.iteration(setup, lin_tol) 53 | 54 | setup.after_newton_iteration(sol) 55 | 56 | error_norm, is_converged, is_diverged = setup.check_convergence( 57 | sol, prev_sol, init_sol, self.params 58 | ) 59 | prev_sol = sol 60 | errors.append(error_norm) 61 | 62 | if is_diverged: 63 | setup.after_newton_failure(sol, errors, iteration_counter) 64 | elif is_converged: 65 | setup.after_newton_convergence(sol, errors, iteration_counter) 66 | 67 | iteration_counter += 1 68 | 69 | if not is_converged: 70 | setup.after_newton_failure(sol, errors, iteration_counter) 71 | 72 | return error_norm, is_converged, iteration_counter 73 | 74 | def iteration(self, setup, lin_tol): 75 | """ A single Newton iteration. 76 | 77 | Right now, this is a single line, however, we keep it as a separate function 78 | to prepare for possible future introduction of more advanced schemes. 79 | """ 80 | 81 | # Assemble and solve 82 | sol = setup.assemble_and_solve_linear_system(lin_tol) 83 | 84 | return sol 85 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/LineFrequencyPlot.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import os,arcpy, subprocess,sys,tempfile 23 | 24 | def main (infc,field,fields): 25 | 26 | fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),'LineFrequencyPlotData.py') 27 | outDir = os.path.join(tempfile.gettempdir(),'NetworkGT') 28 | if not os.path.exists(outDir): 29 | os.mkdir(outDir) 30 | temp_csv = os.path.join(outDir,'temp_csv.csv') 31 | python_executer = r"C:\Python27\ArcGISx6410.6\python.exe" 32 | 33 | if not fields: 34 | fields = [] 35 | else: 36 | fields = [fields] 37 | 38 | curfields = [f.name for f in arcpy.ListFields(infc)] 39 | 40 | if 'Distance' not in curfields or 'Sample_No_' not in curfields: 41 | arcpy.AddError("Run Line Sampling tool prior to plotting") 42 | sys.exit() 43 | 44 | fields.extend(['Distance','Sample_No_']) 45 | 46 | fields.append(field) 47 | 48 | 49 | with open(temp_csv,'w') as f: 50 | with arcpy.da.SearchCursor(infc,fields) as cursor: 51 | for row in cursor: 52 | 53 | if len(fields) == 3: 54 | f.write('%s:%s:%s:%s\n'%(row[1],'Total',row[0],row[2])) 55 | else: 56 | f.write('%s:%s:%s:%s\n'%(row[2],row[0],row[1],row[3])) 57 | 58 | del cursor,row 59 | 60 | expression = [python_executer,fname,temp_csv] 61 | #expression = '%s %s %s' %(python_executer,fname,temp_csv) 62 | DETACHED_PROCESS = 0x00000008 63 | P=subprocess.Popen(expression, shell=False, stdin=None, stdout=None, stderr=None, close_fds=True,creationflags=DETACHED_PROCESS) 64 | #os.system(expression) 65 | if __name__ == "__main__": 66 | ###Inputs### 67 | 68 | infc = arcpy.GetParameterAsText(0) 69 | field = arcpy.GetParameterAsText(1) 70 | fields = arcpy.GetParameterAsText(2) 71 | 72 | main(infc,field,fields) 73 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | 134 | # pytype static type analyzer 135 | .pytype/ 136 | 137 | # Cython debug symbols 138 | cython_debug/ 139 | -------------------------------------------------------------------------------- /ArcGIS/Install/Pathway2Anaconda.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | import os,sys,subprocess,pip 22 | from shutil import copyfile 23 | from distutils.dir_util import copy_tree 24 | 25 | modules = ['python-ternary==1.0.4'] 26 | 27 | print 'Warning! Python 2.7 has been depreciated and is no longer supported. It is highly recommended to use the open source QGIS NetworkGT version.' 28 | 29 | def main(python_exe): 30 | 31 | files = ['Histogram.py','WeightedRoseDiagramPlots.py','LineFrequencyPlot.py','DistributionAnalysis.py','PlotTopology.py','TopologyParameters.py'] 32 | try: 33 | for module in modules: 34 | try: 35 | subprocess.check_call([python_exe,'-m', 'pip', 'install','--upgrade', module]) 36 | except Exception,e: 37 | print e 38 | continue 39 | 40 | dirname = os.path.split(os.path.dirname(os.path.realpath('__file__'))) 41 | 42 | for fname in files: 43 | 44 | fname_in = os.path.join(dirname[0],'Scripts',fname) 45 | fname_out = os.path.join(dirname[0],'Scripts','temp_%s'%(fname)) 46 | 47 | with open(fname_in, 'r') as input_file, open(fname_out, 'w') as output_file: 48 | for line in input_file: 49 | if 'python_executer =' in line: 50 | spaces = line.partition("p")[0] 51 | new_line = spaces + 'python_executer = r"%s"\n'%(python_exe) 52 | output_file.write(new_line) 53 | else: 54 | output_file.write(line) 55 | 56 | copyfile(fname_out,fname_in) 57 | os.remove(fname_out) 58 | 59 | print 'Finished' 60 | except Exception,e: 61 | print e 62 | 63 | if __name__ == "__main__": 64 | 65 | python_exe = r'D:\Anaconda\python.exe' #Replace with pathway to python.exe found in your anaconda installation 66 | main(python_exe) 67 | 68 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/remove_grids.py: -------------------------------------------------------------------------------- 1 | from porepy.grids import grid_bucket 2 | import copy 3 | import scipy.sparse as sps 4 | import numpy as np 5 | 6 | 7 | def duplicate_without_dimension(gb, dim): 8 | """ 9 | Remove all the nodes of dimension dim and add new edges between their 10 | neighbors by calls to remove_node. 11 | 12 | """ 13 | gb1 = gb.copy() 14 | for g in gb1.grids_of_dimension(dim): 15 | remove_node(gb1, g) 16 | return gb1 17 | 18 | 19 | # ------------------------------------------------------------------------------# 20 | 21 | 22 | def remove_node(gb, node): 23 | """ 24 | Remove the node (and the edges it partakes in) and add new direct 25 | connections (gb edges) between each of the neighbor pairs. A 0d node 26 | with n_neighbors gives rise to 1 + 2 + ... + n_neighbors-1 new edges. 27 | 28 | """ 29 | neighbors = gb.node_neighbors(node) 30 | n_neighbors = len(neighbors) 31 | for i in range(n_neighbors - 1): 32 | n1 = neighbors[i] 33 | for j in range(i + 1, n_neighbors): 34 | n2 = neighbors[j] 35 | face_faces = find_shared_face(n1, n2, node, gb) 36 | 37 | gb.add_edge([n1, n2], face_faces) 38 | 39 | # Remove the node and update the ordering of the remaining nodes 40 | node_number = gb.node_prop(node, "node_number") 41 | gb.remove_node(node) 42 | gb.update_node_ordering(node_number) 43 | 44 | 45 | # ------------------------------------------------------------------------------# 46 | 47 | 48 | def find_shared_face(n1, n2, node, gb): 49 | """ 50 | Given two 1d grids meeting at a 0d node (to be removed), find which two 51 | faces meet at the intersection (one from each grid). Returns the sparse 52 | matrix face_faces, the 1d-1d equivalent of the face_cells matrix. 53 | """ 54 | # Sort nodes according to node_number 55 | n1, n2 = gb.sorted_nodes_of_edge([n1, n2]) 56 | 57 | # Identify the faces connecting the neighbors to the grid to be removed 58 | fc1 = gb.edge_props([n1, node]) 59 | fc2 = gb.edge_props([n2, node]) 60 | _, face_number_1, _ = sps.find(fc1["face_cells"]) 61 | _, face_number_2, _ = sps.find(fc2["face_cells"]) 62 | 63 | # The lower dim. node (corresponding to the first dimension, cells, 64 | # in face_cells) is first in gb.sorted_nodes_of_edge. To be consistent 65 | # with this, the grid corresponding to the first dimension of face_faces 66 | # should be the first grid of the node sorting. Connect the two remaining 67 | # grids through the face_faces matrix, to be placed as a face_cells 68 | # substitute. 69 | face_faces = sps.csc_matrix( 70 | (np.array([True]), (face_number_1, face_number_2)), (n1.num_faces, n2.num_faces) 71 | ) 72 | 73 | return face_faces 74 | 75 | 76 | # ------------------------------------------------------------------------------# 77 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/WeightedRoseDiagramPlots.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import os,arcpy,math,csv 23 | import subprocess,tempfile 24 | def main (infc,bins,field,grp): 25 | 26 | fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),'WeightedRosePlotData.py') 27 | outDir = os.path.join(tempfile.gettempdir(),'NetworkGT') 28 | if not os.path.exists(outDir): 29 | os.mkdir(outDir) 30 | temp_csv = os.path.join(outDir,'temp__wr.csv') 31 | python_executer = r"C:\Python27\ArcGISx6410.6\python.exe" 32 | 33 | data = {} 34 | 35 | if grp: 36 | if field: 37 | fields = ['SHAPE@',field,grp] 38 | else: 39 | fields = ['SHAPE@','OID@',grp] 40 | 41 | else: 42 | if field: 43 | fields = ['SHAPE@',field] 44 | else: 45 | fields = ['SHAPE@'] 46 | with arcpy.da.SearchCursor(infc,fields) as cursor: 47 | for row in cursor: 48 | 49 | if field: 50 | d = row[1] 51 | else: 52 | d = 1 53 | 54 | sx,sy = row[0].firstPoint.X,row[0].firstPoint.Y 55 | ex,ey = row[0].lastPoint.X,row[0].lastPoint.Y 56 | 57 | dx = ex - sx 58 | 59 | dy = ey - sy 60 | 61 | angle = math.degrees(math.atan2(dy,dx)) 62 | 63 | Bearing = (90.0 - angle) % 360 64 | 65 | if grp: 66 | ID = row[2] 67 | else: 68 | ID = 1 69 | 70 | if ID in data: 71 | data[ID].append((Bearing,d)) 72 | else: 73 | data[ID] = [(Bearing,d)] 74 | 75 | 76 | with open(temp_csv,'w') as f: 77 | for k,v in data.iteritems(): 78 | f.write('%s:%s\n'%(k,v)) 79 | del data 80 | 81 | expression = [python_executer,fname,temp_csv,bins] 82 | DETACHED_PROCESS = 0x00000008 83 | P=subprocess.Popen(expression, shell=False, stdin=None, stdout=None, stderr=None, close_fds=True,creationflags=DETACHED_PROCESS) 84 | 85 | 86 | if __name__ == "__main__": 87 | ###Inputs### 88 | 89 | infc = arcpy.GetParameterAsText(0) 90 | bins = arcpy.GetParameterAsText(1) 91 | field = arcpy.GetParameterAsText(2) 92 | grp = arcpy.GetParameterAsText(3) 93 | 94 | main(infc,bins,field,grp) 95 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/discretization.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ Module with a do-nothing discretization class. 4 | 5 | 6 | """ 7 | 8 | import numpy as np 9 | import scipy.sparse as sps 10 | 11 | 12 | class VoidDiscretization: 13 | """ Do-nothing discretization object. Used if a discretizaiton object 14 | is needed for technical reasons, but not really necessary. 15 | 16 | Attributes: 17 | keyword (str): Keyword used to identify parameters and discretization 18 | matrices for this object. 19 | ndof_cell (int): Number of degrees of freedom per cell in a grid. 20 | ndof_face (int): Number of degrees of freedom per face in a grid. 21 | ndof_node (int): Number of degrees of freedom per node in a grid. 22 | 23 | """ 24 | 25 | def __init__(self, keyword, ndof_cell=0, ndof_face=0, ndof_node=0): 26 | """ Set the discretization, with the keyword used for storing various 27 | information associated with the discretization. 28 | 29 | Paramemeters: 30 | keyword (str): Identifier of all information used for this 31 | discretization. 32 | ndof_cell (int, optional): Number of degrees of freedom per cell 33 | in a grid. Defaults to 0. 34 | ndof_face (int, optional): Number of degrees of freedom per face 35 | in a grid. Defaults to 0. 36 | ndof_node (int, optional): Number of degrees of freedom per node 37 | in a grid. Defaults to 0. 38 | 39 | """ 40 | self.keyword = keyword 41 | self.ndof_cell = ndof_cell 42 | self.ndof_face = ndof_face 43 | self.ndof_node = ndof_node 44 | 45 | def _key(self): 46 | """ Get the keyword of this object, on a format friendly to access relevant 47 | fields in the data dictionary 48 | 49 | Returns: 50 | String, on the form self.keyword + '_'. 51 | 52 | """ 53 | return self.keyword + "_" 54 | 55 | def ndof(self, g): 56 | """ Abstract method. Return the number of degrees of freedom associated to the 57 | method. 58 | 59 | Parameters 60 | g (grid): Computational grid 61 | 62 | Returns: 63 | int: the number of degrees of freedom. 64 | 65 | """ 66 | return ( 67 | g.num_cells * self.ndof_cell 68 | + g.num_faces * self.ndof_face 69 | + g.num_nodes * self.ndof_node 70 | ) 71 | 72 | def discretize(self, g, data): 73 | """ Construct discretization matrices. Operation is void for this discretization. 74 | 75 | Parameters: 76 | g (pp.Grid): Grid to be discretized. 77 | data (dictionary): With discretization parameters. 78 | 79 | """ 80 | pass 81 | 82 | def assemble_matrix_rhs(self, g, data): 83 | """ Assemble discretization matrix and rhs vector, both empty. 84 | 85 | Parameters: 86 | g (pp.Grid): Grid to be discretized. 87 | data (dictionary): With discretization parameters. 88 | 89 | Returns: 90 | sps.csc_matrix: Of specified dimensions relative to the grid. Empty. 91 | np.array: Of specified dimensions relative to the grid. All zeros. 92 | 93 | """ 94 | ndof = self.ndof(g) 95 | 96 | return sps.csc_matrix((ndof, ndof)), np.zeros(ndof) 97 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/tags.py: -------------------------------------------------------------------------------- 1 | """ 2 | Methods for tag handling. The following primary applications are intended: 3 | --Grid tags, stored in the grids and data fields of the grid bucket. 4 | Geometry tags are stored in the grids, typical fields 5 | are cell, face or node tags, lists of length g.num_cell etc. Other 6 | information is storad in the data fields. The entries 7 | of the lists should be boolean or integers. Examples: 8 | g.tags['fracture_faces'] = [0, 1, 1, 0, 1, 1] 9 | g.tags['fracture_face_ids'] = [0, 1, 2, 0, 1, 2] 10 | 11 | for a grid with two immersed fractures (neighbour to faces (1 and 4) and 12 | (2 and 5), respectively). If the wells are located in cells 1 and 3, this 13 | may be tagged in the data as e.g. 14 | data['well_cells'] = [0 1 0 2] 15 | with 1 indicating injection and 2 production. 16 | 17 | --Fracture network tags, stored in the fracture network field .tags. One 18 | list entry for each fracture: 19 | network.tags['fracture_id'] = [1,2] 20 | -- 21 | """ 22 | import numpy as np 23 | 24 | 25 | def append_tags(tags, keys, appendices): 26 | """ 27 | Append tags of certain keys. 28 | tags: dictionary with existing entries corresponding to 29 | keys: list of keys 30 | appendices: list of values to be appended, typicall numpy arrays 31 | """ 32 | for i, key in enumerate(keys): 33 | tags[key] = np.append(tags[key], appendices[i]) 34 | 35 | 36 | def standard_face_tags(): 37 | """ 38 | Returns the three standard face tag keys. 39 | """ 40 | return ["fracture_faces", "tip_faces", "domain_boundary_faces"] 41 | 42 | 43 | def standard_node_tags(): 44 | """ 45 | Returns the standard node tag key. 46 | """ 47 | return ["fracture_nodes", "tip_nodes", "domain_boundary_nodes"] 48 | 49 | 50 | def all_tags(parent, ft): 51 | """ 52 | Return a logical array indicate which of the parent objects are 53 | tagged with any of the standard object tags. 54 | """ 55 | return np.logical_or(np.logical_or(parent[ft[0]], parent[ft[1]]), parent[ft[2]]) 56 | 57 | 58 | def all_face_tags(parent): 59 | """ 60 | Return a logical array indicate which of the parent (grid.tags) faces are 61 | tagged with any of the standard face tags. 62 | """ 63 | return all_tags(parent, standard_face_tags()) 64 | 65 | 66 | def all_node_tags(parent): 67 | """ 68 | Return a logical array indicate which of the parent (grid.nodes) nodes are 69 | tagged with any of the standard node tags. 70 | """ 71 | return all_tags(parent, standard_node_tags()) 72 | 73 | 74 | def extract(all_tags, indices, keys=None): 75 | """ 76 | Extracts only the values of indices (e.g. a face subset) for the given 77 | keys. Any unspecified keys are left untouched (e.g. all node tags). If 78 | keys=None, the extraction is performed on all fields. 79 | """ 80 | if keys is None: 81 | keys = all_tags.keys() 82 | new_tags = all_tags.copy() 83 | for k in keys: 84 | new_tags[k] = all_tags[k][indices] 85 | return new_tags 86 | 87 | 88 | def add_tags(parent, new_tags): 89 | """ 90 | Add new tags (as a premade dictionary) to the tags of the parent object 91 | (usually a grid). Values corresponding to keys existing in both 92 | dictionaries (parent.tags and new_tags) will be decided by those in 93 | new_tags. 94 | """ 95 | old_tags = getattr(parent, "tags", {}).copy() 96 | nt = dict(old_tags) 97 | nt.update(new_tags) 98 | parent.tags = nt 99 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/error.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | # ------------------------------------------------------------------------------# 4 | 5 | 6 | def interpolate(g, fun): 7 | """ 8 | Interpolate a scalar or vector function on the cell centers of the grid. 9 | 10 | Parameters 11 | ---------- 12 | g : grid 13 | Grid, or a subclass, with geometry fields computed. 14 | fun : function 15 | Scalar or vector function. 16 | 17 | Return 18 | ------ 19 | out: np.ndarray (dim of fun, g.num_cells) 20 | Function interpolated in the cell centers. 21 | 22 | Examples 23 | -------- 24 | def fun_p(pt): return np.sin(2*np.pi*pt[0])*np.sin(2*np.pi*pt[1]) 25 | def fun_u(pt): return [\ 26 | -2*np.pi*np.cos(2*np.pi*pt[0])*np.sin(2*np.pi*pt[1]), 27 | -2*np.pi*np.sin(2*np.pi*pt[0])*np.cos(2*np.pi*pt[1])] 28 | p_ex = interpolate(g, fun_p) 29 | u_ex = interpolate(g, fun_u) 30 | 31 | """ 32 | 33 | return np.array([fun(pt) for pt in g.cell_centers.T]).T 34 | 35 | 36 | # ------------------------------------------------------------------------------# 37 | 38 | 39 | def norm_L2(g, val): 40 | """ 41 | Compute the L2 norm of a scalar or vector field. 42 | 43 | Parameters 44 | ---------- 45 | g : grid 46 | Grid, or a subclass, with geometry fields computed. 47 | val : np.ndarray (dim of val, g.num_cells) 48 | Scalar or vector field. 49 | 50 | Return 51 | ------ 52 | out: double 53 | The L2 norm of the input field. 54 | 55 | Examples 56 | -------- 57 | def fun_p(pt): return np.sin(2*np.pi*pt[0])*np.sin(2*np.pi*pt[1]) 58 | p_ex = interpolate(g, fun_p) 59 | norm_ex = norm_L2(g, p_ex) 60 | 61 | """ 62 | 63 | val = np.asarray(val) 64 | norm_sq = lambda v: np.sum(np.multiply(np.square(v), g.cell_volumes)) 65 | if val.ndim == 1: 66 | return np.sqrt(norm_sq(val)) 67 | return np.sqrt(np.sum([norm_sq(v) for v in val])) 68 | 69 | 70 | # ------------------------------------------------------------------------------# 71 | 72 | 73 | def error_L2(g, val, val_ex, relative=True): 74 | """ 75 | Compute the L2 error of a scalar or vector field with respect to a reference 76 | field. It is possible to compute the relative error (default) or the 77 | absolute error. 78 | 79 | Parameters 80 | ---------- 81 | g : grid 82 | Grid, or a subclass, with geometry fields computed. 83 | val : np.ndarray (dim of val, g.num_cells) 84 | Scalar or vector field. 85 | val_ex : np.ndarray (dim of val, g.num_cells) 86 | Reference scalar or vector field, i.e. the exact solution 87 | relative: bool (True default) 88 | Compute the relative error (if True) or the absolute error (if False). 89 | 90 | Return 91 | ------ 92 | out: double 93 | The L2 error of the input fields. 94 | 95 | Examples 96 | -------- 97 | p = ... 98 | def fun_p(pt): return np.sin(2*np.pi*pt[0])*np.sin(2*np.pi*pt[1]) 99 | p_ex = interpolate(g, fun_p) 100 | err_p = err_L2(g, p, p_ex) 101 | 102 | """ 103 | 104 | val, val_ex = np.asarray(val), np.asarray(val_ex) 105 | err = norm_L2(g, np.subtract(val, val_ex)) 106 | den = norm_L2(g, val_ex) if relative else 1 107 | assert den != 0 108 | return err / den 109 | 110 | 111 | # ------------------------------------------------------------------------------# 112 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/params/fluid.py: -------------------------------------------------------------------------------- 1 | """ Hard coded typical parameters that may be of use in simulations. 2 | 3 | Contains standard values (e.g. found in Wikipedia) for density, thermal properties etc. 4 | 5 | Note that thermal expansion coefficients are linear (m/mK) for rocks, but 6 | volumetric (m^3/m^3K) for fluids. 7 | """ 8 | import numpy as np 9 | import porepy as pp 10 | 11 | 12 | class UnitFluid: 13 | def __init__(self, theta_ref=None): 14 | if theta_ref is None: 15 | self.theta_ref = 20 * (pp.CELSIUS) 16 | else: 17 | self.theta_ref = theta_ref 18 | 19 | self.COMPRESSIBILITY = 1 / pp.PASCAL 20 | self.BULK = 1 / self.COMPRESSIBILITY 21 | 22 | def thermal_expansion(self, delta_theta): 23 | """ Units: m^3 / m^3 K, i.e. volumetric """ 24 | return 1 25 | 26 | def density(self, theta=None): # theta in CELSIUS 27 | """ Units: kg / m^3 """ 28 | return 1 29 | 30 | def thermal_conductivity(self, theta=None): # theta in CELSIUS 31 | """ Units: W / m K """ 32 | return 1 33 | 34 | def specific_heat_capacity(self, theta=None): # theta in CELSIUS 35 | """ Units: J / kg K """ 36 | return 1 37 | 38 | def dynamic_viscosity(self, theta=None): # theta in CELSIUS 39 | """Units: Pa s""" 40 | return 1 41 | 42 | def hydrostatic_pressure(self, depth, theta=None): 43 | rho = self.density(theta) 44 | return rho * depth * pp.GRAVITY_ACCELERATION + pp.ATMOSPHERIC_PRESSURE 45 | 46 | 47 | class Water: 48 | def __init__(self, theta_ref=None): 49 | if theta_ref is None: 50 | self.theta_ref = 20 * (pp.CELSIUS) 51 | else: 52 | self.theta_ref = theta_ref 53 | 54 | self.COMPRESSIBILITY = 4e-10 / pp.PASCAL # Moderate dependency on theta 55 | self.BULK = 1 / self.COMPRESSIBILITY 56 | 57 | def thermal_expansion(self, delta_theta): 58 | """ Units: m^3 / m^3 K, i.e. volumetric """ 59 | return ( 60 | 0.0002115 61 | + 1.32 * 1e-6 * delta_theta 62 | + 1.09 * 1e-8 * np.power(delta_theta, 2) 63 | ) 64 | 65 | def density(self, theta=None): # theta in CELSIUS 66 | """ Units: kg / m^3 """ 67 | if theta is None: 68 | theta = self.theta_ref 69 | theta_0 = 10 * (pp.CELSIUS) 70 | rho_0 = 999.8349 * (pp.KILOGRAM / pp.METER ** 3) 71 | return rho_0 / (1.0 + self.thermal_expansion(theta - theta_0)) 72 | 73 | def thermal_conductivity(self, theta=None): # theta in CELSIUS 74 | """ Units: W / m K """ 75 | if theta is None: 76 | theta = self.theta_ref 77 | return ( 78 | 0.56 79 | + 0.002 * theta 80 | - 1.01 * 1e-5 * np.power(theta, 2) 81 | + 6.71 * 1e-9 * np.power(theta, 3) 82 | ) 83 | 84 | def specific_heat_capacity(self, theta=None): # theta in CELSIUS 85 | """ Units: J / kg K """ 86 | if theta is None: 87 | theta = self.theta_ref 88 | return 4245 - 1.841 * theta 89 | 90 | def dynamic_viscosity(self, theta=None): # theta in CELSIUS 91 | """Units: Pa s""" 92 | if theta is None: 93 | theta = self.theta_ref 94 | theta = pp.CELSIUS_to_KELVIN(theta) 95 | mu_0 = 2.414 * 1e-5 * (pp.PASCAL * pp.SECOND) 96 | return mu_0 * np.power(10, 247.8 / (theta - 140)) 97 | 98 | def hydrostatic_pressure(self, depth, theta=None): 99 | rho = self.density(theta) 100 | return rho * depth * pp.GRAVITY_ACCELERATION + pp.ATMOSPHERIC_PRESSURE 101 | -------------------------------------------------------------------------------- /ArcGIS/Scripts/SimpleGrid.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | 22 | import arcpy,sys 23 | 24 | def main (infc,Width,outfc,radius): 25 | 26 | if 'shp' in outfc: 27 | arcpy.AddError('Output parameter must be saved in a geodatabase') 28 | sys.exit() 29 | 30 | 31 | extent = arcpy.Describe(infc).extent 32 | orig = "%s %s"%(extent.XMin,extent.YMin) 33 | add = extent.YMin*0.00001 34 | 35 | if extent.YMin < 0: 36 | yaxis = "%s %s"%(extent.XMin,extent.YMin-add) 37 | else: 38 | yaxis = "%s %s "%(extent.XMin,extent.YMin+add) 39 | 40 | arcpy.CreateFishnet_management("in_memory\\fishnet",orig,yaxis, Width, Width, "", "", "" ,"", infc, "POLYGON") 41 | 42 | arcpy.MakeFeatureLayer_management("in_memory\\fishnet", "in_memory\\layer") 43 | arcpy.SelectLayerByLocation_management("in_memory\\layer", "COMPLETELY_WITHIN", infc) 44 | arcpy.CopyFeatures_management("in_memory\\layer", outfc) 45 | 46 | if radius: 47 | 48 | fields = ['Area','Circumfere'] 49 | arcpy.AddField_management(outfc, 'Area',"DOUBLE") 50 | arcpy.AddField_management(outfc, 'Circumfere',"DOUBLE","","","","Circumference") 51 | 52 | arcpy.AddField_management(outfc, 'S_Radius',"TEXT") 53 | arcpy.FeatureToPoint_management(outfc, "in_memory\\fishnet_points") 54 | arcpy.Buffer_analysis("in_memory\\fishnet_points","in_memory\\buffer",radius, "FULL", "ROUND") 55 | 56 | radius_v = radius.split(' ') 57 | 58 | data = {} 59 | 60 | cursorm = [m_data for m_data in arcpy.da.SearchCursor(infc,['SHAPE@'])] 61 | 62 | count = arcpy.GetCount_management("in_memory\\buffer").getOutput(0) 63 | arcpy.SetProgressor("step", "Reading Buffer Parameters",0,eval(count),1) 64 | 65 | R1 = 1 66 | 67 | with arcpy.da.SearchCursor("in_memory\\buffer",['OID@','SHAPE@']) as cursor: 68 | for row in cursor: 69 | for m in cursorm: 70 | inter = row[1].intersect(m[0],4) 71 | if inter.length != 0.0: 72 | data[row[0]]=(inter.getLength('PLANAR',radius_v[1]),inter.getArea('PLANAR',radius_v[1])) 73 | break 74 | arcpy.SetProgressorPosition() 75 | 76 | with arcpy.da.SearchCursor(outfc,['OID@']) as cursor: 77 | for row in cursor: 78 | if row[0] < R1: 79 | R1 = row[0] 80 | 81 | fields.extend(['S_Radius','OID@']) 82 | 83 | with arcpy.da.UpdateCursor(outfc,fields) as cursor: 84 | for row in cursor: 85 | values = data[row[-1]+(1-R1)] 86 | row[0] = values[1] 87 | row[1] = values[0] 88 | row[2] = radius 89 | cursor.updateRow(row) 90 | 91 | 92 | if __name__ == "__main__": 93 | ###Inputs### 94 | 95 | infc = arcpy.GetParameterAsText(0) 96 | D = arcpy.GetParameterAsText(1) 97 | radius = arcpy.GetParameterAsText(2) 98 | outfc = arcpy.GetParameterAsText(3) 99 | 100 | main(infc,D,outfc,radius) 101 | 102 | -------------------------------------------------------------------------------- /ArcGIS/Install/Install.py: -------------------------------------------------------------------------------- 1 | #================================== 2 | #Author Bjorn Burr Nyberg 3 | #University of Bergen 4 | #Contact bjorn.nyberg@uib.no 5 | #Copyright 2016 6 | #================================== 7 | 8 | '''This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .''' 20 | 21 | import os,sys,subprocess,pip 22 | from shutil import copyfile 23 | from distutils.dir_util import copy_tree 24 | 25 | dirname = os.path.split(os.path.dirname(sys.executable)) 26 | folder = dirname[1].replace('x64','') 27 | 28 | python_exe = os.path.join(dirname[0],folder,'python.exe') 29 | 30 | modules = ['pip==20.3.4','python-ternary==1.0.4','scipy==1.0.1','pandas==0.23.3','networkx==1.8','xlsxwriter==1.0.4'] 31 | 32 | print 'Warning! Python 2.7 has been depreciated and is no longer supported. It is highly recommended to use the open source QGIS NetworkGT version.' 33 | 34 | try: 35 | is_admin = os.getuid() == 0 36 | except AttributeError: 37 | import ctypes 38 | is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 39 | 40 | for module in modules: 41 | try: 42 | if is_admin: 43 | status = subprocess.check_call([python_exe,'-m', 'pip', 'install', module, '--upgrade']) 44 | else: 45 | status = subprocess.check_call([python_exe,'-m', 'pip', 'install', module, '--upgrade','--user']) 46 | except Exception: 47 | print 'Failed to install %s - consider installing manually'%(module) 48 | continue 49 | 50 | def main(python_exe): 51 | try: 52 | is_admin = os.getuid() == 0 53 | except AttributeError: 54 | import ctypes 55 | is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 56 | 57 | files = ['Histogram.py','WeightedRoseDiagramPlots.py','LineFrequencyPlot.py','DistributionAnalysis.py','PlotTopology.py','TopologyParameters.py'] 58 | try: 59 | python_exe = sys.executable.replace('w','') 60 | for module in modules: 61 | try: 62 | if is_admin: 63 | status = subprocess.check_call([python_exe,'-m', 'pip', 'install', module, '--upgrade']) 64 | else: 65 | status = subprocess.check_call([python_exe,'-m', 'pip', 'install', module, '--upgrade','--user']) 66 | except Exception: 67 | print 'Failed to install %s - consider installing manually'%(module) 68 | continue 69 | 70 | dirname = os.path.split(os.path.dirname(os.path.realpath('__file__'))) 71 | 72 | for fname in files: 73 | 74 | fname_in = os.path.join(dirname[0],'Scripts',fname) 75 | fname_out = os.path.join(dirname[0],'Scripts','temp_%s'%(fname)) 76 | 77 | with open(fname_in, 'r') as input_file, open(fname_out, 'w') as output_file: 78 | for line in input_file: 79 | if 'python_executer =' in line: 80 | spaces = line.partition("p")[0] 81 | new_line = spaces + 'python_executer = r"%s"\n'%(python_exe) 82 | output_file.write(new_line) 83 | else: 84 | output_file.write(line) 85 | 86 | copyfile(fname_out,fname_in) 87 | os.remove(fname_out) 88 | 89 | print 'Finished' 90 | except Exception,e: 91 | print e 92 | 93 | if __name__ == "__main__": 94 | main(sys.executable) 95 | -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.FDO_UUID.atx: -------------------------------------------------------------------------------- 1 | 1 {2B74A65D-E9EB-426D-8BEE-C4E1ED04C1B9}{6A9D1732-05C1-440E-8696-9BF09A73FD42}{76D54832-DA0F-40BA-8B09-6A79470045C0}{CCB4D124-EFCB-4E09-AFB7-9A1167933681}{E6C38C32-6D0C-42CD-8C68-ACFAF895B4FA}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.FDO_UUID.atx: -------------------------------------------------------------------------------- 1 | / {2E432E2C-978B-4597-9089-EC985ADC0BAE}{54B34233-E48A-4985-8C63-A8CC2A0DE1B0}{A573E7ED-3936-4C59-94D3-62113889AA52}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000004.CatItemsByType.atx: -------------------------------------------------------------------------------- 1 |  1{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{C673FE0F-7280-404F-8532-20755DD8FC06}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.CatRelsByOriginID.atx: -------------------------------------------------------------------------------- 1 |  /{E6C38C32-6D0C-42CD-8C68-ACFAF895B4FA}{E6C38C32-6D0C-42CD-8C68-ACFAF895B4FA}{E6C38C32-6D0C-42CD-8C68-ACFAF895B4FA}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.CatRelsByType.atx: -------------------------------------------------------------------------------- 1 |  /{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000005.CatItemTypesByUUID.atx: -------------------------------------------------------------------------------- 1 | "   ! 2 |  "{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{35B601F7-45CE-4AFF-ADB7-7702D3839B12}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{5ED667A3-9CA9-44A2-8029-D95BF23704B9}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{77292603-930F-475D-AE4F-B8970F42F394}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{787BEA35-4A86-494F-BB48-500B96145B58}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8C368B12-A12E-4C7E-9638-C9C64E69E98F}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{B606A7E1-FA5B-439C-849C-6E9C2481537B}{C29DA988-8C3E-45F7-8B5C-18E51EE7BEB4}{C673FE0F-7280-404F-8532-20755DD8FC06}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D5A40288-029E-4766-8C81-DE3F61129371}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{DB1B697A-3BB6-426A-98A2-6EE7A4C6AED3}{DC64B6E4-DC0F-43BD-B4F5-F22385DCF055}{DC9EF677-1AA3-45A7-8ACD-303A5202D0DC}{E6302665-416B-44FA-BE33-4E15916BA101}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F8413DCB-2248-4935-BFE9-315F397E5110}{FBDD7DD6-4A25-40B7-9A1A-ECC3D1172447}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000006.CatRelsByDestinationID.atx: -------------------------------------------------------------------------------- 1 | / {6A9D1732-05C1-440E-8696-9BF09A73FD42}{76D54832-DA0F-40BA-8B09-6A79470045C0}{CCB4D124-EFCB-4E09-AFB7-9A1167933681}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByUUID.atx: -------------------------------------------------------------------------------- 1 |   2 |   {0D10B3A7-2F64-45E6-B7AC-2FC27BF2133C}{17E08ADB-2B31-4DCD-8FDD-DF529E88F843}{55D2F4DC-CB17-4E32-A8C7-47591E8C71DE}{583A5BAA-3551-41AE-8AA8-1185719F3889}{5DD0C1AF-CB3D-4FEA-8C51-CB3BA8D77CDB}{5F9085E0-788F-4354-AE3C-34C83A7EA784}{725BADAB-3452-491B-A795-55F32D67229C}{79CC71C8-B7D9-4141-9014-B6373E236ABB}{8DB31AF1-DF7C-4632-AA10-3CC44B0C6914}{908A4670-1111-48C6-8269-134FDD3FE617}{A1633A59-46BA-4448-8706-D8ABE2B2B02E}{B32B8563-0B96-4D32-92C4-086423AE9962}{CC28387C-441F-4D7C-A802-41A160317FE0}{D022DE33-45BD-424C-88BF-5B1B6B957BD3}{D088B110-190B-4229-BDF7-89FDDD14D1EA}{DC739A70-9B71-41E8-868C-008CF46F16D7}{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}{E79B44E3-F833-4B12-90A1-364EC4DDC43E}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000005.CatItemTypesByParentTypeID.atx: -------------------------------------------------------------------------------- 1 | " 2 | !"    {00000000-0000-0000-0000-000000000000}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByDestItemTypeID.atx: -------------------------------------------------------------------------------- 1 |  2 |   {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000005.CatItemTypesByUUID.atx: -------------------------------------------------------------------------------- 1 | " !"   2 | {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{35B601F7-45CE-4AFF-ADB7-7702D3839B12}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{5ED667A3-9CA9-44A2-8029-D95BF23704B9}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{77292603-930F-475D-AE4F-B8970F42F394}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{787BEA35-4A86-494F-BB48-500B96145B58}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8C368B12-A12E-4C7E-9638-C9C64E69E98F}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{B606A7E1-FA5B-439C-849C-6E9C2481537B}{C29DA988-8C3E-45F7-8B5C-18E51EE7BEB4}{C673FE0F-7280-404F-8532-20755DD8FC06}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D5A40288-029E-4766-8C81-DE3F61129371}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{DB1B697A-3BB6-426A-98A2-6EE7A4C6AED3}{DC64B6E4-DC0F-43BD-B4F5-F22385DCF055}{DC9EF677-1AA3-45A7-8ACD-303A5202D0DC}{E6302665-416B-44FA-BE33-4E15916BA101}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F8413DCB-2248-4935-BFE9-315F397E5110}{FBDD7DD6-4A25-40B7-9A1A-ECC3D1172447}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByUUID.atx: -------------------------------------------------------------------------------- 1 |     2 | {0D10B3A7-2F64-45E6-B7AC-2FC27BF2133C}{17E08ADB-2B31-4DCD-8FDD-DF529E88F843}{55D2F4DC-CB17-4E32-A8C7-47591E8C71DE}{583A5BAA-3551-41AE-8AA8-1185719F3889}{5DD0C1AF-CB3D-4FEA-8C51-CB3BA8D77CDB}{5F9085E0-788F-4354-AE3C-34C83A7EA784}{725BADAB-3452-491B-A795-55F32D67229C}{79CC71C8-B7D9-4141-9014-B6373E236ABB}{8DB31AF1-DF7C-4632-AA10-3CC44B0C6914}{908A4670-1111-48C6-8269-134FDD3FE617}{A1633A59-46BA-4448-8706-D8ABE2B2B02E}{B32B8563-0B96-4D32-92C4-086423AE9962}{CC28387C-441F-4D7C-A802-41A160317FE0}{D022DE33-45BD-424C-88BF-5B1B6B957BD3}{D088B110-190B-4229-BDF7-89FDDD14D1EA}{DC739A70-9B71-41E8-868C-008CF46F16D7}{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}{E79B44E3-F833-4B12-90A1-364EC4DDC43E}& -------------------------------------------------------------------------------- /ArcGIS/NetworkGT_Example.gdb/a00000007.CatRelTypesByOriginItemTypeID.atx: -------------------------------------------------------------------------------- 1 |  2 |    {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/grids/fv_sub_grid.py: -------------------------------------------------------------------------------- 1 | """ 2 | This is a module for creating the sub-grids used in the multi-point finite 3 | volume discretizations (MPFA MPSA). Note that this is experimental and should 4 | not be excpected to work with standard porepy functions (e.g., g.compute_geometry()). 5 | 6 | Intended use is for now to set sub-face boundary conditions. 7 | """ 8 | 9 | import numpy as np 10 | import scipy.sparse as sps 11 | import porepy as pp 12 | 13 | 14 | class FvSubGrid(pp.Grid): 15 | """ 16 | Define a subgrid for the finite volume discretizations. Each cell is divided 17 | up into subcells according to the nodes. A 2D Cartesian cell is divided in 18 | four sub-cells while a 2D simplex cell is divided into three cells. The 19 | face-centers of the sub-grid will be the continuity point as given by eta. 20 | This should correspond the the eta given to the finite volume discretization. 21 | 22 | """ 23 | 24 | def __init__(self, g, eta): 25 | """ 26 | Initialization of grid. 27 | 28 | Parameters: 29 | ----------- 30 | g (pp.Grid): A grid that will be divided into subcells. 31 | eta (np.ndarray): Defines the face centers of the sub-grid (continuity point 32 | of the finite volume methods). eta=0 retrives the face centers of g, while 33 | eta=1 sets the face centers of the subgrid equal the nodes of g. 34 | 35 | Returns: 36 | -------- 37 | pp.Grid: The computed subgrid. 38 | """ 39 | subcell_topology = pp.numerics.fv.fvutils.SubcellTopology(g) 40 | # we collect all nodes in the subgrid. This will be all nodes of the 41 | # grid + the face-centers + the cell_centers 42 | # First we find the mapping from sub_faces to the nodes, 43 | # which is just a 1-1 mapping 44 | nodes = g.nodes.copy() 45 | 46 | nno_unique = subcell_topology.nno_unique 47 | sf_n_indptr = np.arange(nno_unique.size + 1) 48 | data = np.ones(nno_unique.size, dtype=bool) 49 | subface_to_nodes = sps.csc_matrix((data, nno_unique, sf_n_indptr)) 50 | # We now add the mapping from sub_cells to nodes 51 | sc_n_indices = g.cell_nodes().indices 52 | sc_n_indptr = np.arange(sc_n_indices.size + 1) 53 | data = np.ones(sc_n_indices.size, dtype=bool) 54 | subcell_to_nodes = sps.csc_matrix((data, sc_n_indices, sc_n_indptr)) 55 | # And from this obtain the subcell to subface mapping 56 | subcell_to_subfaces = (subface_to_nodes.T * subcell_to_nodes).tocsc() 57 | # flip one sign of duplicate subfaces 58 | _, ix = np.unique(subcell_to_subfaces.indices, return_index=True) 59 | subcell_to_subfaces.data = subcell_to_subfaces.data.astype(int) 60 | subcell_to_subfaces.data[ix] *= -1 61 | 62 | # As the face centers we use the continuity point 63 | f_c = g.face_centers[:, subcell_topology.fno_unique] 64 | sub_nodes = g.nodes[:, subcell_topology.nno_unique] 65 | self.face_centers = f_c + eta * (sub_nodes - f_c) 66 | # Finally we call the parrent constructor 67 | name = g.name.copy() 68 | name.append("FvSubGrid") 69 | pp.Grid.__init__( 70 | self, g.dim, nodes, subface_to_nodes, subcell_to_subfaces, name 71 | ) 72 | 73 | num_nodes_per_face = np.diff(g.face_nodes.indptr) 74 | self.face_areas = g.face_areas / num_nodes_per_face 75 | self.face_areas = self.face_areas[subcell_topology.fno_unique] 76 | if hasattr(g, "frac_pairs"): 77 | is_master = np.zeros(g.num_faces, dtype=bool) 78 | is_slave = np.zeros(g.num_faces, dtype=bool) 79 | is_master[g.frac_pairs[0]] = True 80 | is_slave[g.frac_pairs[1]] = True 81 | is_master_hf = is_master[subcell_topology.fno_unique] 82 | is_slave_hf = is_slave[subcell_topology.fno_unique] 83 | self.frac_pairs = np.vstack( 84 | (np.where(is_master_hf)[0], np.where(is_slave_hf)[0]) 85 | ) 86 | -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000005.CatItemTypesByParentTypeID.atx: -------------------------------------------------------------------------------- 1 | "!  " 2 |   {00000000-0000-0000-0000-000000000000}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByDestItemTypeID.atx: -------------------------------------------------------------------------------- 1 |    2 |  {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /ArcGIS/Symbology Layers/Templates.gdb/a00000007.CatRelTypesByOriginItemTypeID.atx: -------------------------------------------------------------------------------- 1 |  2 |    {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/utils/accumarray.py: -------------------------------------------------------------------------------- 1 | from itertools import product 2 | import numpy as np 3 | 4 | 5 | def accum(accmap, a, func=None, size=None, fill_value=0, dtype=None): 6 | """ 7 | An accumulation function similar to Matlab's `accumarray` function. 8 | 9 | Parameters 10 | ---------- 11 | accmap : ndarray 12 | This is the "accumulation map". It maps input (i.e. indices into 13 | `a`) to their destination in the output array. The first `a.ndim` 14 | dimensions of `accmap` must be the same as `a.shape`. That is, 15 | `accmap.shape[:a.ndim]` must equal `a.shape`. For example, if `a` 16 | has shape (15,4), then `accmap.shape[:2]` must equal (15,4). In this 17 | case `accmap[i,j]` gives the index into the output array where 18 | element (i,j) of `a` is to be accumulated. If the output is, say, 19 | a 2D, then `accmap` must have shape (15,4,2). The value in the 20 | last dimension give indices into the output array. If the output is 21 | 1D, then the shape of `accmap` can be either (15,4) or (15,4,1) 22 | a : ndarray 23 | The input data to be accumulated. 24 | func : callable or None 25 | The accumulation function. The function will be passed a list 26 | of values from `a` to be accumulated. 27 | If None, numpy.sum is assumed. 28 | size : ndarray or None 29 | The size of the output array. If None, the size will be determined 30 | from `accmap`. 31 | fill_value : scalar 32 | The default value for elements of the output array. 33 | dtype : numpy data type, or None 34 | The data type of the output array. If None, the data type of 35 | `a` is used. 36 | 37 | Returns 38 | ------- 39 | out : ndarray 40 | The accumulated results. 41 | 42 | The shape of `out` is `size` if `size` is given. Otherwise the 43 | shape is determined by the (lexicographically) largest indices of 44 | the output found in `accmap`. 45 | 46 | 47 | Examples 48 | -------- 49 | >>> from numpy import array, prod 50 | >>> a = array([[1,2,3],[4,-1,6],[-1,8,9]]) 51 | >>> a 52 | array([[ 1, 2, 3], 53 | [ 4, -1, 6], 54 | [-1, 8, 9]]) 55 | >>> # Sum the diagonals. 56 | >>> accmap = array([[0,1,2],[2,0,1],[1,2,0]]) 57 | >>> s = accum(accmap, a) 58 | array([9, 7, 15]) 59 | >>> # A 2D output, from sub-arrays with shapes and positions like this: 60 | >>> # [ (2,2) (2,1)] 61 | >>> # [ (1,2) (1,1)] 62 | >>> accmap = array([ 63 | [[0,0],[0,0],[0,1]], 64 | [[0,0],[0,0],[0,1]], 65 | [[1,0],[1,0],[1,1]], 66 | ]) 67 | >>> # Accumulate using a product. 68 | >>> accum(accmap, a, func=prod, dtype=float) 69 | array([[ -8., 18.], 70 | [ -8., 9.]]) 71 | >>> # Same accmap, but create an array of lists of values. 72 | >>> accum(accmap, a, func=lambda x: x, dtype='O') 73 | array([[[1, 2, 4, -1], [3, 6]], 74 | [[-1, 8], [9]]], dtype=object) 75 | """ 76 | 77 | # Check for bad arguments and handle the defaults. 78 | if accmap.shape[: a.ndim] != a.shape: 79 | raise ValueError("The initial dimensions of accmap must be the same as a.shape") 80 | if func is None: 81 | func = np.sum 82 | if dtype is None: 83 | dtype = a.dtype 84 | if accmap.shape == a.shape: 85 | accmap = np.expand_dims(accmap, -1) 86 | adims = tuple(range(a.ndim)) 87 | if size is None: 88 | size = 1 + np.squeeze(np.apply_over_axes(np.max, accmap, axes=adims)) 89 | size = np.atleast_1d(size) 90 | 91 | # Create an array of python lists of values. 92 | vals = np.empty(size, dtype="O") 93 | for s in product(*[range(k) for k in size]): 94 | vals[s] = [] 95 | for s in product(*[range(k) for k in a.shape]): 96 | indx = tuple(accmap[s]) 97 | val = a[s] 98 | vals[indx].append(val) 99 | 100 | # Create the output array. 101 | out = np.empty(size, dtype=dtype) 102 | for s in product(*[range(k) for k in size]): 103 | if vals[s] == []: 104 | out[s] = fill_value 105 | else: 106 | out[s] = func(vals[s]) 107 | 108 | return out 109 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/params/parameter_dictionaries.py: -------------------------------------------------------------------------------- 1 | """ Parameter dictionaries. 2 | 3 | Here, we store various parameter dictionaries with "sensible" (typically unitary or 4 | zero) default values for the parameters required by the discretization objects. 5 | """ 6 | 7 | import numpy as np 8 | import porepy as pp 9 | 10 | 11 | def flow_dictionary(g, in_data=None): 12 | """ Dictionary with parameters for standard flow problems. 13 | 14 | All parameters listed below which are not specified in in_data are assigned default 15 | values. Additional parameters may be passed in in_data. 16 | 17 | Args: 18 | g: Grid. 19 | in_data: Dictionary containing any custom (non-default) parameter values. 20 | 21 | Returns: 22 | Dictionary with the "mathematical" parameters required by various flow 23 | discretization objects specified. 24 | """ 25 | # Ensure that the standard flow parameters are present in d. Values from in_data 26 | # have priority over the default values. 27 | d = { 28 | "source": np.zeros(g.num_cells), 29 | "mass_weight": np.ones(g.num_cells), 30 | "second_order_tensor": pp.SecondOrderTensor(np.ones(g.num_cells)), 31 | "bc": pp.BoundaryCondition(g), 32 | "bc_values": np.zeros(g.num_faces), 33 | "time_step": 1, 34 | } 35 | 36 | # Ensure that parameters not handled above are copied. Values from in_data have 37 | # priority over the default values. 38 | if not in_data: 39 | in_data = {} 40 | d.update(in_data) 41 | return d 42 | 43 | 44 | def transport_dictionary(g, in_data=None): 45 | """ Dictionary with parameters for standard transport problems. 46 | 47 | All parameters listed below which are not specified in in_data are assigned default 48 | values. Additional parameters may be passed in in_data. 49 | 50 | Args: 51 | g: Grid. 52 | in_data: Dictionary containing any custom (non-default) parameter values. 53 | 54 | Returns: 55 | Dictionary with the "mathematical" parameters required by various flow 56 | discretization objects specified. 57 | """ 58 | # Ensure that the standard transport parameters are present in d. Values from 59 | # in_data have priority over the default values. 60 | d = { 61 | "source": np.zeros(g.num_cells), 62 | "mass_weight": np.ones(g.num_cells), 63 | "second_order_tensor": pp.SecondOrderTensor(np.ones(g.num_cells)), 64 | "bc": pp.BoundaryCondition(g), 65 | "bc_values": np.zeros(g.num_faces), 66 | "darcy_flux": np.zeros(g.num_faces), 67 | "time_step": 1, 68 | } 69 | 70 | # Ensure that parameters not handled above are copied. Values from in_data have 71 | # priority over the default values. 72 | if not in_data: 73 | in_data = {} 74 | d.update(in_data) 75 | return d 76 | 77 | 78 | def mechanics_dictionary(g, in_data=None): 79 | """ Dictionary with parameters for standard mechanics problems. 80 | 81 | All parameters listed below which are not specified in in_data are assigned default 82 | values. Additional parameters may be passed in in_data. 83 | 84 | Args: 85 | g: Grid. 86 | in_data: Dictionary containing any custom (non-default) parameter values. 87 | 88 | Returns: 89 | Dictionary with the "mathematical" parameters required by various flow 90 | discretization objects specified. 91 | """ 92 | # Ensure that the standard mechanics parameters are present in d. 93 | d = { 94 | "porosity": np.ones(g.num_cells), 95 | "source": np.zeros(g.dim * g.num_cells), 96 | "mass_weight": np.ones(g.num_cells), 97 | "fourth_order_tensor": pp.FourthOrderTensor( 98 | np.ones(g.num_cells), np.ones(g.num_cells) 99 | ), 100 | "bc": pp.BoundaryConditionVectorial(g), 101 | "bc_values": np.zeros(g.dim * g.num_faces), 102 | "slip_distance": np.zeros(g.num_faces * g.dim), 103 | "time_step": 1, 104 | } 105 | 106 | # Ensure that parameters not handled above are copied. Values from in_data have 107 | # priority over the default values. 108 | if not in_data: 109 | in_data = {} 110 | d.update(in_data) 111 | return d 112 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/fcts.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import porepy as pp 3 | 4 | # --------------------------------------------------------------------------- # 5 | 6 | def read_network(file_name, **kwargs): 7 | """ 8 | Read the global network and return the biggest one 9 | """ 10 | 11 | # read the csv file pp format 12 | network, frac_id = pp.fracture_importer.network_2d_from_csv(file_name, return_frac_id=True, **kwargs) 13 | 14 | pts_shift = np.amin(network.pts, axis=1) 15 | pts_shift = np.atleast_2d(pts_shift).T 16 | 17 | # shift the points more in the origin 18 | network.pts -= pts_shift 19 | 20 | # define the domain as bounding box on the fractures 21 | network.domain = pp.bounding_box.from_points(network.pts, overlap=kwargs["tol"]) 22 | 23 | return network, frac_id, pts_shift 24 | 25 | ##### we might have differente unconnected networks, split them 26 | ####sub_networks = network.connected_networks() 27 | 28 | ##### NOTE: we keep the biggest network, meaning the one with bigger diagonal of the bounding box 29 | ####diam = np.zeros(sub_networks.size) 30 | ####for idx, sub_network in enumerate(sub_networks): 31 | #### # remove unused points in the network 32 | #### sub_network.purge_pts() 33 | 34 | #### # compute the diameter of the current network 35 | #### b_box = pp.bounding_box.from_points(sub_network.pts) 36 | #### diam[idx] = np.sqrt((b_box["xmax"] - b_box["xmin"])**2 + 37 | #### (b_box["ymax"] - b_box["ymin"])**2) 38 | 39 | #### # update the domain as the bounding box 40 | #### sub_network.domain = b_box 41 | 42 | ##### remove dangling end 43 | 44 | ##### return the selected network 45 | ####return sub_networks[np.argmax(diam)] 46 | 47 | # --------------------------------------------------------------------------- # 48 | 49 | # Read the grid 50 | def read_cart_grid(nx, ny, lx=1, ly=1): 51 | gb = pp.meshing.cart_grid([], [nx, ny], physdims=[lx, ly]) 52 | gb.compute_geometry() 53 | return gb 54 | 55 | # --------------------------------------------------------------------------- # 56 | 57 | def argsort_cart_grid(nx, ny): 58 | """ Return the cell mapping according to qgis way of passing the input data. 59 | """ 60 | order_qgis = np.arange(nx*ny).reshape((nx, ny))[:, ::-1].T 61 | order_qgis = order_qgis.flatten() 62 | return order_qgis, np.argsort(order_qgis) 63 | 64 | # --------------------------------------------------------------------------- # 65 | 66 | def bc_flag(gb, g, data, tol): 67 | """ 68 | The dictionary data requires the following parameters: 69 | - flow_direction, possible values: 70 | left_to_right, right_to_left, bottom_to_top, and top_to_bottom 71 | - low_value 72 | - high_value 73 | """ 74 | b_faces, b_low, b_high = _bc_dir(gb, g, data["flow_direction"], tol) 75 | 76 | # define the labels and values for the boundary faces 77 | labels = np.array(["neu"] * b_faces.size) 78 | labels[np.logical_or(b_low, b_high)] = "dir" 79 | 80 | if data["low_value"] >= data["high_value"]: 81 | raise ValueError("The low value has to be smaller than the high value in the boundary") 82 | 83 | bc_val = np.zeros(g.num_faces) 84 | bc_val[b_faces[b_low]] = data["low_value"] 85 | bc_val[b_faces[b_high]] = data["high_value"] 86 | 87 | return labels, bc_val 88 | 89 | # --------------------------------------------------------------------------- # 90 | 91 | def _bc_dir(gb, g, flow, tol): 92 | 93 | b_faces = g.tags["domain_boundary_faces"].nonzero()[0] 94 | b_face_centers = g.face_centers[:, b_faces] 95 | min_vals, max_vals = gb.bounding_box() 96 | 97 | if flow == "left_to_right": 98 | b_low = b_face_centers[0, :] > max_vals[0] - tol 99 | b_high = b_face_centers[0, :] < min_vals[0] + tol 100 | elif flow == "right_to_left": 101 | b_high = b_face_centers[0, :] > max_vals[0] - tol 102 | b_low = b_face_centers[0, :] < min_vals[0] + tol 103 | elif flow == "bottom_to_top": 104 | b_low = b_face_centers[1, :] > max_vals[1] - tol 105 | b_high = b_face_centers[1, :] < min_vals[1] + tol 106 | elif flow == "top_to_bottom": 107 | b_high = b_face_centers[1, :] > max_vals[1] - tol 108 | b_low = b_face_centers[1, :] < min_vals[1] + tol 109 | else: 110 | ValueError("Direction not defined properly") 111 | 112 | return b_faces, b_low, b_high 113 | 114 | # --------------------------------------------------------------------------- # 115 | -------------------------------------------------------------------------------- /QGIS/network_gt/networkgt/flow/porepy/numerics/vem/vem_source.py: -------------------------------------------------------------------------------- 1 | """ 2 | Discretization of the source term of an equation tailored for a dual 3 | (flux-pressure) system. The sources are assigned to the rows starting from 4 | g.num_faces, that is, to those rows in the saddle point system that represents 5 | conservation. 6 | 7 | """ 8 | 9 | import numpy as np 10 | import scipy.sparse as sps 11 | 12 | import porepy as pp 13 | 14 | 15 | class DualScalarSource: 16 | """ 17 | Discretization of the integrated source term 18 | int q * dx 19 | over each grid cell. 20 | 21 | All this function does is returning a zero lhs and 22 | rhs = - param.get_source.keyword in a saddle point fashion. 23 | """ 24 | 25 | def __init__(self, keyword="flow"): 26 | self.keyword = keyword 27 | 28 | def ndof(self, g): 29 | return g.num_cells + g.num_faces 30 | 31 | def assemble_matrix_rhs(self, g, data): 32 | """ Return the (null) matrix and right-hand side for a discretization of the 33 | integrated source term. Also discretize the necessary operators if the data 34 | dictionary does not contain a source term. 35 | 36 | Parameters: 37 | g : grid, or a subclass, with geometry fields computed. 38 | data: dictionary to store the data. 39 | 40 | Returns: 41 | lhs (sparse dia, self.ndof x self.ndof): Null lhs. 42 | sources (array, self.ndof): Right-hand side vector. 43 | 44 | The names of data in the input dictionary (data) are: 45 | param (Parameter Class) with the source field set for self.keyword. The assigned 46 | source values are assumed to be integrated over the cell volumes. 47 | 48 | """ 49 | return self.assemble_matrix(g, data), self.assemble_rhs(g, data) 50 | 51 | def assemble_matrix(self, g, data): 52 | """ Return the (null) matrix and for a discretization of the integrated source 53 | term. Also discretize the necessary operators if the data dictionary does not 54 | contain a source term. 55 | 56 | Parameters: 57 | g (Grid): Computational grid, with geometry fields computed. 58 | data (dictionary): With data stored. 59 | 60 | Returns: 61 | scipy.sparse.csr_matrix (self.ndof x self.ndof): Null system matrix of this 62 | discretization. 63 | 64 | """ 65 | matrix_dictionary = data[pp.DISCRETIZATION_MATRICES][self.keyword] 66 | 67 | return matrix_dictionary["source"] 68 | 69 | def assemble_rhs(self, g, data): 70 | """ Return the rhs for a discretization of the integrated source term. Also 71 | discretize the necessary operators if the data dictionary does not contain a 72 | source term. 73 | 74 | Parameters: 75 | g (Grid): Computational grid, with geometry fields computed. 76 | data (dictionary): With data stored. 77 | 78 | Returns: 79 | np.array (self.ndof): Right hand side vector representing the 80 | source. 81 | 82 | """ 83 | parameter_dictionary = data[pp.PARAMETERS][self.keyword] 84 | 85 | sources = parameter_dictionary["source"] 86 | if not sources.size == g.num_cells: 87 | raise ValueError("There should be one source value for each cell") 88 | 89 | # The sources are assigned to the rows representing conservation. 90 | rhs = np.zeros(self.ndof(g)) 91 | is_p = np.hstack( 92 | (np.zeros(g.num_faces, dtype=bool), np.ones(g.num_cells, dtype=bool)) 93 | ) 94 | # A minus sign is apparently needed here to be consistent with the user 95 | # side convention of the finite volume method 96 | rhs[is_p] = -sources 97 | return rhs 98 | 99 | def discretize(self, g, data, faces=None): 100 | """ Discretize an integrated source term. 101 | 102 | Parameters: 103 | g : grid, or a subclass, with geometry fields computed. 104 | data: dictionary to store the data. 105 | 106 | Stores: 107 | lhs (sparse dia, self.ndof x self.ndof): Null lhs, stored as 108 | self._key() + "source". 109 | 110 | The names of data in the input dictionary (data) are: 111 | param (Parameter Class) with the source field set for self.keyword. The assigned 112 | source values are assumed to be integrated over the cell volumes. 113 | 114 | """ 115 | lhs = sps.csc_matrix((self.ndof(g), self.ndof(g))) 116 | matrix_dictionary = data[pp.DISCRETIZATION_MATRICES][self.keyword] 117 | matrix_dictionary["source"] = lhs 118 | --------------------------------------------------------------------------------