Changeset 27088


Ignore:
Timestamp:
06/22/22 01:44:10 (3 years ago)
Author:
bdef
Message:

NEW: new capability for front and BCs plotting and experimental plotter for GlADS channels

Location:
issm/trunk-jpl/src/m/plot
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/plot_BC.py

    r24290 r27088  
    44from plot_icefront import plot_icefront
    55from hydrologydc import hydrologydc
     6from hydrologyglads import hydrologyglads
    67from mpl_toolkits.mplot3d import Axes3D
    78from mpl_toolkits.axes_grid1.inset_locator import inset_axes
     
    3637        #define what to plot with plot style
    3738        spc_dict = {'spcvx': ['stressbalance', 'o', 'r', 240, 'vx Dirichlet'],
    38                     'spcvy': ['stressbalance', 'o', 'b', 160, 'vy Dirichlet']}
     39                    'spcvy': ['stressbalance', 'o', 'b', 160, 'vy Dirichlet'],
     40                    'spcthickness': ['masstransport', 'o', 'k', 40, 'Thickness']}
    3941        if not is2d:
    4042            spc_dict['spcvz'] = ['stressbalance', 'o', 'y', 80, 'vy Dirichlet']
     
    4446            if md.hydrology.isefficientlayer:
    4547                spc_dict['spcsediment_head'] = ['hydrology', '^', 'b', 240, 'IDS Head']
     48
     49        if isinstance(md.hydrology, hydrologyglads):
     50            spc_dict['spcphi'] = ['hydrology', 'v', 'r', 240, 'phi']
    4651
    4752        for key in spc_dict:
  • issm/trunk-jpl/src/m/plot/plot_icefront.py

    r24290 r27088  
    11import numpy as np
    22from processmesh import processmesh
     3import matplotlib as mpl
    34from mpl_toolkits.mplot3d.art3d import Line3DCollection
    45from mpl_toolkits.axes_grid1.inset_locator import inset_axes
     
    2627    icefront = np.where(np.logical_and(iceelement != nodes_per_elt, iceelement != 0))
    2728
     29    oceannodes = md.mask.ocean_levelset < 0
     30    oceanelement = np.sum(oceannodes[elements], axis=1)
     31
     32    #icefront check
     33    groundingline = np.where(np.logical_and(oceanelement != nodes_per_elt, oceanelement != 0))
     34
    2835    #plot mesh
    2936    if is2d:
     
    3239        #highlight elements on neumann
    3340        if len(icefront[0]) > 0:
    34             colors = np.asarray([0.5 for element in elements[icefront]])
    35             ax.tripcolor(x, y, elements[icefront], facecolors=colors, alpha=0.5, label='elements on ice front')
     41            colors = np.ones(np.shape(elements[icefront])[0])
     42            cmap = mpl.colors.ListedColormap("navy")
     43            ax.tripcolor(x, y, elements[icefront], facecolors=colors, edgecolor='k', label='elements on ice front', cmap=cmap)
     44        if len(groundingline[0]) > 0:
     45            colors = np.ones(np.shape(elements[groundingline])[0])
     46            cmap = mpl.colors.ListedColormap("limegreen")
     47            ax.tripcolor(x, y, elements[groundingline], facecolors=colors, edgecolor='k', label='elements on grounding line', cmap=cmap)
    3648    else:
    3749        ax = inset_axes(ax, width='100%', height='100%', loc=3, borderpad=0, axes_class=Axes3D)
Note: See TracChangeset for help on using the changeset viewer.