Changeset 24515


Ignore:
Timestamp:
01/14/20 12:43:54 (5 years ago)
Author:
tsantos
Message:

CHG: verification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/contrib/tsantos/remesh.m

    r22241 r24515  
    1 function mdOut = remesh(md,parfile)
     1function mdOut = remesh(md,parfile,time_step)
    22%Set the new mesh (refined) into the model md
     3if nargin<3,
     4        time_step=length(md.results.TransientSolution);
     5end
    36
    47NewModel = model;
     
    69% geometry
    710NewModel.mesh                           = mesh2d();
    8 NewModel.mesh.x                 = md.results.TransientSolution(end).MeshX;
    9 NewModel.mesh.y                 = md.results.TransientSolution(end).MeshY;
    10 NewModel.mesh.elements  = md.results.TransientSolution(end).MeshElements;
     11NewModel.mesh.x                 = md.results.TransientSolution(time_step).MeshX;
     12NewModel.mesh.y                 = md.results.TransientSolution(time_step).MeshY;
     13NewModel.mesh.elements  = md.results.TransientSolution(time_step).MeshElements;
    1114
    1215% build segments. CONVEX HULL: IT JUST WORKS FOR REGULAR MESHES, WITHOUT "BAYS"
     
    2831
    2932        if segments(s,3)==0,
    30                 error('Element not found!');
     33                %error('Element not found!');
    3134        end
    3235end
     
    5154
    5255% Setting initialization
    53 NewModel.initialization.vx                              = md.results.TransientSolution(end).Vx;
    54 NewModel.initialization.vy                              = md.results.TransientSolution(end).Vy;
     56NewModel.initialization.vx                              = md.results.TransientSolution(time_step).Vx;
     57NewModel.initialization.vy                              = md.results.TransientSolution(time_step).Vy;
    5558NewModel.initialization.vz                              = zeros(md.mesh.numberofvertices,1);
    56 NewModel.initialization.vel                     = md.results.TransientSolution(end).Vel;
    57 NewModel.initialization.pressure    = md.results.TransientSolution(end).Pressure;
    58 NewModel.geometry.surface                               = md.results.TransientSolution(end).Surface;
    59 NewModel.geometry.base                                  = md.results.TransientSolution(end).Base;
    60 NewModel.geometry.bed                                   = md.results.TransientSolution(end).Bed;%md.geometry.bed; %use from parameterize
    61 NewModel.geometry.thickness                     = md.results.TransientSolution(end).Thickness;
    62 NewModel.mask.groundedice_levelset  = md.results.TransientSolution(end).MaskGroundediceLevelset;
     59NewModel.initialization.vel                     = md.results.TransientSolution(time_step).Vel;
     60NewModel.initialization.pressure    = md.results.TransientSolution(time_step).Pressure;
     61NewModel.geometry.surface                               = md.results.TransientSolution(time_step).Surface;
     62NewModel.geometry.base                                  = md.results.TransientSolution(time_step).Base;
     63NewModel.geometry.bed                                   = md.results.TransientSolution(time_step).Bed;%md.geometry.bed; %use from parameterize
     64NewModel.geometry.thickness                     = md.results.TransientSolution(time_step).Thickness;
     65NewModel.mask.groundedice_levelset  = md.results.TransientSolution(time_step).MaskGroundediceLevelset;
    6366   
    6467%copy other data
Note: See TracChangeset for help on using the changeset viewer.