Skip to content

Commit

Permalink
Merge pull request #31 from scharlton2/main
Browse files Browse the repository at this point in the history
Fixes #20 by excluding CSUB from model features
  • Loading branch information
scharlton2 authored Mar 15, 2022
2 parents 822ca2f + 008da20 commit c5ea822
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ jobs:
github_token: ${{secrets.GITHUB_TOKEN}}
branch: main

- name: Commit and push branch
if: (! (github.repository == 'MODFLOW-USGS/modelviewer-mf6') )
uses: actions-js/push@master
with:
github_token: ${{secrets.GITHUB_TOKEN}}
branch: __${{env.NEXT_VERSION}}.${{github.run_number}}
# - name: Commit and push branch
# if: (! (github.repository == 'MODFLOW-USGS/modelviewer-mf6') )
# uses: actions-js/push@master
# with:
# github_token: ${{secrets.GITHUB_TOKEN}}
# branch: HEAD:refs/heads/__${{env.NEXT_VERSION}}.${{github.run_number}}

- name: Configure
shell: pwsh
Expand Down
15 changes: 15 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,28 @@
"cacheVariables": {
"VTK_DIR" : "C:/VTK-6.3.0-vs2017-x64/lib/cmake/vtk-6.3"
}
},
{
"name": "vs2019_leaks",
"displayName": "vs2019 x64 with vtk-6.3.0-vs2017 (builds in _vs2019_leaks)",
"generator": "Visual Studio 16 2019",
"architecture": "x64",
"binaryDir": "${sourceDir}/_${presetName}",
"cacheVariables": {
"VTK_DIR" : "C:/VTK-6.3.0-leaks-vs2017-x64/lib/cmake/vtk-6.3",
"MV_DEBUG_MEMORY_LEAKS": "ON"
}
}
]
,
"buildPresets": [
{
"name": "vs2019",
"configurePreset": "vs2019"
},
{
"name": "vs2019_leaks",
"configurePreset": "vs2019_leaks"
}
],
"vendor": {
Expand Down
6 changes: 6 additions & 0 deletions mv/Modflow6DataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,7 @@ void Modflow6DataSource::SetTimePointTo(int timePointIndex)
if (IsModelFeature(flowType))
{
np = ip;
assert(0 <= np && np < m_ModelFeatureArraySize);
m_ModelFeatureArray[np] = 0; // this element holds the number of vtkcells associated with the feature
ip++;
}
Expand All @@ -2311,7 +2312,9 @@ void Modflow6DataSource::SetTimePointTo(int timePointIndex)
int row = (nm1 % ncpl) / m_NumberOfCellColumns + 1;
int col = ((nm1 % ncpl) % m_NumberOfCellColumns) + 1;
// find the VTK index for this node
assert(0 <= ip && ip < m_ModelFeatureArraySize);
m_ModelFeatureArray[ip] = (m_NumberOfCellLayers - layer) * ncpl + (m_NumberOfCellRows - row) * m_NumberOfCellColumns + col - 1;
assert(0 <= np && np < m_ModelFeatureArraySize);
m_ModelFeatureArray[np]++;
ip++;
}
Expand All @@ -2320,7 +2323,9 @@ void Modflow6DataSource::SetTimePointTo(int timePointIndex)
mf_cell_index = node - 1;
for (k = 1; k <= m_MfCell2VtkCells[mf_cell_index][0]; k++)
{
assert(0 <= ip && ip < m_ModelFeatureArraySize);
m_ModelFeatureArray[ip] = m_MfCell2VtkCells[mf_cell_index][k];
assert(0 <= np && np < m_ModelFeatureArraySize);
m_ModelFeatureArray[np]++;
ip++;
}
Expand Down Expand Up @@ -2418,6 +2423,7 @@ int Modflow6DataSource::IsModelFeature(char *flowType)
!strstr(flowType, "UZF-GWET") &&
!strstr(flowType, "LAK") &&
!strstr(flowType, "FLOW-JA-FACE") &&
!strstr(flowType, "CSUB") && // @TODO fixes crash when loading ex-gwf-csub-p04
!strstr(flowType, "DATA-SPDIS"));
}

Expand Down

0 comments on commit c5ea822

Please sign in to comment.