view default_struct.m @ 740:f4e2a6a2df08 feature/poroelastic

Make computation of metric derivatives work for periodic.
author Martin Almquist <malmquist@stanford.edu>
date Mon, 07 May 2018 15:55:35 -0700
parents 46256fffa329
children
line wrap: on
line source

function default_struct(s, val)
    if evalin('caller',sprintf('~exist(''%s'',''var'')',s))
        given = [];
    else
        given = evalin('caller', s);
    end

    final = copyWithDefault(given, val);
    assignin('caller', s, final);
end