Changeset 8298


Ignore:
Timestamp:
05/16/11 15:01:42 (14 years ago)
Author:
seroussi
Message:

changed grid to node in matlab

Location:
issm/trunk/src/m
Files:
108 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/@modellist/get.m

    r2912 r8298  
    88case 'numberofelements'
    99        val = a.numberofelements;
    10 case 'numberofgrids'
    11         val = a.numberofgrids;
     10case 'numberofnodes'
     11        val = a.numberofnodes;
    1212case 'elements'
    1313        val = a.elements;
  • issm/trunk/src/m/classes/model.m

    r8229 r8298  
    2727                 dim=0;
    2828                 numberofelements=0;
    29                  numberofgrids=0;
     29                 numberofnodes=0;
    3030                 elements=NaN;
    3131                 elements_type=NaN;
     
    4747                 %Initial 2d mesh
    4848                 numberofelements2d=0;
    49                  numberofgrids2d=0;
     49                 numberofnodes2d=0;
    5050                 elements2d=NaN;
    5151                 elements_type2d=NaN;
     
    7272
    7373                 %Nodes
    74                  gridonhutter=NaN;
    75                  gridonmacayeal=NaN;
    76                  gridonpattyn=NaN;
    77                  gridonstokes=NaN;
     74                 nodeonhutter=NaN;
     75                 nodeonmacayeal=NaN;
     76                 nodeonpattyn=NaN;
     77                 nodeonstokes=NaN;
    7878                 borderstokes=NaN;
    7979
     
    9595
    9696                 %Projections
    97                  uppergrids=NaN;
     97                 uppernodes=NaN;
    9898                 upperelements=NaN;
    9999                 lowerelements=NaN;
    100                  lowergrids=NaN;
     100                 lowernodes=NaN;
    101101
    102102                 %Extrusion
     
    105105                 elementonbed=NaN;
    106106                 elementonsurface=NaN;
    107                  gridonbed=NaN;
    108                  gridonsurface=NaN;
     107                 nodeonbed=NaN;
     108                 nodeonsurface=NaN;
    109109                 minh=0;
    110110                 firn_layer=NaN;
    111111
    112112                 %Extraction
    113                  extractedgrids=NaN;
     113                 extractednodes=NaN;
    114114                 extractedelements=NaN;
    115115
     
    146146                 elementonwater=NaN;
    147147                 elementonnuna=NaN;
    148                  gridoniceshelf=NaN;
    149                  gridonicesheet=NaN;
    150                  gridonwater=NaN;
    151                  gridonnuna=NaN;
     148                 nodeoniceshelf=NaN;
     149                 nodeonicesheet=NaN;
     150                 nodeonwater=NaN;
     151                 nodeonnuna=NaN;
    152152                 surface=NaN;
    153153                 thickness=NaN;
     
    158158
    159159                 %Boundary conditions
    160                  gridonboundary=NaN;
     160                 nodeonboundary=NaN;
    161161                 pressureload=NaN;
    162162                 spcvelocity=NaN;
  • issm/trunk/src/m/kml/README.txt

    r7133 r8298  
    6161There are some other utilities that are used in the construction of topological tables for the kml writing.
    6262
    63 nodeconnectivity.m   - create a node connectivity table (ngrids x mxepg+1)
     63nodeconnectivity.m   - create a node connectivity table (nnodes x mxepg+1)
    6464edgeadjacency.m      - create an edge adjacency array (elems x edges)
    6565edgeperimeter.m      - create an edge perimeter (edgeper x 2) and element perimeter (edgeper x 1) list
  • issm/trunk/src/m/kml/kml_mesh_elem.m

    r7652 r8298  
    7676    if     (numel(data)==md.numberofelements)
    7777        edata=data;
    78     elseif (numel(data)==md.numberofgrids)
     78    elseif (numel(data)==md.numberofnodes)
    7979        ndata=data;
    8080        display('Averaging nodal data to element data.');
     
    123123end
    124124kfold.visibility=1;
    125 kfold.descript  =sprintf('Elements=%d, Grids=%d',...
    126     md.numberofelements,md.numberofgrids);
     125kfold.descript  =sprintf('Elements=%d, Nodes=%d',...
     126    md.numberofelements,md.numberofnodes);
    127127% see matlab_oop, "initializing a handle object array"
    128128%kfold.feature   ={repmat(kml_placemark(),1,size(md.elements,1))};
  • issm/trunk/src/m/kml/kml_mesh_write.m

    r7460 r8298  
    8282    if     (numel(data)==md.numberofelements)
    8383        edata=data;
    84     elseif (numel(data)==md.numberofgrids)
     84    elseif (numel(data)==md.numberofnodes)
    8585        ndata=data;
    8686        display('Averaging nodal data to element data.');
  • issm/trunk/src/m/kml/kml_part_edges.m

    r7461 r8298  
    7777    if     (numel(data)==md.numberofelements)
    7878        edata=data;
    79     elseif (numel(data)==md.numberofgrids)
     79    elseif (numel(data)==md.numberofnodes)
    8080        ndata=data;
    8181        display('Averaging nodal data to element data.');
     
    123123    kfold.visibility=1;
    124124    kfold.descript  =sprintf('Partitions=%d, Nodes=%d',...
    125         md.npart,md.numberofgrids);
     125        md.npart,md.numberofnodes);
    126126    kfold.feature   ={repmat(kml_placemark(),1,md.npart)};
    127127
     
    150150        elemp=md.elements(irow,:);
    151151        epartp=epart(irow,:);
    152         nodeconp=nodeconnectivity(elemp,md.numberofgrids);
     152        nodeconp=nodeconnectivity(elemp,md.numberofnodes);
    153153        [edgeadjp]=edgeadjacency(elemp,nodeconp);
    154154        [edgeper,elemper,iloop]=edgeperimeter(elemp,nodeconp,edgeadjp);
  • issm/trunk/src/m/kml/kml_part_elems.m

    r7461 r8298  
    7777    if     (numel(data)==md.numberofelements)
    7878        edata=data;
    79     elseif (numel(data)==md.numberofgrids)
     79    elseif (numel(data)==md.numberofnodes)
    8080        ndata=data;
    8181        display('Averaging nodal data to element data.');
     
    123123    kfold.visibility=1;
    124124    kfold.descript  =sprintf('Partitions=%d, Nodes=%d\n',...
    125         md.npart,md.numberofgrids);
     125        md.npart,md.numberofnodes);
    126126    kfold.feature   ={repmat(kml_placemark(),1,md.npart)};
    127127
  • issm/trunk/src/m/kml/kml_partitions.m

    r7461 r8298  
    7878    if     (numel(data)==md.numberofelements)
    7979        edata=data;
    80     elseif (numel(data)==md.numberofgrids)
     80    elseif (numel(data)==md.numberofnodes)
    8181        ndata=data;
    8282        display('Averaging nodal data to element data.');
     
    124124    kfold.visibility=1;
    125125    kfold.descript  =sprintf('Partitions=%d, Nodes=%d',...
    126         md.npart,md.numberofgrids);
     126        md.npart,md.numberofnodes);
    127127    kfold.feature   ={repmat(kml_placemark(),1,md.npart)};
    128128
     
    151151        elemp=md.elements(irow,:);
    152152        epartp=epart(irow,:);
    153         nodeconp=nodeconnectivity(elemp,md.numberofgrids);
     153        nodeconp=nodeconnectivity(elemp,md.numberofnodes);
    154154        [edgeadjp]=edgeadjacency(elemp,nodeconp);
    155155        [edgeper,elemper,iloop]=edgeperimeter(elemp,nodeconp,edgeadjp);
  • issm/trunk/src/m/kml/nodeconnectivity.m

    r6346 r8298  
    22%  create a node connectivity table for the elements in the model.
    33%
    4 %  [nodecon]=edgeadjacency(elem,ngrids,mxepg)
     4%  [nodecon]=edgeadjacency(elem,nnodes,mxepg)
    55%
    66%  where the required input is:
     
    88%
    99%  and the required output is:
    10 %    nodecon       (numeric, node connectivity array (ngrids x mxepg+1))
     10%    nodecon       (numeric, node connectivity array (nnodes x mxepg+1))
    1111%
    1212%  the optional input is:
    13 %    ngrids        (numeric, number of grids)
    14 %    mxepg         (numeric, max elements per grid)
     13%    nnodes        (numeric, number of nodes)
     14%    mxepg         (numeric, max elements per node)
    1515%
    16 function [nodecon]=nodeconnectivity(elem,ngrids,mxepg)
     16function [nodecon]=nodeconnectivity(elem,nnodes,mxepg)
    1717
    1818if ~nargin
     
    2121end
    2222
    23 if ~exist('ngrids','var') || isempty(ngrids)
    24     ngrids=max(max(elem));
     23if ~exist('nnodes','var') || isempty(nnodes)
     24    nnodes=max(max(elem));
    2525end
    2626if ~exist('mxepg','var') || isempty(mxepg)
     
    3030%%  create the node connectivity array
    3131
    32 nodecon=zeros(ngrids,mxepg+1);
     32nodecon=zeros(nnodes,mxepg+1);
    3333
    3434%  loop over the elements
  • issm/trunk/src/m/model/BasinConstrain.m

    r5024 r8298  
    1414%      md=BasinConstrain(md,'~Iceshelves.exp');
    1515
    16 %now, flag grids and elements outside the domain outline.
     16%now, flag nodes and elements outside the domain outline.
    1717if ischar(domain),
    1818        if isempty(domain),
    1919                elementondomain=zeros(md.numberofelements,1);
    20                 gridondomain=zeros(md.numberofgrids,1);
     20                nodeondomain=zeros(md.numberofnodes,1);
    2121                invert=0;
    2222        elseif strcmpi(domain,'all')
    2323                elementondomain=ones(md.numberofelements,1);
    24                 gridondomain=ones(md.numberofgrids,1);
     24                nodeondomain=ones(md.numberofnodes,1);
    2525                invert=0;
    2626        else
     
    3333                end
    3434                %ok, flag elements and nodes
    35                 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
     35                [nodeondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
    3636        end
    3737        if invert,
    38                 gridondomain=~gridondomain;
     38                nodeondomain=~nodeondomain;
    3939                elementondomain=~elementondomain;
    4040        end
     
    4444
    4545%list of elements and nodes not on domain
    46 gridnotondomain=find(~gridondomain);
     46nodenotondomain=find(~nodeondomain);
    4747elementnotondomain=find(~elementondomain);
    4848
    49 %all elements outside the constraint domain are equivalent to water. all grids outside are spc'd.
    50 md.spcvelocity(gridnotondomain,1:2)=1;
    51 md.spcvelocity(gridnotondomain,4)=md.vx_obs(gridnotondomain);
    52 md.spcvelocity(gridnotondomain,5)=md.vy_obs(gridnotondomain);
     49%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
     50md.spcvelocity(nodenotondomain,1:2)=1;
     51md.spcvelocity(nodenotondomain,4)=md.vx_obs(nodenotondomain);
     52md.spcvelocity(nodenotondomain,5)=md.vy_obs(nodenotondomain);
    5353md.elementonwater(elementnotondomain)=1;
    5454
    55 %now, make sure all elements on water have grids that are spc'd, otherwise, we'll get a singular problem.
     55%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
    5656pos=find(~md.elementonwater);
    5757numpos=unique(md.elements(pos,:));
    58 grids=setdiff(1:1:md.numberofgrids,numpos);
    59 md.spcvelocity(grids,1:2)=1;
    60 md.spcvelocity(grids,4)=md.vx_obs(grids);
    61 md.spcvelocity(grids,5)=md.vy_obs(grids);
     58nodes=setdiff(1:1:md.numberofnodes,numpos);
     59md.spcvelocity(nodes,1:2)=1;
     60md.spcvelocity(nodes,4)=md.vx_obs(nodes);
     61md.spcvelocity(nodes,5)=md.vy_obs(nodes);
    6262
    6363%make sure icefronts that are completely spc'd are taken out:
  • issm/trunk/src/m/model/BasinConstrain2.m

    r5024 r8298  
    1414%      md=BasinConstrain(md,'~Iceshelves.exp');
    1515
    16 %now, flag grids and elements outside the domain outline.
     16%now, flag nodes and elements outside the domain outline.
    1717if ischar(domain),
    1818        if isempty(domain),
    1919                elementondomain=zeros(md.numberofelements,1);
    20                 gridondomain=zeros(md.numberofgrids,1);
     20                nodeondomain=zeros(md.numberofnodes,1);
    2121                invert=0;
    2222        elseif strcmpi(domain,'all')
    2323                elementondomain=ones(md.numberofelements,1);
    24                 gridondomain=ones(md.numberofgrids,1);
     24                nodeondomain=ones(md.numberofnodes,1);
    2525                invert=0;
    2626        else
     
    3333                end
    3434                %ok, flag elements and nodes
    35                 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
     35                [nodeondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
    3636        end
    3737        if invert,
    38                 gridondomain=~gridondomain;
     38                nodeondomain=~nodeondomain;
    3939                elementondomain=~elementondomain;
    4040        end
     
    4444
    4545%list of elements and nodes not on domain
    46 gridnotondomain=find(~gridondomain);
     46nodenotondomain=find(~nodeondomain);
    4747elementnotondomain=find(~elementondomain);
    4848
    49 %all elements outside the constraint domain are equivalent to water. all grids outside are spc'd.
    50 md.spcvelocity(gridnotondomain,1:2)=1;
    51 md.spcvelocity(gridnotondomain,4)=md.vx_obs(gridnotondomain);
    52 md.spcvelocity(gridnotondomain,5)=md.vy_obs(gridnotondomain);
     49%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
     50md.spcvelocity(nodenotondomain,1:2)=1;
     51md.spcvelocity(nodenotondomain,4)=md.vx_obs(nodenotondomain);
     52md.spcvelocity(nodenotondomain,5)=md.vy_obs(nodenotondomain);
    5353md.elementonwater(elementnotondomain)=1;
    5454
    55 %now, make sure all elements on water have grids that are spc'd, otherwise, we'll get a singular problem.
     55%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
    5656pos=find(~md.elementonwater);
    5757numpos=unique(md.elements(pos,:));
    58 grids=setdiff(1:1:md.numberofgrids,numpos);
    59 md.spcvelocity(grids,1:2)=1;
    60 md.spcvelocity(grids,4)=md.vx_obs(grids);
    61 md.spcvelocity(grids,5)=md.vy_obs(grids);
     58nodes=setdiff(1:1:md.numberofnodes,numpos);
     59md.spcvelocity(nodes,1:2)=1;
     60md.spcvelocity(nodes,4)=md.vx_obs(nodes);
     61md.spcvelocity(nodes,5)=md.vy_obs(nodes);
    6262
    6363
  • issm/trunk/src/m/model/BasinConstrainShelf.m

    r5024 r8298  
    1414%      md=BasinConstrain(md,'~Iceshelves.exp');
    1515
    16 %now, flag grids and elements outside the domain outline.
     16%now, flag nodes and elements outside the domain outline.
    1717if ischar(domain),
    1818        if isempty(domain),
    1919                elementondomain=zeros(md.numberofelements,1);
    20                 gridondomain=zeros(md.numberofgrids,1);
     20                nodeondomain=zeros(md.numberofnodes,1);
    2121                invert=0;
    2222        elseif strcmpi(domain,'all')
    2323                elementondomain=ones(md.numberofelements,1);
    24                 gridondomain=ones(md.numberofgrids,1);
     24                nodeondomain=ones(md.numberofnodes,1);
    2525                invert=0;
    2626        else
     
    3333                end
    3434                %ok, flag elements and nodes
    35                 [gridondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
     35                [nodeondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
    3636        end
    3737        if invert,
    38                 gridondomain=~gridondomain;
     38                nodeondomain=~nodeondomain;
    3939                elementondomain=~elementondomain;
    4040        end
     
    4444
    4545%list of elements and nodes not on domain
    46 gridnotondomain=find(~gridondomain);
     46nodenotondomain=find(~nodeondomain);
    4747elementnotondomain=find(~elementondomain);
    4848
    49 %all elements outside the constraint domain are equivalent to water. all grids outside are spc'd.
    50 md.spcvelocity(gridnotondomain,1:2)=1;
    51 md.spcvelocity(gridnotondomain,4)=md.vx_obs(gridnotondomain);
    52 md.spcvelocity(gridnotondomain,5)=md.vy_obs(gridnotondomain);
     49%all elements outside the constraint domain are equivalent to water. all nodes outside are spc'd.
     50md.spcvelocity(nodenotondomain,1:2)=1;
     51md.spcvelocity(nodenotondomain,4)=md.vx_obs(nodenotondomain);
     52md.spcvelocity(nodenotondomain,5)=md.vy_obs(nodenotondomain);
    5353md.elementonwater(elementnotondomain)=1;
    5454
    55 %now, make sure all elements on water have grids that are spc'd, otherwise, we'll get a singular problem.
     55%now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
    5656pos=find(~md.elementonwater);
    5757numpos=unique(md.elements(pos,:));
    58 grids=setdiff(1:1:md.numberofgrids,numpos);
    59 md.spcvelocity(grids,1:2)=1;
    60 md.spcvelocity(grids,4)=md.vx_obs(grids);
    61 md.spcvelocity(grids,5)=md.vy_obs(grids);
     58nodes=setdiff(1:1:md.numberofnodes,numpos);
     59md.spcvelocity(nodes,1:2)=1;
     60md.spcvelocity(nodes,4)=md.vx_obs(nodes);
     61md.spcvelocity(nodes,5)=md.vy_obs(nodes);
    6262
    6363
    64 %make sure any grid with NaN velocity is spc'd:
     64%make sure any node with NaN velocity is spc'd:
    6565pos=find(isnan(md.vel_obs_raw));
    6666md.spcvelocity(pos,1:2)=1;
     
    6969md.spcvelocity(pos,5)=md.vy_obs(pos);
    7070
    71 %iceshelves: any grid on icesheet is spc'd
    72 pos=find(md.gridonicesheet);
     71%iceshelves: any node on icesheet is spc'd
     72pos=find(md.nodeonicesheet);
    7373md.spcvelocity(pos,1:2)=1;
    7474md.spcvelocity(pos,4)=md.vx_obs(pos);
  • issm/trunk/src/m/model/DepthAverage.m

    r3994 r8298  
    1414
    1515%nods data
    16 if (length(vector)==md.numberofgrids),
    17         vector_average=zeros(md.numberofgrids2d,1);
     16if (length(vector)==md.numberofnodes),
     17        vector_average=zeros(md.numberofnodes2d,1);
    1818        for i=1:md.numlayers-1,
    1919                vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.z,i+1)-project2d(md,md.z,i));
  • issm/trunk/src/m/model/MeltingGroundingLines.m

    r2499 r8298  
    77
    88%get nodes on ice sheet and on ice shelf
    9 pos_shelf=find(~md.gridonicesheet);
     9pos_shelf=find(~md.nodeonicesheet);
    1010pos_GL=intersect(unique(md.elements(find(md.elementonicesheet),:)),unique(md.elements(find(md.elementoniceshelf),:)));
    1111
     
    1616        end
    1717
    18         %search the grid on ice sheet the closest to i
     18        %search the node on ice sheet the closest to i
    1919        [d posd]=min(sqrt((md.x(pos_shelf(i))-md.x(pos_GL)).^2+(md.y(pos_shelf(i))-md.y(pos_GL)).^2));
    2020
  • issm/trunk/src/m/model/SectionValues.m

    r6759 r8298  
    7272Y(end+1)=y(nods);
    7373
    74 %Number of grids:
    75 numberofgrids=size(X,1);
     74%Number of nodes:
     75numberofnodes=size(X,1);
    7676
    7777%Compute Z
    78 Z=zeros(numberofgrids,1);
     78Z=zeros(numberofnodes,1);
    7979
    8080%New mesh and Data interpolation
     
    8686
    8787        %Compute index
    88         index=[1:1:(numberofgrids-1);2:1:numberofgrids]';
     88        index=[1:1:(numberofnodes-1);2:1:numberofnodes]';
    8989
    9090else
     
    9999        %Some useful parameters
    100100        layers=ceil(mean(md.thickness)/res_v);
    101         gridsperlayer=numberofgrids;
    102         gridstot=gridsperlayer*layers;
    103         elementsperlayer=gridsperlayer-1;
    104         elementstot=(gridsperlayer-1)*(layers-1);
     101        nodesperlayer=numberofnodes;
     102        nodestot=nodesperlayer*layers;
     103        elementsperlayer=nodesperlayer-1;
     104        elementstot=(nodesperlayer-1)*(layers-1);
    105105
    106106        %initialization
    107         X3=zeros(gridsperlayer*layers,1); Y3=zeros(gridsperlayer*layers,1); Z3=zeros(gridsperlayer*layers,1); S3=zeros(gridsperlayer*layers,1); index3=zeros(elementstot,4);
     107        X3=zeros(nodesperlayer*layers,1); Y3=zeros(nodesperlayer*layers,1); Z3=zeros(nodesperlayer*layers,1); S3=zeros(nodesperlayer*layers,1); index3=zeros(elementstot,4);
    108108
    109109        %Get new coordinates in 3d
     
    115115
    116116                if i<layers %Build index3 with quads
    117                         index3((i-1)*elementsperlayer+1:i*elementsperlayer,:)=[i:layers:gridstot-layers; i+1:layers:gridstot-layers; i+layers+1:layers:gridstot; i+layers:layers:gridstot]';
     117                        index3((i-1)*elementsperlayer+1:i*elementsperlayer,:)=[i:layers:nodestot-layers; i+1:layers:nodestot-layers; i+layers+1:layers:nodestot; i+layers:layers:nodestot]';
    118118                end
    119119        end
  • issm/trunk/src/m/model/ThicknessCorrection.m

    r6904 r8298  
    2323
    2424%get nodes on ice sheet and on ice shelf
    25 pos_shelf=find(~md.gridonicesheet);
     25pos_shelf=find(~md.nodeonicesheet);
    2626pos_GL=intersect(unique(md.elements(find(md.elementonicesheet),:)),unique(md.elements(find(md.elementoniceshelf),:)));
    2727debug=(length(pos_shelf)>50000);
     
    4747        end
    4848
    49         %search the grid on ice sheet the closest to i
     49        %search the node on ice sheet the closest to i
    5050        [d posd]=min(sqrt((md.x(pos_shelf(i))-md.x(pos_GL)).^2+(md.y(pos_shelf(i))-md.y(pos_GL)).^2));
    5151
  • issm/trunk/src/m/model/averageconnectivity.m

    r1 r8298  
    66
    77nnz=0;
    8 for i=1:md.numberofgrids,
     8for i=1:md.numberofnodes,
    99        nnz=nnz+length(find(md.elements==i));
    1010end
    11 conn=nnz/md.numberofgrids;
     11conn=nnz/md.numberofnodes;
  • issm/trunk/src/m/model/averaging.m

    r3994 r8298  
    22%AVERAGING - smooths the input over the mesh
    33%
    4 %   This routine takes a list over the elements or the grids in input
    5 %   and return a list over the grids.
     4%   This routine takes a list over the elements or the nodes in input
     5%   and return a list over the nodes.
    66%   For each iterations it computes the average over each element (average
    7 %   of the vertices values) and then computes the average over each grid
    8 %   by taking the average of the element around a grid weighted by the
     7%   of the vertices values) and then computes the average over each node
     8%   by taking the average of the element around a node weighted by the
    99%   elements volume
    1010%
     
    1616%      pressure=averaging(md,md.pressure,0);
    1717
    18 if length(data)~=md.numberofelements & length(data)~=md.numberofgrids
     18if length(data)~=md.numberofelements & length(data)~=md.numberofnodes
    1919        error('averaging error message: data not supported yet');
    2020end
    2121
    2222%initialization
    23 weights=zeros(md.numberofgrids,1);
     23weights=zeros(md.numberofnodes,1);
    2424data=data(:);
    2525
    2626%load some variables (it is much faster if the variab;es are loaded from md once for all)
    2727index=md.elements;
    28 numberofgrids=md.numberofgrids;
     28numberofnodes=md.numberofnodes;
    2929numberofelements=md.numberofelements;
    3030
     
    4141linesize=rep*numberofelements;
    4242
    43 %update weights that holds the volume of all the element holding the grid i
    44 weights=sparse(line,ones(linesize,1),repmat(areas,rep,1),numberofgrids,1);
     43%update weights that holds the volume of all the element holding the node i
     44weights=sparse(line,ones(linesize,1),repmat(areas,rep,1),numberofnodes,1);
    4545
    4646%initialization
    4747if length(data)==numberofelements
    48         average_grid=sparse(line,ones(linesize,1),repmat(areas.*data,rep,1),numberofgrids,1);
    49         average_grid=average_grid./weights;
     48        average_node=sparse(line,ones(linesize,1),repmat(areas.*data,rep,1),numberofnodes,1);
     49        average_node=average_node./weights;
    5050else
    51         average_grid=data;
     51        average_node=data;
    5252end
    5353
    5454%loop over iteration
    5555for i=1:iterations
    56         average_el=average_grid(index)*summation;
    57         average_grid=sparse(line,ones(linesize,1),repmat(areas.*average_el,rep,1),numberofgrids,1);
    58         average_grid=average_grid./weights;
     56        average_el=average_node(index)*summation;
     57        average_node=sparse(line,ones(linesize,1),repmat(areas.*average_el,rep,1),numberofnodes,1);
     58        average_node=average_node./weights;
    5959end
    6060
    6161%return output as a full matrix (C code do not like sparse matrices)
    62 average=full(average_grid);
     62average=full(average_node);
  • issm/trunk/src/m/model/bamg.m

    r7095 r8298  
    2525%   - maxnbv      : maximum number of vertices used to allocate memory (default is 10^6)
    2626%   - maxsubdiv   : maximum subdivision of exisiting elements (default is 10)
    27 %   - metric      : matrix (numberofgrids x 3) used as a metric
     27%   - metric      : matrix (numberofnodes x 3) used as a metric
    2828%   - Metrictype  : 1 -> absolute error          c/(err coeff^2) * Abs(H)        (default)
    2929%                   2 -> relative error          c/(err coeff^2) * Abs(H)/max(s,cutoff*max(s))
     
    265265
    266266% Bamg Mesh parameters {{{1
    267 if (~exist(options,'domain') & md.numberofgrids~=0 & md.dim==2),
     267if (~exist(options,'domain') & md.numberofnodes~=0 & md.dim==2),
    268268
    269269        if isstruct(md.bamg),
    270270                bamg_mesh=bamgmesh(md.bamg.mesh);
    271271        else
    272                 bamg_mesh.Vertices=[md.x md.y ones(md.numberofgrids,1)];
     272                bamg_mesh.Vertices=[md.x md.y ones(md.numberofnodes,1)];
    273273                bamg_mesh.Triangles=[md.elements ones(md.numberofelements,1)];
    274274        end
     
    327327md.dim=2;
    328328md.numberofelements=size(md.elements,1);
    329 md.numberofgrids=length(md.x);
    330 md.z=zeros(md.numberofgrids,1);
    331 md.gridonbed=ones(md.numberofgrids,1);
    332 md.gridonwater=zeros(md.numberofgrids,1);
    333 md.gridonsurface=ones(md.numberofgrids,1);
     329md.numberofnodes=length(md.x);
     330md.z=zeros(md.numberofnodes,1);
     331md.nodeonbed=ones(md.numberofnodes,1);
     332md.nodeonwater=zeros(md.numberofnodes,1);
     333md.nodeonsurface=ones(md.numberofnodes,1);
    334334md.elementonbed=ones(md.numberofelements,1);
    335335md.elementonsurface=ones(md.numberofelements,1);
    336 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
     336md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
    337337md.counter=1;
    338338md.elementconnectivity=md.bamg.mesh.ElementConnectivity;
     
    340340
    341341%Check for orphan
    342 if any(~ismember(1:md.numberofgrids,sort(unique(md.elements(:)))))
     342if any(~ismember(1:md.numberofnodes,sort(unique(md.elements(:)))))
    343343        error('Output mesh has orphans. Decrease MaxCornerAngle to prevent outside points (ex: 0.01)');
    344344end
  • issm/trunk/src/m/model/bedslope.m

    r7649 r8298  
    88if (md.dim==2),
    99        numberofelements=md.numberofelements;
    10         numberofgrids=md.numberofgrids;
     10        numberofnodes=md.numberofnodes;
    1111        index=md.elements;
    1212        x=md.x; y=md.y; z=md.z;
    1313else
    1414        numberofelements=md.numberofelements2d;
    15         numberofgrids=md.numberofgrids2d;
     15        numberofnodes=md.numberofnodes2d;
    1616        index=md.elements2d;
    1717        x=md.x2d; y=md.y2d; z=md.z2d;
  • issm/trunk/src/m/model/collapse.m

    r6412 r8298  
    1818%Start with changing alle the fields from the 3d mesh
    1919
    20 %drag is limited to grids that are on the bedrock.
     20%drag is limited to nodes that are on the bedrock.
    2121md.drag_coefficient=project2d(md,md.drag_coefficient,1);
    2222
     
    4646md.elementonbed=ones(md.numberofelements2d,1);
    4747md.elementonsurface=ones(md.numberofelements2d,1);
    48 md.gridonbed=ones(md.numberofgrids2d,1);
    49 md.gridonsurface=ones(md.numberofgrids2d,1);
     48md.nodeonbed=ones(md.numberofnodes2d,1);
     49md.nodeonsurface=ones(md.numberofnodes2d,1);
    5050
    5151%elementstype
     
    5555        md.elements_type=project2d(md,md.elements_type,1);
    5656end     
    57 md.gridonhutter=project2d(md,md.gridonhutter,1);
    58 md.gridonmacayeal=project2d(md,md.gridonmacayeal,1);
    59 md.gridonpattyn=project2d(md,md.gridonpattyn,1);
    60 md.gridonstokes=project2d(md,md.gridonstokes,1);
     57md.nodeonhutter=project2d(md,md.nodeonhutter,1);
     58md.nodeonmacayeal=project2d(md,md.nodeonmacayeal,1);
     59md.nodeonpattyn=project2d(md,md.nodeonpattyn,1);
     60md.nodeonstokes=project2d(md,md.nodeonstokes,1);
    6161
    6262%boundary conditions
     
    8484
    8585%Collapse the mesh
    86 grids2d=md.numberofgrids2d;
     86nodes2d=md.numberofnodes2d;
    8787elements2d=md.numberofelements2d;
    8888
     
    9191md.thickness=project2d(md,md.thickness,1);
    9292md.bed=project2d(md,md.bed,1);
    93 md.gridonboundary=project2d(md,md.gridonboundary,1);
     93md.nodeonboundary=project2d(md,md.nodeonboundary,1);
    9494md.elementoniceshelf=project2d(md,md.elementoniceshelf,1);
    95 md.gridoniceshelf=project2d(md,md.gridoniceshelf,1);
     95md.nodeoniceshelf=project2d(md,md.nodeoniceshelf,1);
    9696md.elementonicesheet=project2d(md,md.elementonicesheet,1);
    97 md.gridonicesheet=project2d(md,md.gridonicesheet,1);
     97md.nodeonicesheet=project2d(md,md.nodeonicesheet,1);
    9898
    9999%Initialize with the 2d mesh
     
    101101md.y=md.y2d;
    102102md.z=md.z2d;
    103 md.numberofgrids=md.numberofgrids2d;
     103md.numberofnodes=md.numberofnodes2d;
    104104md.numberofelements=md.numberofelements2d;
    105105md.elements=md.elements2d;
    106106
    107 %Keep a trace of lower and upper grids
    108 md.lowergrids=NaN;
    109 md.uppergrids=NaN;
     107%Keep a trace of lower and upper nodes
     108md.lowernodes=NaN;
     109md.uppernodes=NaN;
    110110
    111111%Remove old mesh
     
    116116md.elements_type2d=md.elements_type;
    117117md.numberofelements2d=md.numberofelements;
    118 md.numberofgrids2d=md.numberofgrids;
     118md.numberofnodes2d=md.numberofnodes;
    119119md.numlayers=0;
    120120
  • issm/trunk/src/m/model/contourenvelope.m

    r5602 r8298  
    2323%Now, build the connectivity tables for this mesh.
    2424%Computing connectivity
    25 if size(md.nodeconnectivity,1)~=md.numberofgrids,
    26         md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     25if size(md.nodeconnectivity,1)~=md.numberofnodes,
     26        md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    2727end
    2828if size(md.elementconnectivity,1)~=md.numberofelements,
     
    6868                ord2=find(nods1(2)==md.elements(el1,:));
    6969
    70                 %swap segment grids if necessary
     70                %swap segment nodes if necessary
    7171                if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
    7272                        temp=segments(count,1);
  • issm/trunk/src/m/model/contourmassbalance.m

    r5024 r8298  
    1010        error('contourmassbalance error message: bad usage');
    1111end
    12 if ((length(md.vx)~=md.numberofgrids)|(length(md.vy)~=md.numberofgrids))
    13         error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.numberofgrids)])
     12if ((length(md.vx)~=md.numberofnodes)|(length(md.vy)~=md.numberofnodes))
     13        error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.numberofnodes)])
    1414end
    1515if ~exist(file),
  • issm/trunk/src/m/model/display/displaybc.m

    r5175 r8298  
    1212
    1313disp(sprintf('\n      geography:'));
    14 fielddisplay(md,'gridonboundary','grid on boundary flags list');
     14fielddisplay(md,'nodeonboundary','node on boundary flags list');
    1515fielddisplay(md,'elementoniceshelf','element on ice shelf flags list');
    16 fielddisplay(md,'gridoniceshelf','grid on ice shelf flags list');
     16fielddisplay(md,'nodeoniceshelf','node on ice shelf flags list');
    1717fielddisplay(md,'elementonicesheet','element on ice sheet flags list');
    18 fielddisplay(md,'gridonicesheet','grid on ice sheet flags list');
     18fielddisplay(md,'nodeonicesheet','node on ice sheet flags list');
    1919
    2020disp(sprintf('\n      diagnostic:'));
  • issm/trunk/src/m/model/display/displaymesh.m

    r4873 r8298  
    1515        disp(sprintf('\n      Elements and nodes of the original 2d mesh:'));
    1616        fielddisplay(md,'numberofelements2d','number of elements');
    17         fielddisplay(md,'numberofgrids2d','number of nodes');
    18         fielddisplay(md,'elements2d','index into (x,y,z), coordinates of the grids');
     17        fielddisplay(md,'numberofnodes2d','number of nodes');
     18        fielddisplay(md,'elements2d','index into (x,y,z), coordinates of the nodes');
    1919        fielddisplay(md,'elements_type2d','element types');
    2020        fielddisplay(md,'x2d','nodes x coordinate');
     
    2727end
    2828fielddisplay(md,'numberofelements','number of elements');
    29 fielddisplay(md,'numberofgrids','number of nodes');
    30 fielddisplay(md,'elements','index into (x,y,z), coordinates of the grids');
     29fielddisplay(md,'numberofnodes','number of nodes');
     30fielddisplay(md,'elements','index into (x,y,z), coordinates of the nodes');
    3131fielddisplay(md,'elements_type','element types');
    3232fielddisplay(md,'x','nodes x coordinate');
     
    4141fielddisplay(md,'bamg','Geometry and 2d mesh properties (if generated by Bamg)');
    4242fielddisplay(md,'penalties','penalties list');
    43 fielddisplay(md,'gridonbed','lower nodes flags list');
     43fielddisplay(md,'nodeonbed','lower nodes flags list');
    4444fielddisplay(md,'elementonbed','lower elements flags list');
    45 fielddisplay(md,'gridonsurface','upper nodes flags list');
     45fielddisplay(md,'nodeonsurface','upper nodes flags list');
    4646fielddisplay(md,'elementonsurface','upper elements flags list');
  • issm/trunk/src/m/model/display/displayparameters.m

    r5175 r8298  
    1919fielddisplay(md,'elementonbed','element on bed flags list');
    2020fielddisplay(md,'elementonsurface','element on surface flags list');
    21 fielddisplay(md,'gridonbed','grid on bed flags list');
    22 fielddisplay(md,'gridonsurface','grid on surface flags list');
     21fielddisplay(md,'nodeonbed','node on bed flags list');
     22fielddisplay(md,'nodeonsurface','node on surface flags list');
    2323
    2424disp(sprintf('\n      physical parameters:'));
  • issm/trunk/src/m/model/divergence.m

    r7649 r8298  
    77if (md.dim==2),
    88        numberofelements=md.numberofelements;
    9         numberofgrids=md.numberofgrids;
     9        numberofnodes=md.numberofnodes;
    1010        index=md.elements;
    1111        x=md.x; y=md.y; z=md.z;
    1212else
    1313        numberofelements=md.numberofelements2d;
    14         numberofgrids=md.numberofgrids2d;
     14        numberofnodes=md.numberofnodes2d;
    1515        index=md.elements2d;
    1616        x=md.x2d; y=md.y2d; z=md.z2d;
  • issm/trunk/src/m/model/extrude.m

    r8235 r8298  
    7575x3d=[];
    7676y3d=[];
    77 z3d=[];  %the lower grid is on the bed
    78 thickness3d=md.thickness; %thickness and bed for these grids
     77z3d=[];  %the lower node is on the bed
     78thickness3d=md.thickness; %thickness and bed for these nodes
    7979bed3d=md.bed;
    8080
     
    8383        x3d=[x3d; md.x];
    8484        y3d=[y3d; md.y];
    85         %grids are distributed between bed and surface accordingly to the given exponent
     85        %nodes are distributed between bed and surface accordingly to the given exponent
    8686        z3d=[z3d; bed3d+thickness3d*extrusionlist(i)];
    8787end
    88 number_grids3d=size(x3d,1); %number of 3d grids for the non extruded part of the mesh
     88number_nodes3d=size(x3d,1); %number of 3d nodes for the non extruded part of the mesh
    8989
    9090%Extrude elements
    9191elements3d=[];
    9292for i=1:numlayers-1,
    93         elements3d=[elements3d;[md.elements+(i-1)*md.numberofgrids md.elements+i*md.numberofgrids]]; %Create the elements of the 3d mesh for the non extruded part
    94 end
    95 number_el3d=size(elements3d,1); %number of 3d grids for the non extruded part of the mesh
    96 
    97 %Keep a trace of lower and upper grids
    98 lowergrids=NaN*ones(number_grids3d,1);
    99 uppergrids=NaN*ones(number_grids3d,1);
    100 lowergrids(md.numberofgrids+1:end)=1:(numlayers-1)*md.numberofgrids;
    101 uppergrids(1:(numlayers-1)*md.numberofgrids)=md.numberofgrids+1:number_grids3d;
    102 md.lowergrids=lowergrids;
    103 md.uppergrids=uppergrids;
     93        elements3d=[elements3d;[md.elements+(i-1)*md.numberofnodes md.elements+i*md.numberofnodes]]; %Create the elements of the 3d mesh for the non extruded part
     94end
     95number_el3d=size(elements3d,1); %number of 3d nodes for the non extruded part of the mesh
     96
     97%Keep a trace of lower and upper nodes
     98lowernodes=NaN*ones(number_nodes3d,1);
     99uppernodes=NaN*ones(number_nodes3d,1);
     100lowernodes(md.numberofnodes+1:end)=1:(numlayers-1)*md.numberofnodes;
     101uppernodes(1:(numlayers-1)*md.numberofnodes)=md.numberofnodes+1:number_nodes3d;
     102md.lowernodes=lowernodes;
     103md.uppernodes=uppernodes;
    104104
    105105%same for lower and upper elements
     
    119119md.vertices_type2d=md.vertices_type;
    120120md.numberofelements2d=md.numberofelements;
    121 md.numberofgrids2d=md.numberofgrids;
     121md.numberofnodes2d=md.numberofnodes;
    122122
    123123%Update mesh type
     
    130130md.z=z3d;
    131131md.numberofelements=number_el3d;
    132 md.numberofgrids=number_grids3d;
     132md.numberofnodes=number_nodes3d;
    133133md.numlayers=numlayers;
    134134
    135135%Ok, now deal with the other fields from the 2d mesh:
    136136
    137 %drag_coefficient is limited to grids that are on the bedrock.
     137%drag_coefficient is limited to nodes that are on the bedrock.
    138138md.drag_coefficient=project3d(md,md.drag_coefficient,'node',1);
    139139
     
    168168md.elementonbed=project3d(md,ones(md.numberofelements2d,1),'element',1);
    169169md.elementonsurface=project3d(md,ones(md.numberofelements2d,1),'element',md.numlayers-1);
    170 md.gridonbed=project3d(md,ones(md.numberofgrids2d,1),'node',1);
    171 md.gridonsurface=project3d(md,ones(md.numberofgrids2d,1),'node',md.numlayers);
     170md.nodeonbed=project3d(md,ones(md.numberofnodes2d,1),'node',1);
     171md.nodeonsurface=project3d(md,ones(md.numberofnodes2d,1),'node',md.numlayers);
    172172
    173173%elementstype
     
    176176        md.elements_type=zeros(number_el3d,1);
    177177        md.elements_type=project3d(md,oldelements_type,'element');
    178         md.gridonhutter=project3d(md,md.gridonhutter,'node');
    179         md.gridonmacayeal=project3d(md,md.gridonmacayeal,'node');
    180         md.gridonpattyn=project3d(md,md.gridonpattyn,'node');
    181         md.gridonstokes=project3d(md,md.gridonstokes,'node');
     178        md.nodeonhutter=project3d(md,md.nodeonhutter,'node');
     179        md.nodeonmacayeal=project3d(md,md.nodeonmacayeal,'node');
     180        md.nodeonpattyn=project3d(md,md.nodeonpattyn,'node');
     181        md.nodeonstokes=project3d(md,md.nodeonstokes,'node');
    182182end
    183183
     
    185185if ~isnan(md.vertices_type)
    186186        oldvertices_type=md.vertices_type2d;
    187         md.vertices_type=zeros(number_grids3d,1);
     187        md.vertices_type=zeros(number_nodes3d,1);
    188188        md.vertices_type=project3d(md,oldvertices_type,'node');
    189189end
     
    195195md.diagnostic_ref=project3d(md,md.diagnostic_ref,'node');
    196196
    197 %in 3d, pressureload: [grid1 grid2 grid3 grid4 element]
    198 pressureload_layer1=[md.pressureload(:,1:2)  md.pressureload(:,2)+md.numberofgrids2d  md.pressureload(:,1)+md.numberofgrids2d  md.pressureload(:,3:4)]; %Add two columns on the first layer
     197%in 3d, pressureload: [node1 node2 node3 node4 element]
     198pressureload_layer1=[md.pressureload(:,1:2)  md.pressureload(:,2)+md.numberofnodes2d  md.pressureload(:,1)+md.numberofnodes2d  md.pressureload(:,3:4)]; %Add two columns on the first layer
    199199pressureload=[];
    200200for i=1:numlayers-1,
    201         pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.numberofgrids2d pressureload_layer1(:,5)+(i-1)*md.numberofelements2d pressureload_layer1(:,6)];
     201        pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.numberofnodes2d pressureload_layer1(:,5)+(i-1)*md.numberofelements2d pressureload_layer1(:,6)];
    202202end
    203203md.pressureload=pressureload;
     
    220220md.thickness=project3d(md,md.thickness,'node');
    221221md.bed=project3d(md,md.bed,'node');
    222 md.gridonboundary=project3d(md,md.gridonboundary,'node');
     222md.nodeonboundary=project3d(md,md.nodeonboundary,'node');
    223223md.elementoniceshelf=project3d(md,md.elementoniceshelf,'element');
    224 md.gridoniceshelf=project3d(md,md.gridoniceshelf,'node');
     224md.nodeoniceshelf=project3d(md,md.nodeoniceshelf,'node');
    225225md.elementonicesheet=project3d(md,md.elementonicesheet,'element');
    226 md.gridonicesheet=project3d(md,md.gridonicesheet,'node');
     226md.nodeonicesheet=project3d(md,md.nodeonicesheet,'node');
    227227md.elementonwater=project3d(md,md.elementonwater,'element');
    228 md.gridonwater=project3d(md,md.gridonwater,'node');
     228md.nodeonwater=project3d(md,md.nodeonwater,'node');
    229229if ~isnan(md.weights),md.weights=project3d(md,md.weights,'node');end;
    230230
  • issm/trunk/src/m/model/geography.m

    r7328 r8298  
    22%GEOGRAPHY - establish boundaries between grounded and floating ice.
    33%
    4 %   By default, ice is considered grounded. The contour iceshelfname defines grids
    5 %   for which ice is floating. The contour icesheetname defines grids inside an iceshelf,
     4%   By default, ice is considered grounded. The contour iceshelfname defines nodes
     5%   for which ice is floating. The contour icesheetname defines nodes inside an iceshelf,
    66%   that are grounded (ie: ice rises, islands, etc ...)
    77%   All input files are in the Argus format (extension .exp).
     
    3232elements=md.elements;
    3333
    34 %Assign elementoniceshelf, elementonicesheet, gridonicesheet and gridoniceshelf. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{1
     34%Assign elementoniceshelf, elementonicesheet, nodeonicesheet and nodeoniceshelf. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{1
    3535elementoniceshelf=FlagElements(md,iceshelfname);
    3636elementonicesheet=FlagElements(md,icesheetname);
    3737
    38 %Because icesheet grids and elements can be included into an iceshelf, we need to update. Remember, all the previous
     38%Because icesheet nodes and elements can be included into an iceshelf, we need to update. Remember, all the previous
    3939%arrays come from domain outlines that can intersect one another:
    4040elementoniceshelf=double((elementoniceshelf & ~elementonicesheet));
    4141elementonicesheet=double(~elementoniceshelf);
    4242
    43 %the order here is important. we choose gridonicesheet as default on the grounding line.
    44 gridoniceshelf=zeros(md.numberofgrids,1);
    45 gridonicesheet=zeros(md.numberofgrids,1);
    46 gridonicesheet(md.elements(find(elementonicesheet),:))=1;
    47 gridoniceshelf(find(~gridonicesheet))=1;
     43%the order here is important. we choose nodeonicesheet as default on the grounding line.
     44nodeoniceshelf=zeros(md.numberofnodes,1);
     45nodeonicesheet=zeros(md.numberofnodes,1);
     46nodeonicesheet(md.elements(find(elementonicesheet),:))=1;
     47nodeoniceshelf(find(~nodeonicesheet))=1;
    4848%}}}
    4949
     
    5252
    5353md.elementoniceshelf=elementoniceshelf;
    54 md.gridoniceshelf=gridoniceshelf;
     54md.nodeoniceshelf=nodeoniceshelf;
    5555
    5656md.elementonicesheet=elementonicesheet;
    57 md.gridonicesheet=gridonicesheet;
     57md.nodeonicesheet=nodeonicesheet;
    5858
    59 md.gridonwater=zeros(md.numberofgrids,1);
     59md.nodeonwater=zeros(md.numberofnodes,1);
    6060md.elementonwater=zeros(md.numberofelements,1);
    6161
  • issm/trunk/src/m/model/geography2.m

    r5024 r8298  
    1313elements=md.elements;
    1414
    15 %recover elements and grids on land.
     15%recover elements and nodes on land.
    1616if ischar(landname),
    17         [gridonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2);
     17        [nodeonland,elementonland]=ContourToMesh(elements,x,y,landname,'element and node',2);
    1818elseif isfloat(landname),
    1919        if size(landname,1)~=md.numberofelements,
     
    2121        end
    2222        elementonland=landname;
    23         gridonland=zeros(md.numberofgrids,1);
    24         gridonland(md.elements(find(elementonland),:))=1;
     23        nodeonland=zeros(md.numberofnodes,1);
     24        nodeonland(md.elements(find(elementonland),:))=1;
    2525else
    2626        error('Invalid area option option');
     
    2828
    2929%Now, build the connectivity tables for this mesh.
    30 if size(md.nodeconnectivity,1)~=md.numberofgrids,
    31         md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     30if size(md.nodeconnectivity,1)~=md.numberofnodes,
     31        md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    3232end
    3333if size(md.elementconnectivity,1)~=md.numberofelements,
     
    3535end
    3636
    37 %any element with 3 grids on land should be on land:
     37%any element with 3 nodes on land should be on land:
    3838elementsonwater=find(~elementonland);
    39 wrongelements=elementsonwater(find(( gridonland(md.elements(elementsonwater,1)) + gridonland(md.elements(elementsonwater,2)) + gridonland(md.elements(elementsonwater,3)) ...
     39wrongelements=elementsonwater(find(( nodeonland(md.elements(elementsonwater,1)) + nodeonland(md.elements(elementsonwater,2)) + nodeonland(md.elements(elementsonwater,3)) ...
    4040                  )==3));
    4141elementonland(wrongelements)=1;
     
    6969elementonland(landelements)=1;
    7070
    71 %recover arrays of ice shelf grids and elements, and ice sheet grids and elements.
     71%recover arrays of ice shelf nodes and elements, and ice sheet nodes and elements.
    7272elementoniceshelf=FlagElements(md,iceshelfname);
    7373elementonicesheet=FlagElements(md,icesheetname);
    7474
    75 %Because icesheet grids and elements can be included into an iceshelf, we need to update. Remember, all the previous
     75%Because icesheet nodes and elements can be included into an iceshelf, we need to update. Remember, all the previous
    7676%arrays come from domain outlines that can intersect one another:
    77 gridoniceshelf=zeros(md.numberofgrids,1);
    78 gridonicesheet=zeros(md.numberofgrids,1);
     77nodeoniceshelf=zeros(md.numberofnodes,1);
     78nodeonicesheet=zeros(md.numberofnodes,1);
    7979elementoniceshelf=double((elementoniceshelf & ~elementonicesheet));
    8080elementonicesheet=double(~elementoniceshelf);
    81 gridoniceshelf(md.elements(find(elementoniceshelf),:))=1;
    82 gridonicesheet(md.elements(find(elementonicesheet),:))=1;
     81nodeoniceshelf(md.elements(find(elementoniceshelf),:))=1;
     82nodeonicesheet(md.elements(find(elementonicesheet),:))=1;
    8383
    8484%now correct, so that none of the iceshelf and icesheet elements and nodes are in the water.
     
    8787elementonicesheet(pos)=0;
    8888
    89 pos=find(~gridonland);
    90 gridoniceshelf(pos)=0;
    91 gridonicesheet(pos)=0;
     89pos=find(~nodeonland);
     90nodeoniceshelf(pos)=0;
     91nodeonicesheet(pos)=0;
    9292
    93 %create gridonwater and elementonwater:
    94 gridonwater=double(~gridonland);
     93%create nodeonwater and elementonwater:
     94nodeonwater=double(~nodeonland);
    9595elementonwater=double(~elementonland);
    9696
    9797%correct for islands:
    98 gridoniceshelf=double(gridoniceshelf & ~gridonicesheet);
     98nodeoniceshelf=double(nodeoniceshelf & ~nodeonicesheet);
    9999elementoniceshelf=double(elementoniceshelf & ~elementonicesheet);
    100100
    101101%now, icesheets are everything except iceshelves and water
    102 gridonicesheet=double(~gridoniceshelf & ~gridonwater);
     102nodeonicesheet=double(~nodeoniceshelf & ~nodeonwater);
    103103elementonicesheet=double(~elementoniceshelf & ~elementonwater);
    104104
     
    123123
    124124%some final checks:
    125 %check that no grid thinks it's on an ice shelf or ice sheet, and lies actually in the middle of the water.
    126 gridsgrounded=find(~gridonwater);
     125%check that no node thinks it's on an ice shelf or ice sheet, and lies actually in the middle of the water.
     126nodesgrounded=find(~nodeonwater);
    127127lengthconnectivity=size(md.nodeconnectivity,2);
    128 groundedcounters=md.nodeconnectivity(gridsgrounded,lengthconnectivity);
    129 groundedconnectivity=md.nodeconnectivity(gridsgrounded,1:lengthconnectivity-1);
     128groundedcounters=md.nodeconnectivity(nodesgrounded,lengthconnectivity);
     129groundedconnectivity=md.nodeconnectivity(nodesgrounded,1:lengthconnectivity-1);
    130130pos=find(groundedconnectivity);
    131131groundedconnectivity(pos)=elementonwater(groundedconnectivity(pos));
    132132groundedsum=sum(groundedconnectivity,2);
    133133errorflags=find(groundedsum==groundedcounters);
    134 errorgrids=gridsgrounded(errorflags);
     134errornodes=nodesgrounded(errorflags);
    135135
    136 gridonwater(errorgrids)=1;
    137 gridonicesheet(errorgrids)=0;
    138 gridoniceshelf(errorgrids)=0;
     136nodeonwater(errornodes)=1;
     137nodeonicesheet(errornodes)=0;
     138nodeoniceshelf(errornodes)=0;
    139139
    140140%Return:
    141 md.gridoniceshelf=gridoniceshelf;
     141md.nodeoniceshelf=nodeoniceshelf;
    142142md.elementoniceshelf=elementoniceshelf;
    143143
    144 md.gridonwater=gridonwater;
     144md.nodeonwater=nodeonwater;
    145145md.elementonwater=elementonwater;
    146146
    147 md.gridonicesheet=gridonicesheet;
     147md.nodeonicesheet=nodeonicesheet;
    148148md.elementonicesheet=elementonicesheet;
    149149
  • issm/trunk/src/m/model/ismodelselfconsistent.m

    r8287 r8298  
    4242        checksize(md,fields,[md.numberofelements 6]);
    4343end
    44 if any(~ismember(1:md.numberofgrids,sort(unique(md.elements(:)))));
     44if any(~ismember(1:md.numberofnodes,sort(unique(md.elements(:)))));
    4545        error('orphan nodes have been found. Check the mesh');
    4646end
     
    7070%}}}
    7171%NO NAN {{{1
    72 fields={'numberofelements','numberofgrids','x','y','z','drag_coefficient','drag_type','drag_p','drag_q',...
     72fields={'numberofelements','numberofnodes','x','y','z','drag_coefficient','drag_type','drag_p','drag_q',...
    7373        'rho_ice','rho_water','rheology_B','elementoniceshelf','surface','thickness','bed','g','lowmem','sparsity','nsteps','maxiter',...
    74         'tolx','eps_res','max_nonlinear_iterations','rheology_n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec','elementconnectivity'};
     74        'tolx','eps_res','max_nonlinear_iterations','rheology_n','nodeonbed','nodeonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec','elementconnectivity'};
    7575checknan(md,fields);
    7676%}}}}
    7777%FIELDS >= 0 {{{1
    78 fields={'numberofelements','numberofgrids','elements','drag_coefficient','drag_type','drag_p','drag_q',...
     78fields={'numberofelements','numberofnodes','elements','drag_coefficient','drag_type','drag_p','drag_q',...
    7979        'rho_ice','rho_water','rheology_B','elementoniceshelf','thickness','g','eps_res','max_nonlinear_iterations','eps_rel','eps_abs','nsteps','maxiter','tolx',...
    80         'sparsity','lowmem','rheology_n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'};
     80        'sparsity','lowmem','rheology_n','nodeonbed','nodeonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'};
    8181checkgreater(md,fields,0);
    8282%}}}
    8383%FIELDS > 0 {{{1
    84 fields={'numberofelements','numberofgrids','elements','drag_type','drag_p',...
     84fields={'numberofelements','numberofnodes','elements','drag_type','drag_p',...
    8585        'rho_ice','rho_water','rheology_B','thickness','g','max_nonlinear_iterations','eps_res','eps_rel','eps_abs','maxiter','tolx',...
    8686        'sparsity','deltaH','DeltaH','timeacc','timedec'};
     
    9292%}}}
    9393%SIZE NUMBEROFGRIDS {{{1
    94 fields={'x','y','z','rheology_B','drag_coefficient','melting_rate','accumulation_rate','surface','thickness','bed','gridonbed','gridonsurface'};
    95 checksize(md,fields,[md.numberofgrids 1]);
     94fields={'x','y','z','rheology_B','drag_coefficient','melting_rate','accumulation_rate','surface','thickness','bed','nodeonbed','nodeonsurface'};
     95checksize(md,fields,[md.numberofnodes 1]);
    9696%}}}
    9797%OTHER SIZES {{{1
    9898fields={'spcvelocity','diagnostic_ref'};
    99 checksize(md,fields,[md.numberofgrids 6]);
     99checksize(md,fields,[md.numberofnodes 6]);
    100100%}}}
    101101%THICKNESS = SURFACE - BED {{{1
     
    188188        checksize(md,fields,[md.nsteps num_controls]);
    189189        fields={'cm_min','cm_max'};
    190         checksize(md,fields,[md.numberofgrids num_controls]);
     190        checksize(md,fields,[md.numberofnodes num_controls]);
    191191
    192192        %RESPONSES
     
    195195        %WEIGHTS
    196196        fields={'weights'};
    197         checksize(md,fields,[md.numberofgrids 1]);
     197        checksize(md,fields,[md.numberofnodes 1]);
    198198        checkgreater(md,fields,0);
    199199
     
    201201        if md.solution_type==BalancethicknessSolutionEnum
    202202                fields={'thickness_obs'};
    203                 checksize(md,fields,[md.numberofgrids 1]);
     203                checksize(md,fields,[md.numberofnodes 1]);
    204204                checknan(md,fields);
    205205        else
    206206                fields={'vx_obs','vy_obs'};
    207                 checksize(md,fields,[md.numberofgrids 1]);
     207                checksize(md,fields,[md.numberofnodes 1]);
    208208                checknan(md,fields);
    209209        end
     
    213213                pos=find(md.thickness<=0);
    214214                if any(find(md.spcthickness(pos,1)==0)),
    215                         error(['model not consistent: model ' md.name ' has some grids with 0 thickness']);
     215                        error(['model not consistent: model ' md.name ' has some nodes with 0 thickness']);
    216216                end
    217217        end
     
    228228        end
    229229        if ~isempty(md.part),
    230                 if numel(md.part)~=md.numberofgrids,
    231                         error(['model not consistent: user supplied partition for qmu analysis should have size md.numberofgrids x 1 ']);
    232                 end
    233                 if find(md.part)>=md.numberofgrids,
     230                if numel(md.part)~=md.numberofnodes,
     231                        error(['model not consistent: user supplied partition for qmu analysis should have size md.numberofnodes x 1 ']);
     232                end
     233                if find(md.part)>=md.numberofnodes,
    234234                        error(['model not consistent: user supplied partition should be indexed from 0 (c-convention)']);
    235235                end
     
    237237                        error(['model not consistent: partition vector not indexed from 0 on']);
    238238                end
    239                 if max(md.part)>=md.numberofgrids,
    240                         error(['model not consistent: partition vector cannot have maximum index larger than number of grids']);
     239                if max(md.part)>=md.numberofnodes,
     240                        error(['model not consistent: partition vector cannot have maximum index larger than number of nodes']);
    241241                end
    242242                if ~isempty(find(md.part<0)),
     
    319319        end
    320320        %   probably going to need some checks on fm_flightreqs here
    321         if (numel(md.fm_criterion) ~= md.numberofgrids) && (numel(md.fm_criterion) ~= md.numberofelements)
    322                 error(['model not consistent: fm_criterion vector must have number of nodes (' int2str(md.numberofgrids) ') or elements (' int2str(md.numberofelements) ') values, not ' int2str(numel(md.fm_criterion)) ' values.']);
     321        if (numel(md.fm_criterion) ~= md.numberofnodes) && (numel(md.fm_criterion) ~= md.numberofelements)
     322                error(['model not consistent: fm_criterion vector must have number of nodes (' int2str(md.numberofnodes) ') or elements (' int2str(md.numberofelements) ') values, not ' int2str(numel(md.fm_criterion)) ' values.']);
    323323        end
    324324end
     
    343343                        %SINGULAR
    344344                        if ~any(sum(md.spcvelocity(:,1:2),2)==2),
    345                                 error(['model not consistent: model ' md.name ' is not well posed (singular). You need at least one grid with fixed velocity!'])
     345                                error(['model not consistent: model ' md.name ' is not well posed (singular). You need at least one node with fixed velocity!'])
    346346                        end
    347347
     
    350350                                pos=find(md.thickness<=0);
    351351                                if any(find(md.spcthickness(pos,1)==0)),
    352                                         error(['model not consistent: model ' md.name ' has some grids with 0 thickness']);
     352                                        error(['model not consistent: model ' md.name ' has some nodes with 0 thickness']);
    353353                                end
    354354                        end
     
    369369                        end
    370370                        %CHECK THAT ROTATION IS IN THE (X,Y) PLANE FOR 2D MODELS
    371                         if any(md.gridonmacayeal),
    372                                 pos=find(sum(isnan(md.diagnostic_ref),2)==0  & md.gridonmacayeal);
     371                        if any(md.nodeonmacayeal),
     372                                pos=find(sum(isnan(md.diagnostic_ref),2)==0  & md.nodeonmacayeal);
    373373                                if any(md.diagnostic_ref(pos,3:5)~=0);
    374                                         error(['model not consistent: model ' md.name ' has problem with rotated spc. The rotation should be in the (x,y) plane for 2D diagnostic models (gridonmacayeal)']);
     374                                        error(['model not consistent: model ' md.name ' has problem with rotated spc. The rotation should be in the (x,y) plane for 2D diagnostic models (nodeonmacayeal)']);
    375375                                end
    376376                        end
     
    380380                                fields={'vx','vy'};
    381381                                checknan(md,fields);
    382                                 checksize(md,fields,[md.numberofgrids 1]);
     382                                checksize(md,fields,[md.numberofnodes 1]);
    383383                        end
    384384
     
    400400                        %Check the size of verticess_type
    401401                        fields={'vertices_type'};
    402                         checksize(md,fields,[md.numberofgrids 1]);
     402                        checksize(md,fields,[md.numberofnodes 1]);
    403403                        %Check the values of vertices_type
    404404                        checkvalues(md,{'vertices_type'},[MacAyealApproximationEnum() HutterApproximationEnum() PattynApproximationEnum()...
     
    436436                        %INITIAL VELOCITIES
    437437                        fields={'vx','vy'};
    438                         checksize(md,fields,[md.numberofgrids 1]);
     438                        checksize(md,fields,[md.numberofnodes 1]);
    439439                        checknan(md,fields);
    440440
     
    460460                        %VELOCITIES AND PRESSURE
    461461                        fields={'vx','vy','vz','pressure','geothermalflux'};
    462                         checksize(md,fields,[md.numberofgrids 1]);
     462                        checksize(md,fields,[md.numberofnodes 1]);
    463463                        checknan(md,fields);
    464464
     
    472472                                %INITIAL TEMPERATURE, MELTING AND ACCUMULATION
    473473                                fields={'temperature','accumulation_rate','melting_rate'};
    474                                 checksize(md,fields,[md.numberofgrids 1]);
     474                                checksize(md,fields,[md.numberofnodes 1]);
    475475                                checknan(md,fields);
    476476
     
    488488                        %VELOCITIES MELTING AND ACCUMULATION
    489489                        fields={'vx','vy','accumulation_rate','melting_rate','dhdt'};
    490                         checksize(md,fields,[md.numberofgrids 1]);
     490                        checksize(md,fields,[md.numberofnodes 1]);
    491491                        checknan(md,fields);
    492492
    493493                        %SPC                             
    494494                        %       if ~md.prognostic_DG,
    495                         %               if any(md.spcthickness(find(md.gridonboundary))~=1),             
     495                        %               if any(md.spcthickness(find(md.nodeonboundary))~=1),             
    496496                        %                       error(['model not consistent: model ' md.name ' should have all the nodes on boundary constrained in field spcthickness']);                     
    497497                        %               end
     
    507507                        %VELOCITIES MELTING AND ACCUMULATION
    508508                        fields={'vx','vy','accumulation_rate','melting_rate'};
    509                         checksize(md,fields,[md.numberofgrids 1]);
     509                        checksize(md,fields,[md.numberofnodes 1]);
    510510                        checknan(md,fields);
    511511
    512512                        %SPC
    513                         if any(md.spcvelocity(find(md.gridonboundary),[1:2])~=1),
     513                        if any(md.spcvelocity(find(md.nodeonboundary),[1:2])~=1),
    514514                                error(['model not consistent: model ' md.name ' should have all the nodes on boundary constrained in field spcvelocity']);
    515515                        end
     
    557557                                if strcmp(fields{i},'cm_min'),
    558558                                        disp('!!! ');
    559                                         disp('!!! WARNING: cm_min must now be of size [md.numberofgrids x 1]. Update your parameter file as follows:');
     559                                        disp('!!! WARNING: cm_min must now be of size [md.numberofnodes x 1]. Update your parameter file as follows:');
    560560                                        disp('!!! ');
    561                                         disp('!!! md.cm_min=md.cm_min*ones(md.numberofgrids,1);');
     561                                        disp('!!! md.cm_min=md.cm_min*ones(md.numberofnodes,1);');
    562562                                        disp('!!! ');
    563563                                end
     
    565565                                if strcmp(fields{i},'cm_max'),
    566566                                        disp('!!! ');
    567                                         disp('!!! WARNING: cm_max must now be of size [md.numberofgrids x 1]. Update your parameter file as follows:');
     567                                        disp('!!! WARNING: cm_max must now be of size [md.numberofnodes x 1]. Update your parameter file as follows:');
    568568                                        disp('!!! ');
    569                                         disp('!!! md.cm_max=md.cm_max*ones(md.numberofgrids,1);');
     569                                        disp('!!! md.cm_max=md.cm_max*ones(md.numberofnodes,1);');
    570570                                        disp('!!! ');
    571571                                end
  • issm/trunk/src/m/model/isresultconsistent.m

    r7629 r8298  
    3737
    3838        %check size
    39         if ~testsize(md,fields1,md.numberofgrids),
     39        if ~testsize(md,fields1,md.numberofnodes),
    4040                bool=0; return
    4141        end
     
    6666
    6767                %check size
    68                 if ~testsize(md,fields1,md.numberofgrids),
     68                if ~testsize(md,fields1,md.numberofnodes),
    6969                        bool=0; return
    7070                end
     
    101101                fields={'results.DiagnosticAnalysis.gradient'};
    102102                %check size
    103                 if ~testsize(md,fields,md.numberofgrids),
     103                if ~testsize(md,fields,md.numberofnodes),
    104104                        bool=0; return
    105105                end
     
    126126
    127127                %check size
    128                 if ~testsize(md,fields1,md.numberofgrids),
    129                         bool=0; return
    130                 end
    131 
    132                 %no NAN
    133                 if ~testnan(md,fields1,md.numberofgrids),
    134                         bool=0; return
    135                 end
    136 
    137                 %check value is real
    138                 if ~testreal(md,fields1,md.numberofgrids),
     128                if ~testsize(md,fields1,md.numberofnodes),
     129                        bool=0; return
     130                end
     131
     132                %no NAN
     133                if ~testnan(md,fields1,md.numberofnodes),
     134                        bool=0; return
     135                end
     136
     137                %check value is real
     138                if ~testreal(md,fields1,md.numberofnodes),
    139139                        bool=0; return
    140140                end
    141141
    142142                %check value>=0
    143                 if ~testpositive(md,fields2,md.numberofgrids),
     143                if ~testpositive(md,fields2,md.numberofnodes),
    144144                        bool=0; return
    145145                end
    146146
    147147                %check melting (<=0 via penalties)
    148                 if any(abs(md.results.ThermalAnalysis(iter).melting(md.numberofgrids2d+1:end))>tolerance)
     148                if any(abs(md.results.ThermalAnalysis(iter).melting(md.numberofnodes2d+1:end))>tolerance)
    149149                        disp(['''thermal'' result not consistent: increase penalty_melting (negative melting)']);
    150150                        bool=0; return;
     
    175175
    176176                %check size
    177                 if ~testsize(md,fields1,md.numberofgrids),
    178                         bool=0; return
    179                 end
    180 
    181                 %no NAN
    182                 if ~testnan(md,fields1,md.numberofgrids),
    183                         bool=0; return
    184                 end
    185 
    186                 %check value is real
    187                 if ~testreal(md,fields1,md.numberofgrids),
     177                if ~testsize(md,fields1,md.numberofnodes),
     178                        bool=0; return
     179                end
     180
     181                %no NAN
     182                if ~testnan(md,fields1,md.numberofnodes),
     183                        bool=0; return
     184                end
     185
     186                %check value is real
     187                if ~testreal(md,fields1,md.numberofnodes),
    188188                        bool=0; return
    189189                end
    190190
    191191                %check value>=0
    192                 if ~testpositive(md,fields2,md.numberofgrids),
     192                if ~testpositive(md,fields2,md.numberofnodes),
    193193                        bool=0; return
    194194                end
     
    196196                %check melting (<=0 via penalties)
    197197                if (md.dim==3),
    198                         if any(abs(md.results.TransientAnalysis(iter).melting(md.numberofgrids2d+1:end))>tolerance)
     198                        if any(abs(md.results.TransientAnalysis(iter).melting(md.numberofnodes2d+1:end))>tolerance)
    199199                                disp(['''thermal'' result not consistent: increase penalty_melting (negative melting)']);
    200200                                bool=0; return;
     
    210210        for i=1:length(fields),
    211211                if length(eval(['md.' fields{i}]))~=fieldsize
    212                         disp(['results not consistent: field ' fields{i} ' size should be ' num2str(md.numberofgrids)]);
     212                        disp(['results not consistent: field ' fields{i} ' size should be ' num2str(md.numberofnodes)]);
    213213                        bool=0; return;
    214214                end
  • issm/trunk/src/m/model/marshall.m

    r8250 r8298  
    2323
    2424WriteData(fid,md.dim,'Integer','dim');
    25 WriteData(fid,md.numberofgrids,'Integer','numberofgrids');
     25WriteData(fid,md.numberofnodes,'Integer','numberofnodes');
    2626WriteData(fid,md.numberofelements,'Integer','numberofelements');
    2727WriteData(fid,md.x,'Mat','x');
     
    3232WriteData(fid,md.elements_type,'Mat','elements_type');
    3333WriteData(fid,md.vertices_type,'Mat','vertices_type');
    34 WriteData(fid,md.gridonhutter,'Mat','gridonhutter');
    35 WriteData(fid,md.gridonmacayeal,'Mat','gridonmacayeal');
     34WriteData(fid,md.nodeonhutter,'Mat','nodeonhutter');
     35WriteData(fid,md.nodeonmacayeal,'Mat','nodeonmacayeal');
    3636
    3737if md.dim==3,
    3838        WriteData(fid,md.numberofelements2d,'Integer','numberofelements2d');
    39         WriteData(fid,md.numberofgrids2d,'Integer','numberofgrids2d');
     39        WriteData(fid,md.numberofnodes2d,'Integer','numberofnodes2d');
    4040        WriteData(fid,md.elements2d,'Mat','elements2d');
    4141        WriteData(fid,md.numlayers,'Integer','numlayers');
    42         WriteData(fid,md.gridonpattyn,'Mat','gridonpattyn');
     42        WriteData(fid,md.nodeonpattyn,'Mat','nodeonpattyn');
    4343end
    4444WriteData(fid,md.upperelements,'Mat','upperelements');
     
    4646WriteData(fid,md.elementonbed,'Mat','elementonbed');
    4747WriteData(fid,md.elementonsurface,'Mat','elementonsurface');
    48 WriteData(fid,md.gridonbed,'Mat','gridonbed');
    49 WriteData(fid,md.gridonsurface,'Mat','gridonsurface');
    50 WriteData(fid,md.gridonstokes,'Mat','gridonstokes');
     48WriteData(fid,md.nodeonbed,'Mat','nodeonbed');
     49WriteData(fid,md.nodeonsurface,'Mat','nodeonsurface');
     50WriteData(fid,md.nodeonstokes,'Mat','nodeonstokes');
    5151WriteData(fid,md.borderstokes,'Mat','borderstokes');
    5252
     
    7575WriteData(fid,md.elementoniceshelf,'Mat','elementoniceshelf');
    7676WriteData(fid,md.elementonwater,'Mat','elementonwater');
    77 WriteData(fid,md.gridonicesheet,'Mat','gridonicesheet');
    78 WriteData(fid,md.gridoniceshelf,'Mat','gridoniceshelf');
    79 WriteData(fid,md.gridonwater,'Mat','gridonwater');
     77WriteData(fid,md.nodeonicesheet,'Mat','nodeonicesheet');
     78WriteData(fid,md.nodeoniceshelf,'Mat','nodeoniceshelf');
     79WriteData(fid,md.nodeonwater,'Mat','nodeonwater');
    8080
    8181WriteData(fid,md.spcvelocity,'Mat','spcvelocity');
  • issm/trunk/src/m/model/mechanicalproperties.m

    r6286 r8298  
    1414
    1515%some checks
    16 if length(vx)~=md.numberofgrids | length(vy)~=md.numberofgrids,
    17         error(['the input velocity should be of size ' num2str(md.numberofgrids) '!'])
     16if length(vx)~=md.numberofnodes | length(vy)~=md.numberofnodes,
     17        error(['the input velocity should be of size ' num2str(md.numberofnodes) '!'])
    1818end
    1919if ~(md.dim==2)
  • issm/trunk/src/m/model/mesh/findsegments.m

    r3115 r8298  
    5252                segments(count,:)=[nods1 el1];
    5353
    54                 %swap segment grids if necessary
     54                %swap segment nodes if necessary
    5555                ord1=find(nods1(1)==md.elements(el1,:));
    5656                ord2=find(nods1(2)==md.elements(el1,:));
     
    7777                                segments(count,:)=[nods el1];
    7878
    79                                 %swap segment grids if necessary
     79                                %swap segment nodes if necessary
    8080                                ord1=find(nods(1)==md.elements(el1,:));
    8181                                ord2=find(nods(2)==md.elements(el1,:));
  • issm/trunk/src/m/model/mesh/mesh.m

    r3994 r8298  
    1515%      md=mesh(md,'DomainOutline.exp','Rifts.exp',1500);
    1616
    17 %Figure out a characteristic area. Resolution is a grid oriented concept (ex a 1000m  resolution grid would
     17%Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would
    1818%be made of 1000*1000 area squares).
    1919if (nargin==3),
     
    4343        [elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area,'yes');
    4444
    45         %check that all the created grids belong to at least one element
     45        %check that all the created nodes belong to at least one element
    4646        orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
    4747        for i=1:length(orphan),
    48                 %get rid of the orphan grid i
     48                %get rid of the orphan node i
    4949                %update x and y
    5050                x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
     
    7070%Fill in rest of fields:
    7171md.numberofelements=length(md.elements);
    72 md.numberofgrids=length(md.x);
    73 md.z=zeros(md.numberofgrids,1);
    74 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
    75 md.gridonbed=ones(md.numberofgrids,1);
    76 md.gridonsurface=ones(md.numberofgrids,1);
     72md.numberofnodes=length(md.x);
     73md.z=zeros(md.numberofnodes,1);
     74md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
     75md.nodeonbed=ones(md.numberofnodes,1);
     76md.nodeonsurface=ones(md.numberofnodes,1);
    7777md.elementonbed=ones(md.numberofelements,1);
    7878md.elementonsurface=ones(md.numberofelements,1);
    7979
    8080%Now, build the connectivity tables for this mesh.
    81 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     81md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    8282md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
    8383
  • issm/trunk/src/m/model/mesh/meshadaptation.m

    r3994 r8298  
    1717        error('meshadaptation error message: adaptation for 3d meshes not implemented yet')
    1818end
    19 if length(field)~=md.numberofgrids
    20         error('meshadaptation error message: input field length shoud be numberofgrids')
     19if length(field)~=md.numberofnodes
     20        error('meshadaptation error message: input field length shoud be numberofnodes')
    2121end
    2222
     
    2525%initialization
    2626index=md.elements;
    27 numberofgrids=md.numberofgrids;
     27numberofnodes=md.numberofnodes;
    2828numberofelements=md.numberofelements;
    29 gradx=zeros(numberofgrids,1);
    30 grady=zeros(numberofgrids,1);
     29gradx=zeros(numberofnodes,1);
     30grady=zeros(numberofnodes,1);
    3131metric=zeros(numberofelements,1);
    3232
     
    4848grad_ely=sum(field(index).*beta,2);
    4949
    50 %update weights that holds the volume of all the element holding the grid i
    51 weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofgrids,1);
     50%update weights that holds the volume of all the element holding the node i
     51weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofnodes,1);
    5252
    53 %Compute gradient for each grid (average of the elements around)
    54 gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofgrids,1);
    55 grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofgrids,1);
     53%Compute gradient for each node (average of the elements around)
     54gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofnodes,1);
     55grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofnodes,1);
    5656gradx=gradx./weights;
    5757grady=grady./weights;
  • issm/trunk/src/m/model/mesh/meshbamg.m

    r5088 r8298  
    7676        %interpolate velocities onto mesh
    7777        disp('   interpolating velocities...');
    78         if strcmpi(NamesV.interp,'grid'),
     78        if strcmpi(NamesV.interp,'node'),
    7979                vx_obs=InterpFromGridToMesh(Vel.(NamesV.xname),Vel.(NamesV.yname),Vel.(NamesV.vxname),md.x,md.y,0);
    8080                vy_obs=InterpFromGridToMesh(Vel.(NamesV.xname),Vel.(NamesV.yname),Vel.(NamesV.vyname),md.x,md.y,0);
     
    8787        if thicknesspresent,
    8888                disp('   interpolating thickness...');
    89                 if strcmpi(NamesH.interp,'grid'),
     89                if strcmpi(NamesH.interp,'node'),
    9090                        h=InterpFromGridToMesh(Thi.(NamesH.xname),Thi.(NamesH.yname),Thi.(NamesH.dataname),md.x,md.y,0);
    9191                else
     
    9595        end
    9696       
    97         %set gridonwater field
     97        %set nodeonwater field
    9898        if ~strcmp(groundeddomain,'N/A'),
    99                 gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
    100                 md.gridonwater=ones(md.numberofgrids,1);
    101                 md.gridonwater(find(gridground))=0;
     99                nodeground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
     100                md.nodeonwater=ones(md.numberofnodes,1);
     101                md.nodeonwater(find(nodeground))=0;
    102102        else
    103                 md.gridonwater=zeros(md.numberofgrids,1);
     103                md.nodeonwater=zeros(md.numberofnodes,1);
    104104        end
    105105
  • issm/trunk/src/m/model/mesh/meshconvert.m

    r5093 r8298  
    3838md.dim=2;
    3939md.numberofelements=size(md.elements,1);
    40 md.numberofgrids=length(md.x);
    41 md.z=zeros(md.numberofgrids,1);
    42 md.gridonbed=ones(md.numberofgrids,1);
    43 md.gridonwater=zeros(md.numberofgrids,1);
    44 md.gridonsurface=ones(md.numberofgrids,1);
     40md.numberofnodes=length(md.x);
     41md.z=zeros(md.numberofnodes,1);
     42md.nodeonbed=ones(md.numberofnodes,1);
     43md.nodeonwater=zeros(md.numberofnodes,1);
     44md.nodeonsurface=ones(md.numberofnodes,1);
    4545md.elementonbed=ones(md.numberofelements,1);
    4646md.elementonsurface=ones(md.numberofelements,1);
    47 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
     47md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
    4848md.counter=1;
  • issm/trunk/src/m/model/mesh/meshnodensity.m

    r3994 r8298  
    2929        [elements,x,y,segments,segmentmarkers]=TriMeshNoDensity(domainname,riftname);
    3030
    31         %check that all the created grids belong to at least one element
     31        %check that all the created nodes belong to at least one element
    3232        orphan=find(~ismember([1:length(x)],sort(unique(elements(:)))));
    3333        for i=1:length(orphan),
    34                 %get rid of the orphan grid i
     34                %get rid of the orphan node i
    3535                %update x and y
    3636                x=[x(1:orphan(i)-(i-1)-1); x(orphan(i)-(i-1)+1:end)];
     
    5656%Fill in rest of fields:
    5757md.numberofelements=length(md.elements);
    58 md.numberofgrids=length(md.x);
    59 md.z=zeros(md.numberofgrids,1);
    60 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
    61 md.gridonbed=ones(md.numberofgrids,1);
    62 md.gridonsurface=ones(md.numberofgrids,1);
     58md.numberofnodes=length(md.x);
     59md.z=zeros(md.numberofnodes,1);
     60md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
     61md.nodeonbed=ones(md.numberofnodes,1);
     62md.nodeonsurface=ones(md.numberofnodes,1);
    6363md.elementonbed=ones(md.numberofelements,1);
    6464md.elementonsurface=ones(md.numberofelements,1);
    6565
    6666%Now, build the connectivity tables for this mesh.
    67 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     67md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    6868md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
    6969
  • issm/trunk/src/m/model/mesh/meshrefine.m

    r3994 r8298  
    2121%Fill in rest of fields:
    2222md.numberofelements=length(md.elements);
    23 md.numberofgrids=length(md.x);
    24 md.z=zeros(md.numberofgrids,1);
    25 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
    26 md.gridonbed=ones(md.numberofgrids,1);
    27 md.gridonsurface=ones(md.numberofgrids,1);
     23md.numberofnodes=length(md.x);
     24md.z=zeros(md.numberofnodes,1);
     25md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
     26md.nodeonbed=ones(md.numberofnodes,1);
     27md.nodeonsurface=ones(md.numberofnodes,1);
    2828md.elementonbed=ones(md.numberofelements,1);
    2929md.elementonsurface=ones(md.numberofelements,1);
    3030
    3131%Now, build the connectivity tables for this mesh.
    32 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     32md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    3333md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
    3434
  • issm/trunk/src/m/model/mesh/meshyams.m

    r5088 r8298  
    7070        %interpolate velocities onto mesh
    7171        disp('   interpolating velocities...');
    72         if strcmpi(Names.interp,'grid'),
     72        if strcmpi(Names.interp,'node'),
    7373                vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.x,md.y,0);
    7474                vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.x,md.y,0);
     
    7979        field=sqrt(vx_obs.^2+vy_obs.^2);
    8080
    81         %set gridonwater field
     81        %set nodeonwater field
    8282        if ~strcmp(groundeddomain,'N/A'),
    83                 gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
    84                 md.gridonwater=ones(md.numberofgrids,1);
    85                 md.gridonwater(find(gridground))=0;
     83                nodeground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
     84                md.nodeonwater=ones(md.numberofnodes,1);
     85                md.nodeonwater(find(nodeground))=0;
    8686        else
    87                 md.gridonwater=zeros(md.numberofgrids,1);
     87                md.nodeonwater=zeros(md.numberofnodes,1);
    8888        end
    8989
     
    9595        %rifts, because the segments are used in YamsCall to freeze the rifts elements during refinement.
    9696        if md.numrifts,
    97                 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     97                md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    9898                md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
    9999                md.segments=findsegments(md);
     
    106106
    107107%Now, build the connectivity tables for this mesh.
    108 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     108md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    109109md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
    110110
    111111%recreate segments
    112112md.segments=findsegments(md);
    113 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
     113md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
    114114
    115115%Fill in rest of fields:
    116 md.z=zeros(md.numberofgrids,1);
    117 md.gridonbed=ones(md.numberofgrids,1);
    118 md.gridonsurface=ones(md.numberofgrids,1);
     116md.z=zeros(md.numberofnodes,1);
     117md.nodeonbed=ones(md.numberofnodes,1);
     118md.nodeonsurface=ones(md.numberofnodes,1);
    119119md.elementonbed=ones(md.numberofelements,1);
    120120md.elementonsurface=ones(md.numberofelements,1);
    121121if ~strcmp(groundeddomain,'N/A'),
    122         gridground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
    123         md.gridonwater=ones(md.numberofgrids,1);
    124         md.gridonwater(find(gridground))=0;
     122        nodeground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
     123        md.nodeonwater=ones(md.numberofnodes,1);
     124        md.nodeonwater(find(nodeground))=0;
    125125else
    126         md.gridonwater=zeros(md.numberofgrids,1);
     126        md.nodeonwater=zeros(md.numberofnodes,1);
    127127end
    128 if strcmpi(Names.interp,'grid'),
     128if strcmpi(Names.interp,'node'),
    129129        md.vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.x,md.y,0);
    130130        md.vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.x,md.y,0);
  • issm/trunk/src/m/model/mesh/reorder.m

    r3994 r8298  
    1919
    2020%reorder nodes
    21 newgrids=randperm(md.numberofgrids)';
    22 tnewgrids=zeros(md.numberofgrids,1);tnewgrids(newgrids)=[1:md.numberofgrids]';
     21newnodes=randperm(md.numberofnodes)';
     22tnewnodes=zeros(md.numberofnodes,1);tnewnodes(newnodes)=[1:md.numberofnodes]';
    2323
    2424%update all fields
    25 md.elements=tnewgrids(md.elements(newelements,:));
    26 md.segments=[tnewgrids(md.segments(:,1)) tnewgrids(md.segments(:,2)) tnewelements(md.segments(:,3))];
    27 md.x=md.x(newgrids);
    28 md.y=md.y(newgrids);
    29 md.z=md.z(newgrids);
    30 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
     25md.elements=tnewnodes(md.elements(newelements,:));
     26md.segments=[tnewnodes(md.segments(:,1)) tnewnodes(md.segments(:,2)) tnewelements(md.segments(:,3))];
     27md.x=md.x(newnodes);
     28md.y=md.y(newnodes);
     29md.z=md.z(newnodes);
     30md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
  • issm/trunk/src/m/model/mesh/rifts/meshaddrifts.m

    r3994 r8298  
    5656       
    5757        %plug md2 mesh into md mesh:
    58         [md.elements,md.x,md.y,md.z,md.numberofelements,md.numberofgrids,elconv,nodeconv,elconv2,nodeconv2]=meshplug(md.elements,md.x,md.y,md.z,...
    59                                                                 md2.elements,md2.x,md2.y,md2.z,md2.extractedgrids,md2.extractedelements,domain_index);
     58        [md.elements,md.x,md.y,md.z,md.numberofelements,md.numberofnodes,elconv,nodeconv,elconv2,nodeconv2]=meshplug(md.elements,md.x,md.y,md.z,...
     59                                                                md2.elements,md2.x,md2.y,md2.z,md2.extractednodes,md2.extractedelements,domain_index);
    6060
    6161        %update md2 rifts using elconv and nodeconv, and plug them into md:
     
    8080
    8181%finish up "a la" mesh.h
    82 md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
    83 md.gridonbed=ones(md.numberofgrids,1);
    84 md.gridonsurface=ones(md.numberofgrids,1);
     82md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
     83md.nodeonbed=ones(md.numberofnodes,1);
     84md.nodeonsurface=ones(md.numberofnodes,1);
    8585md.elementonbed=ones(md.numberofelements,1);
    8686md.elementonsurface=ones(md.numberofelements,1);
    8787
    8888%Now, build the connectivity tables for this mesh.
    89 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     89md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    9090md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
    9191
  • issm/trunk/src/m/model/mesh/rifts/meshplug.m

    r2737 r8298  
    1 function [elements,x,y,z,numberofelements,numberofgrids,elconv,nodeconv,elconv2,nodeconv2]=meshplug(elements,x,y,z,elements2,x2,y2,z2,extractedgrids,extractedelements,domain);
     1function [elements,x,y,z,numberofelements,numberofnodes,elconv,nodeconv,elconv2,nodeconv2]=meshplug(elements,x,y,z,elements2,x2,y2,z2,extractednodes,extractedelements,domain);
    22%MESHPLUG - embed mesh into another one
    33%     See also meshaddrifts
     
    2222nodeconv2=(size(x,1)+1):(size(x,1)+size(x2,1)); nodeconv2=nodeconv2';
    2323
    24 extractedgrids_minusborder=extractedgrids;
    25 extractedgrids_minusborder(domain)=[];
     24extractednodes_minusborder=extractednodes;
     25extractednodes_minusborder(domain)=[];
    2626
    27 x(extractedgrids_minusborder)=NaN;
    28 y(extractedgrids_minusborder)=NaN;
     27x(extractednodes_minusborder)=NaN;
     28y(extractednodes_minusborder)=NaN;
    2929
    3030%now, plug md2 mesh:
     
    3333elements2=elements2+length(x);
    3434
    35 %NaN border grids in second mesh
     35%NaN border nodes in second mesh
    3636x2(1:length(domain))=NaN;
    3737y2(1:length(domain))=NaN;
    3838
    39 %redirect border grids in elements2  to elements
     39%redirect border nodes in elements2  to elements
    4040for i=1:length(domain),
    4141        pos=find(elements2==(i+length(x)));
    42         elements2(pos)=extractedgrids(domain(i));
     42        elements2(pos)=extractednodes(domain(i));
    4343end
    4444
    4545%same deal for nodeconv2:
    4646for i=1:length(domain),
    47         nodeconv2(i)=extractedgrids(domain(i));
     47        nodeconv2(i)=extractednodes(domain(i));
    4848end
    4949
     
    5353
    5454
    55 %now, increase number of grids
     55%now, increase number of nodes
    5656x=[x; x2];
    5757y=[y; y2];
     
    6262
    6363        pos=find(isnan(x));
    64         grid=pos(1);
     64        node=pos(1);
    6565
    66         %collapse grid
    67         x(grid)=[];
    68         y(grid)=[];
    69         z(grid)=[];
     66        %collapse node
     67        x(node)=[];
     68        y(node)=[];
     69        z(node)=[];
    7070
    71         %renumber all grids > grid in elements
    72         pos=find(elements>grid);
     71        %renumber all nodes > node in elements
     72        pos=find(elements>node);
    7373        elements(pos)=elements(pos)-1;
    7474
    7575        %same deal for nodeconv2:
    76         pos=find(nodeconv2>grid);
     76        pos=find(nodeconv2>node);
    7777        nodeconv2(pos)=nodeconv2(pos)-1;
    7878
    7979end
    8080
    81 numberofgrids=length(x);
     81numberofnodes=length(x);
    8282numberofelements=length(elements);
    8383
    8484%finish nodeconv:
    85 temp_nodeconv=nodeconv;  temp_nodeconv(extractedgrids_minusborder)=[];
     85temp_nodeconv=nodeconv;  temp_nodeconv(extractednodes_minusborder)=[];
    8686temp_nodeconvnum=1:length(temp_nodeconv);
    8787nodeconv(temp_nodeconv)=temp_nodeconvnum;
    88 nodeconv(extractedgrids_minusborder)=NaN;
     88nodeconv(extractednodes_minusborder)=NaN;
    8989
  • issm/trunk/src/m/model/mesh/rifts/meshprocessoutsiderifts.m

    r5024 r8298  
    2323                tip=outsidetips(j);
    2424                %find tip in the segments, take first segment (there should be 2) that holds tip,
    25                 %and grid_connected_to_tip is the other node on this segment:
     25                %and node_connected_to_tip is the other node on this segment:
    2626                tipindex=find(rift.segments(:,1)==tip);
    2727                if length(tipindex),
    2828                        tipindex=tipindex(1);
    29                         grid_connected_to_tip=rift.segments(tipindex,2);
     29                        node_connected_to_tip=rift.segments(tipindex,2);
    3030                else
    3131                        tipindex=find(rift.segments(:,2)==tip); tipindex=tipindex(1);
    32                         grid_connected_to_tip=rift.segments(tipindex,1);
     32                        node_connected_to_tip=rift.segments(tipindex,1);
    3333                end
    3434
     
    3737                %side of the rift.
    3838                A=tip;
    39                 B=grid_connected_to_tip;
     39                B=node_connected_to_tip;
    4040
    4141                elements=[];
     
    5858                md.x=[md.x;md.x(tip)];
    5959                md.y=[md.y;md.y(tip)];
    60                 md.numberofgrids=num;
     60                md.numberofnodes=num;
    6161               
    6262                %replace tip in elements
     
    8484%Fill in rest of fields:
    8585md.numberofelements=length(md.elements);
    86 md.numberofgrids=length(md.x);
    87 md.z=zeros(md.numberofgrids,1);
    88 md.gridonboundary=zeros(length(md.x),1); md.gridonboundary(md.segments(:,1:2))=1;
     86md.numberofnodes=length(md.x);
     87md.z=zeros(md.numberofnodes,1);
     88md.nodeonboundary=zeros(length(md.x),1); md.nodeonboundary(md.segments(:,1:2))=1;
    8989md.numrifts=length(md.rifts);
    9090md.elements_type=3*ones(md.numberofelements,1);
    91 md.gridonbed=ones(md.numberofgrids,1);
    92 md.gridonsurface=ones(md.numberofgrids,1);
     91md.nodeonbed=ones(md.numberofnodes,1);
     92md.nodeonsurface=ones(md.numberofnodes,1);
    9393md.elementonbed=ones(md.numberofelements,1);
    9494md.elementonsurface=ones(md.numberofelements,1);
  • issm/trunk/src/m/model/mesh/rifts/meshprocessrifts.m

    r5650 r8298  
    2929%Fill in rest of fields:
    3030md.numberofelements=length(md.elements);
    31 md.numberofgrids=length(md.x);
    32 md.z=zeros(md.numberofgrids,1);
    33 md.gridonboundary=zeros(length(md.x),1); md.gridonboundary(md.segments(:,1:2))=1;
     31md.numberofnodes=length(md.x);
     32md.z=zeros(md.numberofnodes,1);
     33md.nodeonboundary=zeros(length(md.x),1); md.nodeonboundary(md.segments(:,1:2))=1;
    3434md.numrifts=length(md.rifts);
    3535md.elements_type=3*ones(md.numberofelements,1);
    36 md.gridonbed=ones(md.numberofgrids,1);
    37 md.gridonsurface=ones(md.numberofgrids,1);
     36md.nodeonbed=ones(md.numberofnodes,1);
     37md.nodeonsurface=ones(md.numberofnodes,1);
    3838md.elementonbed=ones(md.numberofelements,1);
    3939md.elementonsurface=ones(md.numberofelements,1);
  • issm/trunk/src/m/model/mesh/rifts/rifttipsrefine.m

    r2832 r8298  
    55%      md=rifttipsrefine(md,filename,resolution,circleradius);
    66
    7 numberofgrids=50;
     7numberofnodes=50;
    88
    99%take rifts, and create refinement circles around tips
     
    1515        tip2=[rifts(i).x(end) rifts(i).y(end)];
    1616        %create circle around tip
    17         expcreatecircle('Circle1.exp',tip1(1),tip1(2),circleradius,numberofgrids);
    18         expcreatecircle('Circle2.exp',tip2(1),tip2(2),circleradius,numberofgrids);
     17        expcreatecircle('Circle1.exp',tip1(1),tip1(2),circleradius,numberofnodes);
     18        expcreatecircle('Circle2.exp',tip2(1),tip2(2),circleradius,numberofnodes);
    1919        !cat Circles.exp Circle1.exp Circle2.exp > Circles2.exp
    2020        !mv Circles2.exp Circles.exp
  • issm/trunk/src/m/model/modeldefault/defaultparams.m

    r5961 r8298  
    4747        %drag md.drag or stress
    4848        md.drag_type=2; %0 none 1 plastic 2 viscous
    49         md.drag_coefficient=300*ones(md.numberofgrids,1); %q=1.
     49        md.drag_coefficient=300*ones(md.numberofnodes,1); %q=1.
    5050               
    5151        %zones of high md.drag
     
    8989
    9090        disp('      creating accumulation rates');
    91         md.accumulation_rate=ones(md.numberofgrids,1); %1m/a
     91        md.accumulation_rate=ones(md.numberofnodes,1); %1m/a
    9292       
    9393        %Deal with boundary conditions:
    9494
    9595        disp('      thermal model');
    96         md.melting_rate=zeros(md.numberofgrids,1);
     96        md.melting_rate=zeros(md.numberofnodes,1);
    9797        md.observed_temperature=md.temperature;
    9898       
  • issm/trunk/src/m/model/modelextract.m

    r5492 r8298  
    3838%kick out all elements with 3 dirichlets
    3939spc_elem=find(~flag_elem);
    40 spc_grid=sort(unique(md1.elements(spc_elem,:)));
    41 flag=ones(md1.numberofgrids,1);
    42 flag(spc_grid)=0;
     40spc_node=sort(unique(md1.elements(spc_elem,:)));
     41flag=ones(md1.numberofnodes,1);
     42flag(spc_node)=0;
    4343pos=find(sum(flag(md1.elements),2)==0);
    4444flag_elem(pos)=0;
     
    4646%extracted elements and nodes lists
    4747pos_elem=find(flag_elem);
    48 pos_grid=sort(unique(md1.elements(pos_elem,:)));
     48pos_node=sort(unique(md1.elements(pos_elem,:)));
    4949
    5050%keep track of some fields
    51 numberofgrids1=md1.numberofgrids;
     51numberofnodes1=md1.numberofnodes;
    5252numberofelements1=md1.numberofelements;
    53 numberofgrids2=length(pos_grid);
     53numberofnodes2=length(pos_node);
    5454numberofelements2=length(pos_elem);
    55 flag_grid=zeros(numberofgrids1,1);
    56 flag_grid(pos_grid)=1;
    57 
    58 %Create Pelem and Pgrid (transform old grids in new grids and same thing for the elements)
     55flag_node=zeros(numberofnodes1,1);
     56flag_node(pos_node)=1;
     57
     58%Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
    5959Pelem=zeros(numberofelements1,1);
    6060Pelem(pos_elem)=[1:numberofelements2]';
    61 Pgrid=zeros(numberofgrids1,1);
    62 Pgrid(pos_grid)=[1:numberofgrids2]';
    63 
    64 %renumber the elements (some grid won't exist anymore)
     61Pnode=zeros(numberofnodes1,1);
     62Pnode(pos_node)=[1:numberofnodes2]';
     63
     64%renumber the elements (some node won't exist anymore)
    6565elements_1=md1.elements;
    6666elements_2=elements_1(pos_elem,:);
    67 elements_2(:,1)=Pgrid(elements_2(:,1));
    68 elements_2(:,2)=Pgrid(elements_2(:,2));
    69 elements_2(:,3)=Pgrid(elements_2(:,3));
     67elements_2(:,1)=Pnode(elements_2(:,1));
     68elements_2(:,2)=Pnode(elements_2(:,2));
     69elements_2(:,3)=Pnode(elements_2(:,3));
    7070if md1.dim==3,
    71         elements_2(:,4)=Pgrid(elements_2(:,4));
    72         elements_2(:,5)=Pgrid(elements_2(:,5));
    73         elements_2(:,6)=Pgrid(elements_2(:,6));
     71        elements_2(:,4)=Pnode(elements_2(:,4));
     72        elements_2(:,5)=Pnode(elements_2(:,5));
     73        elements_2(:,6)=Pnode(elements_2(:,6));
    7474end
    7575
     
    8989                fieldsize=size(field);
    9090
    91                 %size = number of grids * n
    92                 if fieldsize(1)==numberofgrids1
    93                         md2.(model_fields(i))=field(pos_grid,:);
     91                %size = number of nodes * n
     92                if fieldsize(1)==numberofnodes1
     93                        md2.(model_fields(i))=field(pos_node,:);
    9494
    9595                %size = number of elements * n
     
    103103        %Mesh
    104104        md2.numberofelements=numberofelements2;
    105         md2.numberofgrids=numberofgrids2;
     105        md2.numberofnodes=numberofnodes2;
    106106        md2.elements=elements_2;
    107107
    108108        %uppernodes lowernodes
    109109        if md1.dim==3
    110                 md2.uppergrids=md1.uppergrids(pos_grid);
    111                 pos=find(~isnan(md2.uppergrids));
    112                 md2.uppergrids(pos)=Pgrid(md2.uppergrids(pos));
    113 
    114                 md2.lowergrids=md1.lowergrids(pos_grid);
    115                 pos=find(~isnan(md2.lowergrids));
    116                 md2.lowergrids(pos)=Pgrid(md2.lowergrids(pos));
     110                md2.uppernodes=md1.uppernodes(pos_node);
     111                pos=find(~isnan(md2.uppernodes));
     112                md2.uppernodes(pos)=Pnode(md2.uppernodes(pos));
     113
     114                md2.lowernodes=md1.lowernodes(pos_node);
     115                pos=find(~isnan(md2.lowernodes));
     116                md2.lowernodes(pos)=Pnode(md2.lowernodes(pos));
    117117
    118118                md2.upperelements=md1.upperelements(pos_elem);
     
    129129                flag_elem_2d=flag_elem(1:md1.numberofelements2d);
    130130                pos_elem_2d=find(flag_elem_2d);
    131                 flag_grid_2d=flag_grid(1:md1.numberofgrids2d);
    132                 pos_grid_2d=find(flag_grid_2d);
     131                flag_node_2d=flag_node(1:md1.numberofnodes2d);
     132                pos_node_2d=find(flag_node_2d);
    133133
    134134                md2.numberofelements2d=length(pos_elem_2d);
    135                 md2.numberofgrids2d=length(pos_grid_2d);
     135                md2.numberofnodes2d=length(pos_node_2d);
    136136                md2.elements2d=md1.elements2d(pos_elem_2d,:);
    137                 md2.elements2d(:,1)=Pgrid(md2.elements2d(:,1));
    138                 md2.elements2d(:,2)=Pgrid(md2.elements2d(:,2));
    139                 md2.elements2d(:,3)=Pgrid(md2.elements2d(:,3));
     137                md2.elements2d(:,1)=Pnode(md2.elements2d(:,1));
     138                md2.elements2d(:,2)=Pnode(md2.elements2d(:,2));
     139                md2.elements2d(:,3)=Pnode(md2.elements2d(:,3));
    140140
    141141                if ~isnan(md2.elements_type2d), md2.elements_type2d=md1.elements_type2d(pos_elem_2d); end;
    142                 md2.x2d=md1.x(pos_grid_2d);
    143                 md2.y2d=md1.y(pos_grid_2d);
    144                 md2.z2d=md1.z(pos_grid_2d);
     142                md2.x2d=md1.x(pos_node_2d);
     143                md2.y2d=md1.y(pos_node_2d);
     144                md2.z2d=md1.z(pos_node_2d);
    145145        end
    146146
     
    149149                %renumber first two columns
    150150                pos=find(~isnan(md2.edges(:,4)));
    151                 md2.edges(:  ,1)=Pgrid(md2.edges(:,1));
    152                 md2.edges(:  ,2)=Pgrid(md2.edges(:,2));
     151                md2.edges(:  ,1)=Pnode(md2.edges(:,1));
     152                md2.edges(:  ,2)=Pnode(md2.edges(:,2));
    153153                md2.edges(:  ,3)=Pelem(md2.edges(:,3));
    154154                md2.edges(pos,4)=Pelem(md2.edges(pos,4));
     
    175175        if ~isnan(md2.penalties),
    176176                for i=1:size(md1.penalties,1);
    177                         md2.penalties(i,:)=Pgrid(md1.penalties(i,:));
     177                        md2.penalties(i,:)=Pnode(md1.penalties(i,:));
    178178                end
    179179                md2.penalties=md2.penalties(find(md2.penalties(:,1)),:);
     
    182182        %recreate segments
    183183        if md1.dim==2
    184                 md2.nodeconnectivity=NodeConnectivity(md2.elements,md2.numberofgrids);
     184                md2.nodeconnectivity=NodeConnectivity(md2.elements,md2.numberofnodes);
    185185                md2.elementconnectivity=ElementConnectivity(md2.elements,md2.nodeconnectivity);
    186186                md2.segments=contourenvelope(md2);
    187                 md2.gridonboundary=zeros(numberofgrids2,1); md2.gridonboundary(md2.segments(:,1:2))=1;
     187                md2.nodeonboundary=zeros(numberofnodes2,1); md2.nodeonboundary(md2.segments(:,1:2))=1;
    188188        end
    189189
     
    191191        %Catch the elements that have not been extracted
    192192        orphans_elem=find(~flag_elem);
    193         orphans_grid=unique(md1.elements(orphans_elem,:))';
    194         %Figure out which grid are on the boundary between md2 and md1
    195         gridstoflag1=intersect(orphans_grid,pos_grid);
    196         gridstoflag2=Pgrid(gridstoflag1);
     193        orphans_node=unique(md1.elements(orphans_elem,:))';
     194        %Figure out which node are on the boundary between md2 and md1
     195        nodestoflag1=intersect(orphans_node,pos_node);
     196        nodestoflag2=Pnode(nodestoflag1);
    197197        if ~isnan(md1.spcvelocity),
    198                 md2.spcvelocity(gridstoflag2,1:3)=1;
     198                md2.spcvelocity(nodestoflag2,1:3)=1;
    199199                if ~isnan(md1.vx_obs) & ~isnan(md1.vy_obs)
    200                         md2.spcvelocity(gridstoflag2,4)=md2.vx_obs(gridstoflag2);
    201                         md2.spcvelocity(gridstoflag2,5)=md2.vy_obs(gridstoflag2);
     200                        md2.spcvelocity(nodestoflag2,4)=md2.vx_obs(nodestoflag2);
     201                        md2.spcvelocity(nodestoflag2,5)=md2.vy_obs(nodestoflag2);
    202202                else
    203                         md2.spcvelocity(gridstoflag2,4:5)=zeros(length(gridstoflag2),2);
     203                        md2.spcvelocity(nodestoflag2,4:5)=zeros(length(nodestoflag2),2);
    204204                        disp(' ')
    205205                        disp('!! modelextract warning: spc values should be checked !!')
     
    208208        end
    209209        if ~isnan(md1.spctemperature),
    210                 md2.spctemperature(gridstoflag2,1)=1;
     210                md2.spctemperature(nodestoflag2,1)=1;
    211211                if ~isnan(md1.observed_temperature)
    212                         md2.spctemperature(gridstoflag2,2)=md2.observed_temperature(gridstoflag2);
     212                        md2.spctemperature(nodestoflag2,2)=md2.observed_temperature(nodestoflag2);
    213213                else
    214                         md2.spctemperature(gridstoflag2,2)=zeros(length(gridstoflag2),2);
     214                        md2.spctemperature(nodestoflag2,2)=zeros(length(nodestoflag2),2);
    215215                        disp(' ')
    216216                        disp('!! modelextract warning: spc values should be checked !!')
     
    221221        %Diagnostic
    222222        if ~isnan(md2.pressureload)
    223                 md2.pressureload(:,1)=Pgrid(md1.pressureload(:,1));
    224                 md2.pressureload(:,2)=Pgrid(md1.pressureload(:,2));
     223                md2.pressureload(:,1)=Pnode(md1.pressureload(:,1));
     224                md2.pressureload(:,2)=Pnode(md1.pressureload(:,2));
    225225                md2.pressureload(:,end-1)=Pelem(md1.pressureload(:,end-1));
    226226                if md1.dim==3
    227                         md2.pressureload(:,3)=Pgrid(md1.pressureload(:,3));
    228                         md2.pressureload(:,4)=Pgrid(md1.pressureload(:,4));
     227                        md2.pressureload(:,3)=Pnode(md1.pressureload(:,3));
     228                        md2.pressureload(:,4)=Pnode(md1.pressureload(:,4));
    229229                end
    230230                md2.pressureload=md2.pressureload(find(md2.pressureload(:,1) & md2.pressureload(:,2) & md2.pressureload(:,end)),:);
     
    240240                        for j=1:length(solutionsubfields),
    241241                                field=md1.results.(solutionfields(i)).(solutionsubfields(j));
    242                                 if length(field)==numberofgrids1,
    243                                         md2.results.(solutionfields(i)).(solutionsubfields(j))=field(pos_grid);
     242                                if length(field)==numberofnodes1,
     243                                        md2.results.(solutionfields(i)).(solutionsubfields(j))=field(pos_node);
    244244                                elseif length(field)==numberofelements1,
    245245                                        md2.results.(solutionfields(i)).(solutionsubfields(j))=field(pos_elem);
     
    260260        md2.strainrate=NaN;
    261261
    262 %Keep track of pos_grid and pos_elem
    263 md2.extractedgrids=pos_grid;
     262%Keep track of pos_node and pos_elem
     263md2.extractednodes=pos_node;
    264264md2.extractedelements=pos_elem;
  • issm/trunk/src/m/model/outflow.m

    r7512 r8298  
    1111VdotN=Vx.*Nx+Vy.*Ny;
    1212
    13 flag=zeros(md.numberofgrids,1);
     13flag=zeros(md.numberofnodes,1);
    1414flag(A(find(VdotN>0)))=1;
  • issm/trunk/src/m/model/parametercontroloptimization.m

    r5631 r8298  
    3535md2.cm_jump=0.99*ones(md2.nsteps,1);
    3636md2.control_analysis=1;
    37 md2.weights=ones(md2.numberofgrids,1);
     37md2.weights=ones(md2.numberofnodes,1);
    3838
    3939%loop over the set of parameters
  • issm/trunk/src/m/model/parameterization/parametercontrolB.m

    r6037 r8298  
    2424
    2525%weights
    26 weights=getfieldvalue(options,'weights',ones(md.numberofgrids,1));
    27 if (length(weights)~=md.numberofgrids)
    28         md.weights=ones(md.numberofgrids,1);
     26weights=getfieldvalue(options,'weights',ones(md.numberofnodes,1));
     27if (length(weights)~=md.numberofnodes)
     28        md.weights=ones(md.numberofnodes,1);
    2929else
    3030        md.weights=weights;
  • issm/trunk/src/m/model/parameterization/parametercontroldrag.m

    r8227 r8298  
    2424
    2525%weights
    26 weights=getfieldvalue(options,'weights',ones(md.numberofgrids,1));
    27 if (length(weights)~=md.numberofgrids)
    28         md.weights=ones(md.numberofgrids,1);
     26weights=getfieldvalue(options,'weights',ones(md.numberofnodes,1));
     27if (length(weights)~=md.numberofnodes)
     28        md.weights=ones(md.numberofnodes,1);
    2929else
    3030        md.weights=weights;
     
    4040
    4141%cm_min
    42 cm_min=getfieldvalue(options,'cm_min',1*ones(md.numberofgrids,1));
     42cm_min=getfieldvalue(options,'cm_min',1*ones(md.numberofnodes,1));
    4343if (length(cm_min)==1)
    44         md.cm_min=cm_min*ones(md.numberofgrids,1);
    45 elseif (length(cm_min)==md.numberofgrids)
     44        md.cm_min=cm_min*ones(md.numberofnodes,1);
     45elseif (length(cm_min)==md.numberofnodes)
    4646        md.cm_min=cm_min;
    4747else
     
    5050
    5151%cm_max
    52 cm_max=getfieldvalue(options,'cm_max',250*ones(md.numberofgrids,1));
     52cm_max=getfieldvalue(options,'cm_max',250*ones(md.numberofnodes,1));
    5353if (length(cm_max)==1)
    54         md.cm_max=cm_max*ones(md.numberofgrids,1);
    55 elseif (length(cm_max)==md.numberofgrids)
     54        md.cm_max=cm_max*ones(md.numberofnodes,1);
     55elseif (length(cm_max)==md.numberofnodes)
    5656        md.cm_max=cm_max;
    5757else
  • issm/trunk/src/m/model/partition/adjacency.m

    r4663 r8298  
    1414values=1;
    1515
    16 md.adjacency=sparse(indi,indj,values,md.numberofgrids,md.numberofgrids);
     16md.adjacency=sparse(indi,indj,values,md.numberofnodes,md.numberofnodes);
    1717md.adjacency=double([md.adjacency | md.adjacency']);
    1818
     
    2121
    2222%get node connectivity
    23 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     23md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    2424
    2525connectivity=md.nodeconnectivity(:,1:end-1);
  • issm/trunk/src/m/model/partition/partitioner.m

    r4713 r8298  
    7575elseif strcmpi(package,'linear'),
    7676
    77         part=1:1:md.numberofgrids;
     77        part=1:1:md.numberofnodes;
    7878
    7979elseif strcmpi(package,'metis'),
  • issm/trunk/src/m/model/plot/plot_contour.m

    r7588 r8298  
    1616end
    1717
    18 %first, process data: must be on grids
     18%first, process data: must be on nodes
    1919if datatype==1,
    2020        %elements -> take average
     
    6767edges_tria=[vec(elementslist), vec(elementslist+numberofelements), vec(elementslist+2*numberofelements)];
    6868
    69 %segments [grids1 gruids2]
     69%segments [nodes1 nodes2]
    7070Seg1=index(:,[1 2]);
    7171Seg2=index(:,[2 3]);
  • issm/trunk/src/m/model/plot/plot_gridnumbering.m

    r5617 r8298  
    1 function plot_gridnumbering(md,options,width,i);
    2 %PLOT_GRIDNUMBERING - plot grid numbering
     1function plot_nodenumbering(md,options,width,i);
     2%PLOT_GRIDNUMBERING - plot node numbering
    33%
    44%   Usage:
    5 %      plot_gridnumbering(md,options,width,i);
     5%      plot_nodenumbering(md,options,width,i);
    66%
    77%   See also: PLOTMODEL
     
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,[],options);
    11 [gridnumbers datatype]=processdata(md,[1:md.numberofgrids]',options);
     11[nodenumbers datatype]=processdata(md,[1:md.numberofnodes]',options);
    1212
    1313%plot
     
    4747
    4848%apply options
    49 options=addfielddefault(options,'title','Grid numbering');
     49options=addfielddefault(options,'title','Node numbering');
    5050options=addfielddefault(options,'colorbar',0);
    5151applyoptions(md,[],options);
  • issm/trunk/src/m/model/plot/plot_highlightgrids.m

    r5617 r8298  
    1 function plot_highlightgrids(md,options,width,i);
    2 %PLOT_HIGHLIGHTGRIDS - plot selected grids
     1function plot_highlightnodes(md,options,width,i);
     2%PLOT_HIGHLIGHTGRIDS - plot selected nodes
    33%
    44%   Usage:
    5 %      plot_highlightgrids(md,options,width,i);
     5%      plot_highlightnodes(md,options,width,i);
    66%
    77%   See also: PLOTMODEL
     
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,[],options);
    11 [gridnumbers datatype]=processdata(md,[1:md.numberofgrids]',options);
     11[nodenumbers datatype]=processdata(md,[1:md.numberofnodes]',options);
    1212
    1313%plot
     
    4040%apply options
    4141if ~exist(options,'highlight')
    42         disp('highlightgrids warning : highlight option empty, not grid highlighted');
     42        disp('highlightnodes warning : highlight option empty, not node highlighted');
    4343end
    44 options=addfielddefault(options,'title','Highlighted Grids');
     44options=addfielddefault(options,'title','Highlighted Nodes');
    4545options=addfielddefault(options,'colorbar',0);
    4646applyoptions(md,[],options);
  • issm/trunk/src/m/model/plot/plot_importancefactors.m

    r4330 r8298  
    6161
    6262%distribute importance factor
    63 gridimportance=importancefactors(npart);
     63nodeimportance=importancefactors(npart);
    6464
    6565%process data and model
     
    7272subplot(width,width,ii);
    7373
    74 %ok, plot gridimportance now.
     74%ok, plot nodeimportance now.
    7575if is2d,
    7676        A=elements(:,1); B=elements(:,2); C=elements(:,3);
    77         patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', gridimportance,'FaceColor','interp','EdgeColor',edgecolor);
     77        patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', nodeimportance,'FaceColor','interp','EdgeColor',edgecolor);
    7878else
    7979        error('plot_importancefactors error message: 3d meshes not supported yet');
  • issm/trunk/src/m/model/plot/plot_manager.m

    r8128 r8298  
    6262                        plot_elementstype(md,options,subplotwidth,i);
    6363                        return;
    64                 case 'gridnumbering',
    65                         plot_gridnumbering(md,options,subplotwidth,i);
    66                         return;
    67                
    68                 case 'highlightgrids',
    69                         plot_highlightgrids(md,options,subplotwidth,i);
     64                case 'nodenumbering',
     65                        plot_nodenumbering(md,options,subplotwidth,i);
     66                        return;
     67               
     68                case 'highlightnodes',
     69                        plot_highlightnodes(md,options,subplotwidth,i);
    7070                        return;
    7171                case {'basal_drag','basal_dragx','basal_dragy'},
  • issm/trunk/src/m/model/plot/plot_overlay.m

    r7985 r8298  
    1111if strcmpi(data,'none'),
    1212        radaronly=1;
    13         data=NaN*ones(md.numberofgrids,1);
     13        data=NaN*ones(md.numberofnodes,1);
    1414        datatype=1;
    1515else
  • issm/trunk/src/m/model/plot/plot_penalties.m

    r5617 r8298  
    4040                P2=plot3(x(md.penalties(i,:)),y(md.penalties(i,:)),z(md.penalties(i,:)),'bo-','LineWidth',2,'MarkerSize',8,'MarkerFaceColor','b');
    4141        end
    42         legend([P1 P2],'MacAyeal''s penalized grids','Pattyn''s penalized grids');
     42        legend([P1 P2],'MacAyeal''s penalized nodes','Pattyn''s penalized nodes');
    4343end
    4444
  • issm/trunk/src/m/model/plot/plot_qmumean.m

    r5561 r8298  
    4848
    4949%now, project onto vertices
    50 responses_on_grid=responses(md.part+1);
     50responses_on_node=responses(md.part+1);
    5151
    5252%plot
    5353A=elements(:,1); B=elements(:,2); C=elements(:,3);
    54 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_grid,'FaceColor','interp','EdgeColor',edgecolor);
     54patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
    5555
    5656%apply options
  • issm/trunk/src/m/model/plot/plot_qmustddev.m

    r5561 r8298  
    4949
    5050%now, project onto vertices
    51 responses_on_grid=responses(md.part+1);
     51responses_on_node=responses(md.part+1);
    5252
    5353%plot
    5454A=elements(:,1); B=elements(:,2); C=elements(:,3);
    55 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_grid,'FaceColor','interp','EdgeColor',edgecolor);
     55patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
    5656
    5757%apply options
  • issm/trunk/src/m/model/plot/plot_riftfraction.m

    r4330 r8298  
    2323end
    2424
    25 %first, build a vector of fractions, over all grids.
    26 fractions=zeros(md.numberofgrids,1);
     25%first, build a vector of fractions, over all nodes.
     26fractions=zeros(md.numberofnodes,1);
    2727
    2828%plug riftproperties fractions:
  • issm/trunk/src/m/model/plot/plot_riftnumbering.m

    r6751 r8298  
    8282
    8383        for j=1:size(penaltypairs,1),
    84                 grid=penaltypairs(j,1);
    85                 t=text(x(grid),y(grid),[num2str(i) '.' num2str(j)]);
     84                node=penaltypairs(j,1);
     85                t=text(x(node),y(node),[num2str(i) '.' num2str(j)]);
    8686                set(t,'FontSize',fontsize);
    8787        end
  • issm/trunk/src/m/model/plot/plot_riftrelvel.m

    r7317 r8298  
    88
    99%some checks
    10 if (length(md.vx)~=md.numberofgrids | length(md.vy)~=md.numberofgrids),
     10if (length(md.vx)~=md.numberofnodes | length(md.vy)~=md.numberofnodes),
    1111        error('plot_riftvel error message: vx and vy do not have the right size'),
    1212end
     
    2121
    2222%set as NaN all velocities not on rifts
    23 u=NaN*ones(md.numberofgrids,1);
    24 v=NaN*ones(md.numberofgrids,1);
     23u=NaN*ones(md.numberofnodes,1);
     24v=NaN*ones(md.numberofnodes,1);
    2525for i=1:md.numrifts,
    2626        penaltypairs=md.rifts(i).penaltypairs(:,[1 2]);
     
    6464for i=1:md.numrifts,
    6565       
    66         %get grids on rift
     66        %get nodes on rift
    6767        penaltypairs=md.rifts(i).penaltypairs;
    6868
  • issm/trunk/src/m/model/plot/plot_riftvel.m

    r4330 r8298  
    88
    99%some checks
    10 if (length(md.vx)~=md.numberofgrids | length(md.vy)~=md.numberofgrids),
     10if (length(md.vx)~=md.numberofnodes | length(md.vy)~=md.numberofnodes),
    1111        error('plot_riftvel error message: vx and vy do not have the right size'),
    1212end
     
    1717
    1818%set as NaN all velocities not on rifts
    19 u=NaN*ones(md.numberofgrids,1);
    20 v=NaN*ones(md.numberofgrids,1);
     19u=NaN*ones(md.numberofnodes,1);
     20v=NaN*ones(md.numberofnodes,1);
    2121for i=1:md.numrifts,
    2222        penaltypairs=md.rifts(i).penaltypairs(:,[1 2]);
     
    5858
    5959for i=1:size(md.rifts,1),
    60         %get grids on rift
     60        %get nodes on rift
    6161        penaltypairs=md.rifts(i).penaltypairs;
    6262
  • issm/trunk/src/m/model/plot/plot_tensor_principalaxis.m

    r4330 r8298  
    2727end
    2828
    29 %take the center of each element if ~isongrid
     29%take the center of each element if ~isonnode
    3030if datatype==1,
    3131        x=mean(md.x(md.elements'))'; y=mean(md.y(md.elements'))'; z=mean(md.z(md.elements'))';
  • issm/trunk/src/m/model/plot/plotanalyse.m

    r1 r8298  
    77%Do a series of plots that will help the user analyse what is going on.
    88plot(md,'data','segmentonneumann_diag','title','dynamic boundary conditions',...
    9                 'data','gridondirichlet_diag','title','fixed velocity grids',...
     9                'data','nodeondirichlet_diag','title','fixed velocity nodes',...
    1010                'data','vx_obs','title','vx observation (m/s)',...
    1111                'data','vy_obs','title','vy observation (m/s)',...
     
    1919
    2020plot(md,'data','elementoniceshelf','title','elements on iceshelf',...
    21         'data','gridoniceshelf','title','nodes on iceshelf',...
     21        'data','nodeoniceshelf','title','nodes on iceshelf',...
    2222                'data','elementonicesheet','title','elements on icesheet',...
    23                 'data','gridonicesheet','title','nodes on icesheet','colorbar#all','on','figure',4);
     23                'data','nodeonicesheet','title','nodes on icesheet','colorbar#all','on','figure',4);
  • issm/trunk/src/m/model/plot/plotdoc.m

    r8016 r8298  
    2222disp('                  - ''elements_type'': model used for each element');
    2323disp('                  - ''elementnumbering'': numbering of elements');
    24 disp('                  - ''gridnumbering'': numbering of grids');
     24disp('                  - ''nodenumbering'': numbering of nodes');
    2525disp('                  - ''highlightelements'': to highlight elements to highlight the element list');
    26 disp('                  - ''highlightgrids'': to highlight grids (use highlight option to enter the grid list');
     26disp('                  - ''highlightnodes'': to highlight nodes (use highlight option to enter the node list');
    2727disp('                  - ''mesh'': draw mesh using trisurf');
    2828disp('                  - ''riftvel'': velocities along rifts');
     
    8686disp('       ''fontweight'': same as standard matlab option (normal: ''n'',bold: ''b'',light: ''l'',demi: ''d'')');
    8787disp('       ''fontcolor'': same as standard matlab option');
    88 disp('       ''highlight'': highlights certain grids or elements when using ''gridnumbering'' or ''elementnumbering'' or ''highlightgrids '' or ''highlightelements'' option');
     88disp('       ''highlight'': highlights certain nodes or elements when using ''nodenumbering'' or ''elementnumbering'' or ''highlightnodes '' or ''highlightelements'' option');
    8989disp('       ''resolution'': resolution used by section value (array of type [horizontal_resolution vertical_resolution])');
    9090disp('                       horizontal_resolution must be in meter, and vertical_resolution a number of layers');
     
    119119disp('       ''textcolor'':  same as standard ''color'' matlab option applied to text, use a cell of strings if more than one');
    120120disp('       ''textrotation'':  same as standard ''Rotation'' matlab option applied to text, use a cell of strings if more than one');
    121 disp('       ''mask'': list of flags of size numberofgrids or numberofelements. Only ''true'' values are plotted ');
     121disp('       ''mask'': list of flags of size numberofnodes or numberofelements. Only ''true'' values are plotted ');
    122122disp('       ''partitionedges'': ''off'' by default. overlay plot of partition edges');
    123123disp('       ''log'': value of log');
  • issm/trunk/src/m/model/plot/processdata.m

    r7244 r8298  
    5858
    5959        %check length
    60         if datasize(1)~=md.numberofgrids & datasize(1)~=md.numberofelements & datasize(1)~=md.numberofgrids*6 & (md.dim==3 & ~(datasize(1)==md.numberofelements2d | datasize(1)==md.numberofgrids2d))
     60        if datasize(1)~=md.numberofnodes & datasize(1)~=md.numberofelements & datasize(1)~=md.numberofnodes*6 & (md.dim==3 & ~(datasize(1)==md.numberofelements2d | datasize(1)==md.numberofnodes2d))
    6161                error('plotmodel error message: data not supported yet');
    6262        end
     
    7878        end
    7979
    80         %treat the case datasize(1)=6*grids
    81         if datasize(1)==6*md.numberofgrids
     80        %treat the case datasize(1)=6*nodes
     81        if datasize(1)==6*md.numberofnodes
    8282                %keep the only norm of data
    83                 data1=data(1:6:md.numberofgrids*6,:);
    84                 data2=data(2:6:md.numberofgrids*6,:);
     83                data1=data(1:6:md.numberofnodes*6,:);
     84                data2=data(2:6:md.numberofnodes*6,:);
    8585                data=sqrt(data1.^2+data2.^2);
    86                 datasize(1)=md.numberofgrids;
    87                 %---> go to grid data
     86                datasize(1)=md.numberofnodes;
     87                %---> go to node data
    8888        end
    8989
    90         %treat the case datasize(1)=grids2d
    91         if (md.dim==3 & datasize(1)==md.numberofgrids2d),
     90        %treat the case datasize(1)=nodes2d
     91        if (md.dim==3 & datasize(1)==md.numberofnodes2d),
    9292                data=project3d(md,data,'node');
    93                 datasize(1)=md.numberofgrids;
    94                 %---> go to grid data
     93                datasize(1)=md.numberofnodes;
     94                %---> go to node data
    9595        end
    9696
    97         %treat the case datasize(1)=grids2d
     97        %treat the case datasize(1)=nodes2d
    9898        if (md.dim==3 & datasize(1)==md.numberofelements2d),
    9999                data=project3d(md,data,'element');
    100100                datasize(1)=md.numberofelements;
    101                 %---> go to grid data
     101                %---> go to node data
    102102        end
    103103
     
    105105        if exist(options,'smooth')
    106106                data=averaging(md,data,getfieldvalue(options,'smooth'));
    107                 datasize(1)=md.numberofgrids;
    108                 %---> go to grid data
     107                datasize(1)=md.numberofnodes;
     108                %---> go to node data
    109109        end
    110110end
     
    122122                flags=getfieldvalue(options,'mask');
    123123                pos=find(~flags);
    124                 if length(flags)==md.numberofgrids,
     124                if length(flags)==md.numberofnodes,
    125125                        [pos2 dummy]=find(ismember(md.elements,pos));
    126126                        data(pos2,:)=NaN;
     
    128128                        data(pos,:)=NaN;
    129129                else
    130                         disp('plotmodel warning: mask length not supported yet (supported length are md.numberofgrids and md.numberofelements');
     130                        disp('plotmodel warning: mask length not supported yet (supported length are md.numberofnodes and md.numberofelements');
    131131                end
    132132        end
     
    144144end
    145145
    146 %grid data
    147 if (datasize(1)==md.numberofgrids & datasize(2)==1),
     146%node data
     147if (datasize(1)==md.numberofnodes & datasize(2)==1),
    148148        datatype=2;
    149149
     
    152152                flags=getfieldvalue(options,'mask');
    153153                pos=find(~flags);
    154                 if length(flags)==md.numberofgrids,
     154                if length(flags)==md.numberofnodes,
    155155                        data(pos,:)=NaN;
    156156                elseif length(flags)==md.numberofelements
    157157                        data(md.elements(pos,:),:)=NaN;
    158158                else
    159                         disp('plotmodel warning: mask length not supported yet (supported length are md.numberofgrids and md.numberofelements');
     159                        disp('plotmodel warning: mask length not supported yet (supported length are md.numberofnodes and md.numberofelements');
    160160                end
    161161        end
  • issm/trunk/src/m/model/plot/processmesh.m

    r7651 r8298  
    88
    99%some checks
    10 if md.numberofgrids==md.numberofelements
    11         error('plot error message: the number of elements is the same as the number of grids! cannot plot anything with model/plot, use matlab/plot instead')
     10if md.numberofnodes==md.numberofelements
     11        error('plot error message: the number of elements is the same as the number of nodes! cannot plot anything with model/plot, use matlab/plot instead')
    1212end
    1313
  • issm/trunk/src/m/model/plug.m

    r1 r8298  
    2828
    2929        distance=sqrt( (md.x(index)-md.x).^2 + (md.y(index)-md.y).^2 );
    30         distance(holevalues)=10^10; %be sure we are not picking up the nan grids!
     30        distance(holevalues)=10^10; %be sure we are not picking up the nan nodes!
    3131
    3232        index2=find(distance==min(distance));index2=index2(1);
  • issm/trunk/src/m/model/presolve.m

    r6748 r8298  
    3131end
    3232
    33 md.riftinfo=zeros(numpairs,12); % 2 for grids + 2 for elements+ 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
     33md.riftinfo=zeros(numpairs,12); % 2 for nodes + 2 for elements+ 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
    3434
    3535count=1;
  • issm/trunk/src/m/model/project2d.m

    r4642 r8298  
    3232end
    3333
    34 if size(value,1)==md3d.numberofgrids,
    35         projection_value=value((layer-1)*md3d.numberofgrids2d+1:layer*md3d.numberofgrids2d,:);
     34if size(value,1)==md3d.numberofnodes,
     35        projection_value=value((layer-1)*md3d.numberofnodes2d+1:layer*md3d.numberofnodes2d,:);
    3636else
    3737        projection_value=value((layer-1)*md3d.numberofelements2d+1:layer*md3d.numberofelements2d,:);
  • issm/trunk/src/m/model/project3d.m

    r2823 r8298  
    33%
    44%   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
    5 %   This vector can be a grid vector of size (md3d.numberofgrids2d,N/A) or an
     5%   This vector can be a node vector of size (md3d.numberofnodes2d,N/A) or an
    66%   element vector of size (md3d.numberofelements2d,N/A).
    77%   type is 'element' or 'node'. layer an optional layer number where vector
     
    2323if strcmpi(type,'node'),
    2424
    25         projected_vector=zeros(md3d.numberofgrids,size(vector2d,2));
     25        projected_vector=zeros(md3d.numberofnodes,size(vector2d,2));
    2626       
    2727        if layer==0,
    2828                for i=1:md3d.numlayers,
    29                         projected_vector(((i-1)*md3d.numberofgrids2d+1):(i*md3d.numberofgrids2d),:)=vector2d;
     29                        projected_vector(((i-1)*md3d.numberofnodes2d+1):(i*md3d.numberofnodes2d),:)=vector2d;
    3030                end
    3131        else
    32                 projected_vector(((layer-1)*md3d.numberofgrids2d+1):(layer*md3d.numberofgrids2d),:)=vector2d;
     32                projected_vector(((layer-1)*md3d.numberofnodes2d+1):(layer*md3d.numberofnodes2d),:)=vector2d;
    3333        end
    3434else
  • issm/trunk/src/m/model/removeholes.m

    r1236 r8298  
    33%
    44%   as its name indicates, this routine takes a model, a field (value of some
    5 %   physical quantity evaluated at the mesh grids) of the model, and interpolates this field
     5%   physical quantity evaluated at the mesh nodes) of the model, and interpolates this field
    66%   on the model mesh, without any hole.
    77%
  • issm/trunk/src/m/model/setelementstype.m

    r6713 r8298  
    7575
    7676%1: Hutter elements
    77 gridonhutter=zeros(md.numberofgrids,1);
    78 gridonhutter(md.elements(find(hutterflag),:))=1;
    79 md.gridonhutter=gridonhutter;
     77nodeonhutter=zeros(md.numberofnodes,1);
     78nodeonhutter(md.elements(find(hutterflag),:))=1;
     79md.nodeonhutter=nodeonhutter;
    8080md.elements_type(find(hutterflag))=HutterApproximationEnum();
    8181
    8282%2: MacAyeal elements
    83 gridonmacayeal=zeros(md.numberofgrids,1);
    84 gridonmacayeal(md.elements(find(macayealflag),:))=1;
    85 md.gridonmacayeal=gridonmacayeal;
     83nodeonmacayeal=zeros(md.numberofnodes,1);
     84nodeonmacayeal(md.elements(find(macayealflag),:))=1;
     85md.nodeonmacayeal=nodeonmacayeal;
    8686md.elements_type(find(macayealflag))=MacAyealApproximationEnum();
    8787
    8888%3: Pattyn elements
    89 gridonpattyn=zeros(md.numberofgrids,1);
    90 gridonpattyn(md.elements(find(pattynflag),:))=1;
    91 md.gridonpattyn=gridonpattyn;
     89nodeonpattyn=zeros(md.numberofnodes,1);
     90nodeonpattyn(md.elements(find(pattynflag),:))=1;
     91md.nodeonpattyn=nodeonpattyn;
    9292md.elements_type(find(pattynflag))=PattynApproximationEnum();
    9393
     
    9595%First modify stokesflag to get rid of elements contrained everywhere (spc + border with pattyn or macayeal)
    9696if any(stokesflag),
    97         gridonstokes=zeros(md.numberofgrids,1);
    98         gridonstokes(md.elements(find(stokesflag),:))=1;
    99         fullspcnodes=double(sum(md.spcvelocity(:,1:3),2)==3 | (gridonpattyn & gridonstokes));         %find all the grids on the boundary of the domain without icefront
    100         fullspcelems=double(sum(fullspcnodes(md.elements),2)==6);         %find all the grids on the boundary of the domain without icefront
     97        nodeonstokes=zeros(md.numberofnodes,1);
     98        nodeonstokes(md.elements(find(stokesflag),:))=1;
     99        fullspcnodes=double(sum(md.spcvelocity(:,1:3),2)==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
     100        fullspcelems=double(sum(fullspcnodes(md.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
    101101        stokesflag(find(fullspcelems))=0;
    102102end
    103 gridonstokes=zeros(md.numberofgrids,1);
    104 gridonstokes(md.elements(find(stokesflag),:))=1;
    105 md.gridonstokes=gridonstokes;
     103nodeonstokes=zeros(md.numberofnodes,1);
     104nodeonstokes(md.elements(find(stokesflag),:))=1;
     105md.nodeonstokes=nodeonstokes;
    106106md.elements_type(find(stokesflag))=StokesApproximationEnum();
    107107
     
    110110        if any(pattynflag), %fill with pattyn
    111111                pattynflag(~stokesflag)=1;
    112                 gridonpattyn(md.elements(find(pattynflag),:))=1;
    113                 md.gridonpattyn=gridonpattyn;
     112                nodeonpattyn(md.elements(find(pattynflag),:))=1;
     113                md.nodeonpattyn=nodeonpattyn;
    114114                md.elements_type(find(~stokesflag))=PattynApproximationEnum();
    115115        elseif any(macayealflag), %fill with macayeal
    116116                macayealflag(~stokesflag)=1;
    117                 gridonmacayeal(md.elements(find(macayealflag),:))=1;
    118                 md.gridonmacayeal=gridonmacayeal;
     117                nodeonmacayeal(md.elements(find(macayealflag),:))=1;
     118                md.nodeonmacayeal=nodeonmacayeal;
    119119                md.elements_type(find(~stokesflag))=MacAyealApproximationEnum();
    120120        else %fill with none
     
    126126%Now take care of the coupling between MacAyeal and Pattyn
    127127md.penalties=[];
    128 gridonmacayealpattyn=zeros(md.numberofgrids,1);
    129 gridonpattynstokes=zeros(md.numberofgrids,1);
    130 gridonmacayealstokes=zeros(md.numberofgrids,1);
     128nodeonmacayealpattyn=zeros(md.numberofnodes,1);
     129nodeonpattynstokes=zeros(md.numberofnodes,1);
     130nodeonmacayealstokes=zeros(md.numberofnodes,1);
    131131if strcmpi(coupling_method,'penalties'),
    132         %Create the border grids between Pattyn and MacAyeal and extrude them
    133         numgrids2d=md.numberofgrids2d;
     132        %Create the border nodes between Pattyn and MacAyeal and extrude them
     133        numnodes2d=md.numberofnodes2d;
    134134        numlayers=md.numlayers;
    135         bordergrids2d=find(gridonpattyn(1:numgrids2d) & gridonmacayeal(1:numgrids2d)); %Grids connected to two different types of elements
     135        bordernodes2d=find(nodeonpattyn(1:numnodes2d) & nodeonmacayeal(1:numnodes2d)); %Nodes connected to two different types of elements
    136136
    137137        %initialize and fill in penalties structure
    138         if ~isnan(bordergrids2d),
     138        if ~isnan(bordernodes2d),
    139139                penalties=[];
    140140                for     i=1:numlayers-1,
    141                         penalties=[penalties; [bordergrids2d bordergrids2d+md.numberofgrids2d*(i)]];
     141                        penalties=[penalties; [bordernodes2d bordernodes2d+md.numberofnodes2d*(i)]];
    142142                end
    143143                md.penalties=penalties;
     
    145145elseif strcmpi(coupling_method,'tiling'),
    146146        if any(macayealflag) & any(pattynflag), %coupling macayeal pattyn
    147                 %Find grid at the border
    148                 gridonmacayealpattyn(find(gridonmacayeal & gridonpattyn))=1;
     147                %Find node at the border
     148                nodeonmacayealpattyn(find(nodeonmacayeal & nodeonpattyn))=1;
    149149                %Macayeal elements in contact with this layer become MacAyealPattyn elements
    150                 matrixelements=ismember(md.elements,find(gridonmacayealpattyn));
     150                matrixelements=ismember(md.elements,find(nodeonmacayealpattyn));
    151151                commonelements=sum(matrixelements,2)~=0;
    152152                commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
     
    154154                macayealpattynflag=zeros(md.numberofelements,1);
    155155                macayealpattynflag(find(commonelements))=1;
    156                 gridonmacayeal=zeros(md.numberofgrids,1);
    157                 gridonmacayeal(md.elements(find(macayealflag),:))=1;
    158                 md.gridonmacayeal=gridonmacayeal;
     156                nodeonmacayeal=zeros(md.numberofnodes,1);
     157                nodeonmacayeal(md.elements(find(macayealflag),:))=1;
     158                md.nodeonmacayeal=nodeonmacayeal;
    159159
    160160                %Create MacaAyealPattynApproximation where needed
    161161                md.elements_type(find(macayealpattynflag))=MacAyealPattynApproximationEnum();
    162162
    163                 %Now recreate gridonmacayeal and gridonmacayealpattyn
    164                 gridonmacayealpattyn(md.elements(find(macayealpattynflag),:))=1;
     163                %Now recreate nodeonmacayeal and nodeonmacayealpattyn
     164                nodeonmacayealpattyn(md.elements(find(macayealpattynflag),:))=1;
    165165        elseif any(pattynflag) & any(stokesflag), %coupling pattyn stokes
    166                 %Find grid at the border
    167                 gridonpattynstokes(find(gridonpattyn & gridonstokes))=1;
     166                %Find node at the border
     167                nodeonpattynstokes(find(nodeonpattyn & nodeonstokes))=1;
    168168                %Stokes elements in contact with this layer become PattynStokes elements
    169                 matrixelements=ismember(md.elements,find(gridonpattynstokes));
     169                matrixelements=ismember(md.elements,find(nodeonpattynstokes));
    170170                commonelements=sum(matrixelements,2)~=0;
    171171                commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
     
    173173                pattynstokesflag=zeros(md.numberofelements,1);
    174174                pattynstokesflag(find(commonelements))=1;
    175                 gridonstokes=zeros(md.numberofgrids,1);
    176                 gridonstokes(md.elements(find(stokesflag),:))=1;
    177                 md.gridonstokes=gridonstokes;
     175                nodeonstokes=zeros(md.numberofnodes,1);
     176                nodeonstokes(md.elements(find(stokesflag),:))=1;
     177                md.nodeonstokes=nodeonstokes;
    178178
    179179                %Create MacaAyealPattynApproximation where needed
    180180                md.elements_type(find(pattynstokesflag))=PattynStokesApproximationEnum();
    181181
    182                 %Now recreate gridonpattynstokes
    183                 gridonpattynstokes=zeros(md.numberofgrids,1);
    184                 gridonpattynstokes(md.elements(find(pattynstokesflag),:))=1;
     182                %Now recreate nodeonpattynstokes
     183                nodeonpattynstokes=zeros(md.numberofnodes,1);
     184                nodeonpattynstokes(md.elements(find(pattynstokesflag),:))=1;
    185185        elseif any(stokesflag) & any(macayealflag),
    186                 %Find grid at the border
    187                 gridonmacayealstokes(find(gridonmacayeal & gridonstokes))=1;
     186                %Find node at the border
     187                nodeonmacayealstokes(find(nodeonmacayeal & nodeonstokes))=1;
    188188                %Stokes elements in contact with this layer become MacAyealStokes elements
    189                 matrixelements=ismember(md.elements,find(gridonmacayealstokes));
     189                matrixelements=ismember(md.elements,find(nodeonmacayealstokes));
    190190                commonelements=sum(matrixelements,2)~=0;
    191191                commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
     
    193193                macayealstokesflag=zeros(md.numberofelements,1);
    194194                macayealstokesflag(find(commonelements))=1;
    195                 gridonstokes=zeros(md.numberofgrids,1);
    196                 gridonstokes(md.elements(find(stokesflag),:))=1;
    197                 md.gridonstokes=gridonstokes;
     195                nodeonstokes=zeros(md.numberofnodes,1);
     196                nodeonstokes(md.elements(find(stokesflag),:))=1;
     197                md.nodeonstokes=nodeonstokes;
    198198
    199199                %Create MacaAyealMacAyealApproximation where needed
    200200                md.elements_type(find(macayealstokesflag))=MacAyealStokesApproximationEnum();
    201201
    202                 %Now recreate gridonmacayealstokes
    203                 gridonmacayealstokes=zeros(md.numberofgrids,1);
    204                 gridonmacayealstokes(md.elements(find(macayealstokesflag),:))=1;
     202                %Now recreate nodeonmacayealstokes
     203                nodeonmacayealstokes=zeros(md.numberofnodes,1);
     204                nodeonmacayealstokes(md.elements(find(macayealstokesflag),:))=1;
    205205        elseif any(stokesflag) & any(hutterflag),
    206206                error('type of coupling not supported yet');
     
    209209
    210210%Create vertices_type
    211 md.vertices_type=zeros(md.numberofgrids,1);
    212 pos=find(gridonhutter);
     211md.vertices_type=zeros(md.numberofnodes,1);
     212pos=find(nodeonhutter);
    213213md.vertices_type(pos)=HutterApproximationEnum();
    214 pos=find(gridonmacayeal);
     214pos=find(nodeonmacayeal);
    215215md.vertices_type(pos)=MacAyealApproximationEnum();
    216 pos=find(gridonpattyn);
     216pos=find(nodeonpattyn);
    217217md.vertices_type(pos)=PattynApproximationEnum();
    218 pos=find(gridonhutter);
     218pos=find(nodeonhutter);
    219219md.vertices_type(pos)=HutterApproximationEnum();
    220 pos=find(gridonpattyn & gridonmacayeal);
     220pos=find(nodeonpattyn & nodeonmacayeal);
    221221md.vertices_type(pos)=PattynApproximationEnum();
    222 pos=find(gridonmacayealpattyn);
     222pos=find(nodeonmacayealpattyn);
    223223md.vertices_type(pos)=MacAyealPattynApproximationEnum();
    224 pos=find(gridonstokes);
     224pos=find(nodeonstokes);
    225225md.vertices_type(pos)=StokesApproximationEnum();
    226226if any(stokesflag),
    227         pos=find(~gridonstokes);
     227        pos=find(~nodeonstokes);
    228228        if(~any(pattynflag) & ~any(macayealflag)),
    229229                md.vertices_type(pos)=NoneApproximationEnum();
    230230        end
    231231end
    232 pos=find(gridonpattynstokes);
     232pos=find(nodeonpattynstokes);
    233233md.vertices_type(pos)=PattynStokesApproximationEnum();
    234 pos=find(gridonmacayealstokes);
     234pos=find(nodeonmacayealstokes);
    235235md.vertices_type(pos)=MacAyealStokesApproximationEnum();
    236236
  • issm/trunk/src/m/model/slope.m

    r3994 r8298  
    88if (md.dim==2),
    99        numberofelements=md.numberofelements;
    10         numberofgrids=md.numberofgrids;
     10        numberofnodes=md.numberofnodes;
    1111        index=md.elements;
    1212        x=md.x; y=md.y; z=md.z;
    1313else
    1414        numberofelements=md.numberofelements2d;
    15         numberofgrids=md.numberofgrids2d;
     15        numberofnodes=md.numberofnodes2d;
    1616        index=md.elements2d;
    1717        x=md.x2d; y=md.y2d; z=md.z2d;
  • issm/trunk/src/m/model/thicknessevolution.m

    r1748 r8298  
    99%      dhdt=thicknessevolution(md)
    1010
    11 if (length(md.vx)~=md.numberofgrids)|(length(md.vy)~=md.numberofgrids)
    12         error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.numberofgrids)])
     11if (length(md.vx)~=md.numberofnodes)|(length(md.vy)~=md.numberofnodes)
     12        error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.numberofnodes)])
    1313end
    1414
  • issm/trunk/src/m/model/tres.m

    r8108 r8298  
    2626                        md.vz=PatchToVec(md.results.DiagnosticSolution.Vz);
    2727                else
    28                         md.vz=zeros(md.numberofgrids,1);
     28                        md.vz=zeros(md.numberofnodes,1);
    2929                end
    3030        end
  • issm/trunk/src/m/qmu/importancefactors.m

    r5244 r8298  
    5151
    5252%weight importancefactors by area
    53 %if numel(factors)==md.numberofgrids,
     53%if numel(factors)==md.numberofnodes,
    5454%       %get areas for each vertex.
    5555%       aire=GetAreas(md.elements,md.x,md.y);
    5656%       num_elements_by_node=md.nodeconnectivity(:,end);
    57 %       grid_aire=zeros(md.numberofgrids,1);
    58 %       for i=1:md.numberofgrids,
     57%       grid_aire=zeros(md.numberofnodes,1);
     58%       for i=1:md.numberofnodes,
    5959%               for j=1:num_elements_by_node(i),
    6060%                       grid_aire(i)=grid_aire(i)+aire(md.nodeconnectivity(i,j));
  • issm/trunk/src/m/utils/Analysis/resetspcs.m

    r2995 r8298  
    33        resolution=20000; x_ellsworth=-1.24*10^6; y_ellsworth=1*10^5;
    44        pos=find((md.x>(x_ellsworth-resolution)) & (md.x<(x_ellsworth+resolution)) & (md.y>(y_ellsworth-resolution)) & (md.y<(y_ellsworth+resolution)));
    5         md.spcvelocity=zeros(md.numberofgrids,6);
     5        md.spcvelocity=zeros(md.numberofnodes,6);
    66        md.spcvelocity(pos,1:3)=1;
    77
  • issm/trunk/src/m/utils/BC/SetIceSheetBC.m

    r8232 r8298  
    77%   See also: SETICESHELFBC, SETMARINEICESHEETBC
    88
    9 %grid on Dirichlet
    10 pos=find(md.gridonboundary);
    11 md.spcvelocity=zeros(md.numberofgrids,6);
     9%node on Dirichlet
     10pos=find(md.nodeonboundary);
     11md.spcvelocity=zeros(md.numberofnodes,6);
    1212md.spcvelocity(pos,1:3)=1;
    13 md.diagnostic_ref=NaN*ones(md.numberofgrids,6);
     13md.diagnostic_ref=NaN*ones(md.numberofnodes,6);
    1414
    1515%Dirichlet Values
    16 if (length(md.vx_obs)==md.numberofgrids & length(md.vy_obs)==md.numberofgrids)
     16if (length(md.vx_obs)==md.numberofnodes & length(md.vy_obs)==md.numberofnodes)
    1717        disp('      boundary conditions for diagnostic model: spc set as observed velocities');
    1818        md.spcvelocity(:,4:5)=[md.vx_obs md.vy_obs]; %vz is zero
     
    3030%Create zeros melting_rate and accumulation_rate if not specified
    3131if isnan(md.accumulation_rate),
    32         md.accumulation_rate=zeros(md.numberofgrids,1);
     32        md.accumulation_rate=zeros(md.numberofnodes,1);
    3333        disp('      no accumulation_rate specified: values set as zero');
    3434end
    3535if isnan(md.melting_rate),
    36         md.melting_rate=zeros(md.numberofgrids,1);
     36        md.melting_rate=zeros(md.numberofnodes,1);
    3737        disp('      no melting_rate specified: values set as zero');
    3838end
    3939if isnan(md.dhdt),
    40         md.dhdt=zeros(md.numberofgrids,1);
     40        md.dhdt=zeros(md.numberofnodes,1);
    4141        disp('      no dhdt specified: values set as zero');
    4242end
    4343
    44 md.spcthickness=zeros(md.numberofgrids,2);
     44md.spcthickness=zeros(md.numberofnodes,2);
    4545
    46 if (length(md.observed_temperature)==md.numberofgrids),
    47         md.spctemperature=[md.gridonsurface md.observed_temperature]; %impose observed temperature on surface
    48         if (length(md.geothermalflux)~=md.numberofgrids),
    49                 md.geothermalflux=50*10^-3*ones(md.numberofgrids,1); %50 mW/m^2
     46if (length(md.observed_temperature)==md.numberofnodes),
     47        md.spctemperature=[md.nodeonsurface md.observed_temperature]; %impose observed temperature on surface
     48        if (length(md.geothermalflux)~=md.numberofnodes),
     49                md.geothermalflux=50*10^-3*ones(md.numberofnodes,1); %50 mW/m^2
    5050        end
    5151else
  • issm/trunk/src/m/utils/BC/SetIceShelfBC.m

    r8232 r8298  
    1515%   See also: SETICESHEETBC, SETMARINEICESHEETBC
    1616
    17 %grid on Dirichlet (boundary and ~icefront)
     17%node on Dirichlet (boundary and ~icefront)
    1818if nargin==2,
    1919        icefrontfile=varargin{1};
    2020        if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
    21         gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
    22         gridonicefront=double(md.gridonboundary & gridinsideicefront);
     21        nodeinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
     22        nodeonicefront=double(md.nodeonboundary & nodeinsideicefront);
    2323elseif nargin==1,
    24         gridonicefront=zeros(md.numberofgrids,1);
     24        nodeonicefront=zeros(md.numberofnodes,1);
    2525else
    2626        help SetIceShelfBC
    2727        error('bad usage');
    2828end
    29 pos=find(md.gridonboundary & ~gridonicefront);
    30 md.spcvelocity=zeros(md.numberofgrids,6);
     29pos=find(md.nodeonboundary & ~nodeonicefront);
     30md.spcvelocity=zeros(md.numberofnodes,6);
    3131md.spcvelocity(pos,1:3)=1;
    32 md.diagnostic_ref=NaN*ones(md.numberofgrids,6);
     32md.diagnostic_ref=NaN*ones(md.numberofnodes,6);
    3333
    3434%Dirichlet Values
    35 if (length(md.vx_obs)==md.numberofgrids & length(md.vy_obs)==md.numberofgrids)
     35if (length(md.vx_obs)==md.numberofnodes & length(md.vy_obs)==md.numberofnodes)
    3636        disp('      boundary conditions for diagnostic model: spc set as observed velocities');
    3737        md.spcvelocity(pos,4:5)=[md.vx_obs(pos) md.vy_obs(pos)]; %zeros for vz
     
    4242%segment on Ice Front
    4343%segment on Neumann (Ice Front)
    44 pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
     44pos=find(nodeonicefront(md.segments(:,1)) | nodeonicefront(md.segments(:,2)));
    4545if (md.dim==2)
    4646        pressureload=md.segments(pos,:);
    4747elseif md.dim==3
    48         pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofgrids2d  md.segments(pos,1)+md.numberofgrids2d  md.segments(pos,3)];
     48        pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofnodes2d  md.segments(pos,1)+md.numberofnodes2d  md.segments(pos,3)];
    4949        pressureload=[];
    5050        for i=1:md.numlayers-1,
    51                 pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.numberofgrids2d pressureload_layer1(:,5)+(i-1)*md.numberofelements2d ];
     51                pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.numberofnodes2d pressureload_layer1(:,5)+(i-1)*md.numberofelements2d ];
    5252        end
    5353end
     
    6161%Create zeros melting_rate and accumulation_rate if not specified
    6262if isnan(md.accumulation_rate),
    63         md.accumulation_rate=zeros(md.numberofgrids,1);
     63        md.accumulation_rate=zeros(md.numberofnodes,1);
    6464        disp('      no accumulation_rate specified: values set as zero');
    6565end
    6666if isnan(md.melting_rate),
    67         md.melting_rate=zeros(md.numberofgrids,1);
     67        md.melting_rate=zeros(md.numberofnodes,1);
    6868        disp('      no melting_rate specified: values set as zero');
    6969end
    7070if isnan(md.dhdt),
    71         md.dhdt=zeros(md.numberofgrids,1);
     71        md.dhdt=zeros(md.numberofnodes,1);
    7272        disp('      no dhdt specified: values set as zero');
    7373end
    7474
    75 md.spcthickness=zeros(md.numberofgrids,2);
     75md.spcthickness=zeros(md.numberofnodes,2);
    7676
    77 if (length(md.observed_temperature)==md.numberofgrids),
    78         md.spctemperature=[md.gridonsurface md.observed_temperature]; %impose observed temperature on surface
    79         if (length(md.geothermalflux)~=md.numberofgrids),
    80                 md.geothermalflux=zeros(md.numberofgrids,1);
     77if (length(md.observed_temperature)==md.numberofnodes),
     78        md.spctemperature=[md.nodeonsurface md.observed_temperature]; %impose observed temperature on surface
     79        if (length(md.geothermalflux)~=md.numberofnodes),
     80                md.geothermalflux=zeros(md.numberofnodes,1);
    8181        end
    8282else
  • issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m

    r8232 r8298  
    1616%   See also: SETICESHELFBC, SETMARINEICESHEETBC
    1717
    18 %grid on Dirichlet (boundary and ~icefront)
     18%node on Dirichlet (boundary and ~icefront)
    1919if nargin==2,
    2020        %User provided Front.exp, use it
     
    2323                error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
    2424        end
    25         gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
    26         gridonicefront=double(md.gridonboundary & gridinsideicefront);
     25        nodeinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
     26        nodeonicefront=double(md.nodeonboundary & nodeinsideicefront);
    2727else
    2828        %Guess where the ice front is
    29         gridoniceshelf=zeros(md.numberofgrids,1);
    30         gridoniceshelf(md.elements(find(md.elementoniceshelf),:))=1;
    31         gridonicefront=double(md.gridonboundary & gridoniceshelf);
     29        nodeoniceshelf=zeros(md.numberofnodes,1);
     30        nodeoniceshelf(md.elements(find(md.elementoniceshelf),:))=1;
     31        nodeonicefront=double(md.nodeonboundary & nodeoniceshelf);
    3232end
    33 pos=find(md.gridonboundary & ~gridonicefront);
     33pos=find(md.nodeonboundary & ~nodeonicefront);
    3434if isempty(pos),
    3535        warning('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually')
    3636end
    37 md.spcvelocity=zeros(md.numberofgrids,6);
     37md.spcvelocity=zeros(md.numberofnodes,6);
    3838md.spcvelocity(pos,1:3)=1;
    39 md.diagnostic_ref=NaN*ones(md.numberofgrids,6);
     39md.diagnostic_ref=NaN*ones(md.numberofnodes,6);
    4040
    4141%Dirichlet Values
    42 if (length(md.vx_obs)==md.numberofgrids & length(md.vy_obs)==md.numberofgrids)
     42if (length(md.vx_obs)==md.numberofnodes & length(md.vy_obs)==md.numberofnodes)
    4343        disp('      boundary conditions for diagnostic model: spc set as observed velocities');
    4444        md.spcvelocity(pos,4:5)=[md.vx_obs(pos) md.vy_obs(pos)]; %zeros for vz
     
    4747end
    4848
    49 md.spcwatercolumn=zeros(md.numberofgrids,2);
    50 pos=find(md.gridonboundary);
     49md.spcwatercolumn=zeros(md.numberofnodes,2);
     50pos=find(md.nodeonboundary);
    5151md.spcwatercolumn(pos,1)=1;
    5252
    5353%segment on Neumann (Ice Front)
    54 pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
     54pos=find(nodeonicefront(md.segments(:,1)) | nodeonicefront(md.segments(:,2)));
    5555if (md.dim==2)
    5656        pressureload=md.segments(pos,:);
    5757elseif md.dim==3
    58         pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofgrids2d  md.segments(pos,1)+md.numberofgrids2d  md.segments(pos,3)];
     58        pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofnodes2d  md.segments(pos,1)+md.numberofnodes2d  md.segments(pos,3)];
    5959        pressureload=[];
    6060        for i=1:md.numlayers-1,
    61                 pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.numberofgrids2d pressureload_layer1(:,5)+(i-1)*md.numberofelements2d ];
     61                pressureload=[pressureload ;pressureload_layer1(:,1:4)+(i-1)*md.numberofnodes2d pressureload_layer1(:,5)+(i-1)*md.numberofelements2d ];
    6262        end
    6363end
     
    7171%Create zeros melting_rate and accumulation_rate if not specified
    7272if isnan(md.accumulation_rate),
    73         md.accumulation_rate=zeros(md.numberofgrids,1);
     73        md.accumulation_rate=zeros(md.numberofnodes,1);
    7474        disp('      no accumulation_rate specified: values set as zero');
    7575end
    7676if isnan(md.melting_rate),
    77         md.melting_rate=zeros(md.numberofgrids,1);
     77        md.melting_rate=zeros(md.numberofnodes,1);
    7878        disp('      no melting_rate specified: values set as zero');
    7979end
    8080if isnan(md.dhdt),
    81         md.dhdt=zeros(md.numberofgrids,1);
     81        md.dhdt=zeros(md.numberofnodes,1);
    8282        disp('      no dhdt specified: values set as zero');
    8383end
    8484
    85 md.spcthickness=zeros(md.numberofgrids,2);
     85md.spcthickness=zeros(md.numberofnodes,2);
    8686
    87 if (length(md.observed_temperature)==md.numberofgrids),
    88         md.spctemperature=[md.gridonsurface md.observed_temperature]; %impose observed temperature on surface
    89         if (length(md.geothermalflux)~=md.numberofgrids),
    90                 md.geothermalflux=zeros(md.numberofgrids,1);
    91                 md.geothermalflux(find(md.gridonicesheet))=50*10^-3; %50mW/m2
     87if (length(md.observed_temperature)==md.numberofnodes),
     88        md.spctemperature=[md.nodeonsurface md.observed_temperature]; %impose observed temperature on surface
     89        if (length(md.geothermalflux)~=md.numberofnodes),
     90                md.geothermalflux=zeros(md.numberofnodes,1);
     91                md.geothermalflux(find(md.nodeonicesheet))=50*10^-3; %50mW/m2
    9292        end
    9393else
  • issm/trunk/src/m/utils/DataProcessing/TracksToMatrix.m

    r6860 r8298  
    7272
    7373%Create design site(points where we are looking for the data)
    74 Points=gridsamp([x_f(1)+posting/2,y_f(1)+posting/2;x_f(end)-posting/2,y_f(end)-posting/2],[length(x_f)-1;length(y_f)-1]);
     74Points=nodesamp([x_f(1)+posting/2,y_f(1)+posting/2;x_f(end)-posting/2,y_f(end)-posting/2],[length(x_f)-1;length(y_f)-1]);
    7575
    7676%Compute data on these points
  • issm/trunk/src/m/utils/Ecco3/ecco32issm.m

    r8103 r8298  
    1 function gridfield=ecco32issm(field,transition,xecco3,yecco3)
     1function nodefield=ecco32issm(field,transition,xecco3,yecco3)
    22
    33        xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
    4         gridfieldlinear=zeros(length(xecco3linear),1);
    5         gridfieldlinear(transition(:,1))=field(transition(:,2));
    6         gridfield=xecco3;
    7         gridfield(:)=gridfieldlinear;
    8         %gridfield=gridfield'; %not sure we need that
     4        nodefieldlinear=zeros(length(xecco3linear),1);
     5        nodefieldlinear(transition(:,1))=field(transition(:,2));
     6        nodefield=xecco3;
     7        nodefield(:)=nodefieldlinear;
     8        %nodefield=nodefield'; %not sure we need that
  • issm/trunk/src/m/utils/Ecco3/issm2ecco3.m

    r6205 r8298  
    1 function gridfield=issm2ecco3(field,transition,xecco3,yecco3)
     1function nodefield=issm2ecco3(field,transition,xecco3,yecco3)
    22
    33        xecco3linear=xecco3(:); yecco3linear=yecco3(:); %linearize
    4         gridfieldlinear=zeros(length(xecco3linear),1);
    5         gridfieldlinear(transition(:,1))=field(transition(:,2));
    6         gridfield=xecco3;
    7         gridfield(:)=gridfieldlinear;
    8         %gridfield=gridfield'; %not sure we need that
     4        nodefieldlinear=zeros(length(xecco3linear),1);
     5        nodefieldlinear(transition(:,1))=field(transition(:,2));
     6        nodefield=xecco3;
     7        nodefield(:)=nodefieldlinear;
     8        %nodefield=nodefield'; %not sure we need that
  • issm/trunk/src/m/utils/Exp/expcontract.m

    r2317 r8298  
    1 function normal_grid=expcontract(newfile,oldfile,distance)
     1function normal_node=expcontract(newfile,oldfile,distance)
    22%EXPCONTRACT - contract or expand a profile, according to the normal.
    33%
     
    1212
    1313normal=zeros(num-1,2);
    14 normal_grid=zeros(num-1,2);
     14normal_node=zeros(num-1,2);
    1515
    1616for i=1:num-1,
     
    1919end
    2020
    21 normal_grid(2:end,:)=[normal(1:end-1,:)+normal(2:end,:)];
    22 normal_grid(1,:)=normal(1,:)+normal(end,:);
     21normal_node(2:end,:)=[normal(1:end-1,:)+normal(2:end,:)];
     22normal_node(1,:)=normal(1,:)+normal(end,:);
    2323
    24 normal_grid_norm=sqrt(normal_grid(:,1).^2+normal_grid(:,2).^2);
    25 normal_grid(:,1)=normal_grid(:,1)./normal_grid_norm;
    26 normal_grid(:,2)=normal_grid(:,2)./normal_grid_norm;
     24normal_node_norm=sqrt(normal_node(:,1).^2+normal_node(:,2).^2);
     25normal_node(:,1)=normal_node(:,1)./normal_node_norm;
     26normal_node(:,2)=normal_node(:,2)./normal_node_norm;
    2727
    28 contour.x(1:end-1)=contour.x(1:end-1)+distance*normal_grid(:,1);
    29 contour.y(1:end-1)=contour.y(1:end-1)+distance*normal_grid(:,2);
     28contour.x(1:end-1)=contour.x(1:end-1)+distance*normal_node(:,1);
     29contour.y(1:end-1)=contour.y(1:end-1)+distance*normal_node(:,2);
    3030
    3131contour.x(end)=contour.x(1);
  • issm/trunk/src/m/utils/Exp/expcreatecircle.m

    r4994 r8298  
    1 function expcreatecircle(filename,x0,y0,radius,numberofgrids)
     1function expcreatecircle(filename,x0,y0,radius,numberofnodes)
    22%EXPCREATECIRCLE - create a circular contour corresponding to given parameters
    33%
    44%   Creates a closed argus contour centered on x,y of radius size.
    5 %   The contour is made of numberofgrids
     5%   The contour is made of numberofnodes
    66%
    77%   Usage:
    8 %      expcreatecircle(filename,x0,y0,radius,numberofgrids)
     8%      expcreatecircle(filename,x0,y0,radius,numberofnodes)
    99%
    1010%   See also EXPMASTER, EXPDOC
    1111
    1212%Calculate the cartesians coordinates of the points
    13 x_list=ones(numberofgrids+1,1);
    14 y_list=ones(numberofgrids+1,1);
     13x_list=ones(numberofnodes+1,1);
     14y_list=ones(numberofnodes+1,1);
    1515
    16 theta=(0:2*pi/numberofgrids:2*pi*(1-1/numberofgrids))';
     16theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
    1717theta=[theta;0];
    1818
  • issm/trunk/src/m/utils/Interp/FieldFindVarNames.m

    r2577 r8298  
    2929xenum=NaN; yenum=NaN; dataenum=NaN; indexenum=NaN;
    3030if length(A)==3,
    31         isgrid=1;
     31        isnode=1;
    3232        for i=1:3
    3333                if strcmpi(A(i).name(1),'x');
     
    4242        end
    4343elseif length(A)==4,
    44         isgrid=0;
     44        isnode=0;
    4545        for i=1:4
    4646                if strcmpi(A(i).name(1),'x');
     
    5757        end
    5858else
    59         error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for grids) OR 4 variables  x,y,index and data (for mesh))']);
     59        error(['FieldFindVarNames error message: file ' filename  ' not supported yet (it should hold 3 variables x,y and data (for nodes) OR 4 variables  x,y,index and data (for mesh))']);
    6060end
    6161
    6262%2: if only one item is missing, find it by elimination
    63 if ~isgrid,
     63if ~isnode,
    6464        pos=find(isnan([xenum yenum indexenum dataenum]));
    6565        if length(pos)==1,
     
    9595
    9696%find index
    97 if (~isgrid & isnan(indexenum)),
     97if (~isnode & isnan(indexenum)),
    9898        for i=1:4
    9999                lengthi=min(A(i).size);
     
    108108
    109109%4: last chance
    110 if ~isgrid,
     110if ~isnode,
    111111        pos=find(isnan([xenum yenum indexenum dataenum]));
    112112        if length(pos)==1,
     
    146146Names.yname=A(yenum).name;
    147147Names.dataname=A(dataenum).name;
    148 if ~isgrid,
     148if ~isnode,
    149149        Names.indexname=A(indexenum).name;
    150150        Names.interp='mesh';
    151151else
    152         Names.interp='grid';
     152        Names.interp='node';
    153153end
  • issm/trunk/src/m/utils/Interp/FillHole.m

    r7479 r8298  
    3434        end
    3535
    36         %search the grid on the closest to i, that is not in a hole either
     36        %search the node on the closest to i, that is not in a hole either
    3737        [d posd]=min(sqrt((x(pos_hole(i))-x_noholes).^2+(y(pos_hole(i))-y_noholes).^2));
    3838        field(pos_hole(i))=field_noholes(posd);
  • issm/trunk/src/m/utils/Interp/InterpFromFile.m

    r5192 r8298  
    3838Names=FieldFindVarNames(filename);
    3939Data=load(filename);
    40 if strcmpi(Names.interp,'grid'),
     40if strcmpi(Names.interp,'node'),
    4141        data_out=InterpFromGridToMesh(Data.(Names.xname),Data.(Names.yname),Data.(Names.dataname),x,y,default_value);
    4242else
  • issm/trunk/src/m/utils/Interp/VelFindVarNames.m

    r2574 r8298  
    2929xenum=NaN; yenum=NaN; vxenum=NaN; vyenum=NaN; indexenum=NaN;
    3030if length(A)==4,
    31         isgrid=1;
     31        isnode=1;
    3232        for i=1:4
    3333                if strcmpi(A(i).name(1),'x');
     
    4444        end
    4545elseif length(A)==5,
    46         isgrid=0;
     46        isnode=0;
    4747        for i=1:5
    4848                if strcmpi(A(i).name(1),'x');
     
    6161        end
    6262else
    63         error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for grids) OR 5 variables  x,y,index,vx and vy (for mesh))']);
     63        error(['VelFindVarNames error message: file ' filename  ' not supported yet (it should hold 4 variables x,y,vx and vy (for nodes) OR 5 variables  x,y,index,vx and vy (for mesh))']);
    6464end
    6565
     
    7070
    7171%find index
    72 if (~isgrid & isnan(indexenum)),
     72if (~isnode & isnan(indexenum)),
    7373        for i=1:5
    7474                lengthi=min(A(i).size);
     
    115115Names.vxname=A(vxenum).name;
    116116Names.vyname=A(vyenum).name;
    117 if ~isgrid,
     117if ~isnode,
    118118        Names.indexname=A(indexenum).name;
    119119        Names.interp='mesh';
    120120else
    121         Names.interp='grid';
     121        Names.interp='node';
    122122end
  • issm/trunk/src/m/utils/Interp/plugvelocities.m

    r2575 r8298  
    2828
    2929%Interpolation
    30 if strcmpi(Names.interp,'grid'),
     30if strcmpi(Names.interp,'node'),
    3131        md.vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.x,md.y,default_value);
    3232        md.vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.x,md.y,default_value);
  • issm/trunk/src/m/utils/Mesh/BamgCall.m

    r6860 r8298  
    2525%Compute metric
    2626t1=clock; fprintf('%s','      computing metric...');
    27 if length(md.gridonwater)==md.numberofgrids,
    28         pos=find(md.gridonwater);
     27if length(md.nodeonwater)==md.numberofnodes,
     28        pos=find(md.nodeonwater);
    2929else
    3030        pos=[];
     
    3636t1=clock; fprintf('%s','      writing initial mesh files...');
    3737fid=fopen('carre0.met','w');
    38 fprintf(fid,'%i %i\n',md.numberofgrids,3);
     38fprintf(fid,'%i %i\n',md.numberofnodes,3);
    3939fprintf(fid,'%i %i %i\n',metric');
    4040fclose(fid);
     
    4949
    5050%Vertices
    51 fprintf(fid,'\n%s\n%i\n\n','Vertices',md.numberofgrids);
    52 fprintf(fid,'%8g %8g %i\n',[md.x md.y ones(md.numberofgrids,1)]');
     51fprintf(fid,'\n%s\n%i\n\n','Vertices',md.numberofnodes);
     52fprintf(fid,'%8g %8g %i\n',[md.x md.y ones(md.numberofnodes,1)]');
    5353
    5454%Triangles
     
    7272md.z=zeros(A.nods,1);
    7373md.elements=A.index;
    74 md.numberofgrids=A.nods;
     74md.numberofnodes=A.nods;
    7575md.numberofelements=A.nels;
    7676numberofelements2=md.numberofelements;
  • issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m

    r6860 r8298  
    1717t1=clock; fprintf('%s','      writing initial mesh files...');
    1818fid=fopen('carre0.met','w');
    19 fprintf(fid,'%i %i\n',md.numberofgrids,3);
     19fprintf(fid,'%i %i\n',md.numberofnodes,3);
    2020fprintf(fid,'%i %i %i\n',metric');
    2121fclose(fid);
     
    3030
    3131%Vertices
    32 fprintf(fid,'\n%s\n%i\n\n','Vertices',md.numberofgrids);
    33 fprintf(fid,'%8g %8g %i\n',[md.x md.y ones(md.numberofgrids,1)]');
     32fprintf(fid,'\n%s\n%i\n\n','Vertices',md.numberofnodes);
     33fprintf(fid,'%8g %8g %i\n',[md.x md.y ones(md.numberofnodes,1)]');
    3434
    3535%Triangles
     
    5353md.z=zeros(A.nods,1);
    5454md.elements=A.index;
    55 md.numberofgrids=A.nods;
     55md.numberofnodes=A.nods;
    5656md.numberofelements=A.nels;
    5757numberofelements2=md.numberofelements;
  • issm/trunk/src/m/utils/Mesh/ComputeHessian.m

    r2923 r8298  
    1313
    1414%some variables
    15 numberofgrids=length(x);
     15numberofnodes=length(x);
    1616numberofelements=size(index,1);
    1717
    1818%some checks
    19 if length(field)~=numberofgrids & length(field)~=numberofelements,
     19if length(field)~=numberofnodes & length(field)~=numberofelements,
    2020        error('ComputeHessian error message: the given field size not supported yet');
    2121end
     
    3232areas=GetAreas(index,x,y);
    3333
    34 %comput weights that holds the volume of all the element holding the grid i
    35 weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofgrids,1);
     34%comput weights that holds the volume of all the element holding the node i
     35weights=sparse(line,ones(linesize,1),repmat(areas,3,1),numberofnodes,1);
    3636
    3737%compute field on nodes if on elements
    3838if length(field)==numberofelements,
    39         field=sparse(line,ones(linesize,1),repmat(areas.*field,3,1),numberofgrids,1)./weights ;
     39        field=sparse(line,ones(linesize,1),repmat(areas.*field,3,1),numberofnodes,1)./weights ;
    4040end
    4141
     
    4444grad_ely=sum(field(index).*beta,2);
    4545
    46 %Compute gradient for each grid (average of the elements around)
    47 gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofgrids,1);
    48 grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofgrids,1);
     46%Compute gradient for each node (average of the elements around)
     47gradx=sparse(line,ones(linesize,1),repmat(areas.*grad_elx,3,1),numberofnodes,1);
     48grady=sparse(line,ones(linesize,1),repmat(areas.*grad_ely,3,1),numberofnodes,1);
    4949gradx=gradx./weights;
    5050grady=grady./weights;
     
    5555if strcmpi(type,'node')
    5656        %Compute Hessian on the nodes (average of the elements around)
    57         hessian=[sparse(line,ones(linesize,1),repmat(areas.*hessian(:,1),3,1),numberofgrids,1)./weights ...
    58                 sparse(line,ones(linesize,1),repmat(areas.*hessian(:,2),3,1),numberofgrids,1)./weights ...
    59                 sparse(line,ones(linesize,1),repmat(areas.*hessian(:,3),3,1),numberofgrids,1)./weights ];
     57        hessian=[sparse(line,ones(linesize,1),repmat(areas.*hessian(:,1),3,1),numberofnodes,1)./weights ...
     58                sparse(line,ones(linesize,1),repmat(areas.*hessian(:,2),3,1),numberofnodes,1)./weights ...
     59                sparse(line,ones(linesize,1),repmat(areas.*hessian(:,3),3,1),numberofnodes,1)./weights ];
    6060end
  • issm/trunk/src/m/utils/Mesh/ComputeMetric.m

    r1346 r8298  
    77%
    88%   Example:
    9 %      metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,find(md.gridonwater)
     9%      metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,find(md.nodeonwater)
    1010
    1111%first, find the eigen values of eah line of H=[hessian(i,1) hessian(i,2); hessian(i,2)  hessian(i,3)]
  • issm/trunk/src/m/utils/Mesh/MeshQuality.m

    r2613 r8298  
    1717
    1818%Compute metric
    19 if length(md.gridonwater)==md.numberofgrids,
    20         pos=find(md.gridonwater);
     19if length(md.nodeonwater)==md.numberofnodes,
     20        pos=find(md.nodeonwater);
    2121else
    2222        pos=[];
     
    3535e3y=[y(index(:,1))-y(index(:,3))];
    3636
    37 %metric of each the 3 grids for each element
     37%metric of each the 3 nodes for each element
    3838M1=metric(index(:,1),:);
    3939M2=metric(index(:,2),:);
     
    6060lambda1=min(max(abs(lambda1)*scale/epsilon,1/hmax^2),1/hmin^2);
    6161lambda2=min(max(abs(lambda2)*scale/epsilon,1/hmax^2),1/hmin^2);
    62 if length(md.gridonwater)==md.numberofgrids;
    63         pos=find(md.gridonwater);
     62if length(md.nodeonwater)==md.numberofnodes;
     63        pos=find(md.nodeonwater);
    6464        lambda1(pos)=0;
    6565        lambda2(pos)=0;
  • issm/trunk/src/m/utils/Mesh/YamsCall.m

    r6860 r8298  
    2525%Compute metric
    2626t1=clock; fprintf('%s','      computing metric...');
    27 if length(md.gridonwater)==md.numberofgrids,
    28         pos=find(md.gridonwater);
     27if length(md.nodeonwater)==md.numberofnodes,
     28        pos=find(md.nodeonwater);
    2929else
    3030        pos=[];
     
    4646
    4747%Vertices
    48 fprintf(fid,'\n%s\n%i\n\n','Vertices',md.numberofgrids);
    49 fprintf(fid,'%8g %8g %i\n',[md.x md.y zeros(md.numberofgrids,1)]');
     48fprintf(fid,'\n%s\n%i\n\n','Vertices',md.numberofnodes);
     49fprintf(fid,'%8g %8g %i\n',[md.x md.y zeros(md.numberofnodes,1)]');
    5050
    5151%Triangles
     
    9292md.z=zeros(size(Coor,1),1);
    9393md.elements=Tria;
    94 md.numberofgrids=size(Coor,1);
     94md.numberofnodes=size(Coor,1);
    9595md.numberofelements=size(Tria,1);
    9696numberofelements2=md.numberofelements;
  • issm/trunk/src/m/utils/Mesh/argusmesh.m

    r3994 r8298  
    2929end
    3030
    31 %Read first line of the argus mesh: grid and element parameters
     31%Read first line of the argus mesh: node and element parameters
    3232[buffer,bytecount]=fscanf(fileid,'%i %i %i %i',[1 4]);
    3333if bytecount~=4,
     
    3737nods=buffer(2);
    3838num_element_parameters=buffer(3);
    39 num_grid_parameters=buffer(4);
    40 disp(['      argus model '''   root ''' contains ' num2str(nel) ' elements and ' num2str(nods) ' grids.']);
     39num_node_parameters=buffer(4);
     40disp(['      argus model '''   root ''' contains ' num2str(nel) ' elements and ' num2str(nods) ' nodes.']);
    4141
    42 %initialize elements and grids
     42%initialize elements and nodes
    4343elements=zeros(nel,3);
    4444element_parameters=zeros(nel,num_element_parameters);
     
    4646y=zeros(nods,1);
    4747z=zeros(nods,1);
    48 grid_parameters=zeros(nods,num_grid_parameters);
     48node_parameters=zeros(nods,num_node_parameters);
    4949
    50 %read grids:
     50%read nodes:
    5151format_string='%s %i %f %f ';
    52 for n=1:num_grid_parameters,
     52for n=1:num_node_parameters,
    5353        format_string=[format_string ' %i '];
    5454end
    5555
    5656for n=1:nods,
    57         [buffer,bytecount]=fscanf(fileid,format_string,[1,num_grid_parameters+4]);
     57        [buffer,bytecount]=fscanf(fileid,format_string,[1,num_node_parameters+4]);
    5858        x(n)=buffer(3);
    5959        y(n)=buffer(4);
    60         grid_parameters(n,:)=buffer(5:length(buffer));
     60        node_parameters(n,:)=buffer(5:length(buffer));
    6161end
    6262
     
    8181md.y=y;
    8282md.z=z;
    83 md.numberofgrids=size(md.x,1);
     83md.numberofnodes=size(md.x,1);
    8484md.numberofelements=size(md.elements,1);
    85 md.gridonbed=ones(md.numberofgrids,1);
    86 md.gridonsurface=ones(md.numberofgrids,1);
     85md.nodeonbed=ones(md.numberofnodes,1);
     86md.nodeonsurface=ones(md.numberofnodes,1);
    8787md.elementonbed=ones(md.numberofelements,1);
    8888md.elementonsurface=ones(md.numberofelements,1);
     
    9393md=addnote(md,notes);
    9494
    95 %Add segments and grids on boundary
     95%Add segments and nodes on boundary
    9696md.segments=findsegments(md);
    97 md.gridonboundary=zeros(md.numberofgrids,1);
    98 md.gridonboundary(md.segments(:,1))=1;
    99 md.gridonboundary(md.segments(:,2))=1;
     97md.nodeonboundary=zeros(md.numberofnodes,1);
     98md.nodeonboundary(md.segments(:,1))=1;
     99md.nodeonboundary(md.segments(:,2))=1;
  • issm/trunk/src/m/utils/Mesh/squaremesh.m

    r7101 r8298  
    5656segments(2*(ny-1)+(nx-1)+1:2*(nx-1)+2*(ny-1),:)=[[1:ny:(nx-2)*ny+1]' [ny+1:ny:ny*(nx-1)+1]' [1:2*(ny-1):2*(nx-2)*(ny-1)+1]'];
    5757
    58 %plug coordinates and grids
     58%plug coordinates and nodes
    5959md.x=x;
    6060md.y=y;
    6161md.z=zeros(nods,1);
    62 md.numberofgrids=nods;
    63 md.gridonboundary=zeros(nods,1);md.gridonboundary(segments(:,1:2))=1;
    64 md.gridonbed=ones(nods,1);
    65 md.gridonsurface=ones(nods,1);
     62md.numberofnodes=nods;
     63md.nodeonboundary=zeros(nods,1);md.nodeonboundary(segments(:,1:2))=1;
     64md.nodeonbed=ones(nods,1);
     65md.nodeonsurface=ones(nods,1);
    6666
    6767%plug elements
     
    7373
    7474%Now, build the connectivity tables for this mesh.
    75 md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofgrids);
     75md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
    7676md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
    7777
  • issm/trunk/src/m/utils/Mesh/zerothickness_icesheetfront.m

    r1754 r8298  
    1818segments_icesheet=segments(pos,:);
    1919
    20 %retrieve grids on ice sheet front
    21 grid_icesheetfront=intersect(segments_icesheet(:,1),segments_icesheet(:,2));
     20%retrieve nodes on ice sheet front
     21node_icesheetfront=intersect(segments_icesheet(:,1),segments_icesheet(:,2));
    2222
    2323%modify thickness, surface and bed to be a default value
    24 thickness(grid_icesheetfront)=default_value;
    25 bed(grid_icesheetfront)=surface(grid_icesheetfront)-thickness(grid_icesheetfront);
     24thickness(node_icesheetfront)=default_value;
     25bed(node_icesheetfront)=surface(node_icesheetfront)-thickness(node_icesheetfront);
    2626
  • issm/trunk/src/m/utils/Numerics/cfl_step.m

    r6129 r8298  
    1111
    1212%Check length of velocities
    13 if size(vx,1)~=md.numberofgrids & size(vy,1)~=md.numberofgrids,
    14         error('timestpes error message: size of velocity components must be the same as md.numberofgrids');
     13if size(vx,1)~=md.numberofnodes & size(vy,1)~=md.numberofnodes,
     14        error('timestpes error message: size of velocity components must be the same as md.numberofnodes');
    1515end
    1616
Note: See TracChangeset for help on using the changeset viewer.