view default_field.m @ 1206:6b203030fb37 feature/poroelastic

Fix performance (full matrices) issues in ElasticVariableAnisotropic
author Martin Almquist <malmquist@stanford.edu>
date Sun, 15 Sep 2019 14:39:42 -0700
parents d1c13505182a
children
line wrap: on
line source

function default_field(s, f, val)
    if isfield(s,f) && ~isempty(s.(f))
        return
    end
    s.(f) = val;
    assignin('caller', inputname(1),s);
end