Skip to content

Commit

Permalink
Merge branch 'modflow'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Serrano committed Feb 21, 2018
2 parents 20f14fc + 320c50d commit b979f2f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
7 changes: 6 additions & 1 deletion geomodelr/cpp/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,12 @@ pydict ModelPython::filter_lines( bool ext, const wstring& ft ) const {
for ( auto it = this->global_faults.begin(); it != this->global_faults.end(); it++ ) {
if ( ft != L"ALL" )
{
wstring lft = (this->feature_types.find(it->first))->second;
auto itf = this->feature_types.find(it->first);
// Avoid seg fault, but should not happen.
if ( itf == this->feature_types.end() ) {
continue;
}
wstring lft = itf->second;
if ( lft != ft ) {
continue;
}
Expand Down
13 changes: 7 additions & 6 deletions geomodelr/modflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def create_modflow_inputs(name, model, units_data,
#geo=fp.utils.reference.SpatialReference(delr=dX*np.ones(cols),delc=dY*np.ones(rows),
#lenuni=length_units, xll=X_inf, yll=Y_inf,units='meters',epsg=3116)

mf_handle = fp.modflow.mf.Modflow(modelname=name,namefile_ext='nam',
version='mf2005')
mf_handle = fp.modflow.mf.Modflow(modelname=name,namefile_ext='nam')

# Variables for the Dis package
dis = fp.modflow.ModflowDis(mf_handle,nlay=layers, nrow=rows, ncol=cols,
top=Z_top, botm=Z_bottoms, delc=dY, delr=dX, xul=X_inf, yul=Y_sup,
Expand Down Expand Up @@ -289,8 +289,9 @@ def faults_intersections(faults,faults_data,rows,cols,layers,Z_top,Z_bottoms,X_i
anisotropy_bool = not(np.isscalar(K_anisotropy_hor))
ibound_bool = not(np.isscalar(I_bound))

for name,fault in faults.iteritems():
Data = faults_data[name]
#for name,fault in faults.iteritems():
for name,Data in faults_data.iteritems():
fault = faults[name]
for plane in fault:
fplane = np.array(plane)

Expand Down Expand Up @@ -580,8 +581,8 @@ def adaptive_grid(model,rows,cols,layers, Z_top,X_inf,Y_sup,

#if (np.sum(Z_Bool_Top & Z_Bool_Bot) == 0):
if not(np.any(Z_Bool_Top & Z_Bool_Bot)):

Z_bottoms[Count_Lay][Z_Bool_Bot | np.logical_not(Z_Bool_Top)] = Z_Layer_L[Z_Bool_Bot | np.logical_not(Z_Bool_Top)]
Z_bool_aux = Z_Bool_Bot | np.logical_not(Z_Bool_Top)
Z_bottoms[Count_Lay][Z_bool_aux] = Z_Layer_L[Z_bool_aux]
Z_Bool_Top = Z_Bool_Top | Z_Bool_Bot

Layer_Correction(Pos_List,Mat_Order,Z_Bool_Top,Z_top,Z_bottoms,
Expand Down
2 changes: 1 addition & 1 deletion geomodelr/test_files/Modelo_Hidro.json

Large diffs are not rendered by default.

0 comments on commit b979f2f

Please sign in to comment.