Mercurial > repos > public > sbplib
view operator_def/read_stencil.m @ 830:e15a667ffde2 feature/operator_files
Add quadrature stencils and operator assembly. Add tests
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 10 Sep 2018 19:27:27 +0200 |
parents | 95c26000c0ba |
children |
line wrap: on
line source
function [stencil_variables] = read_stencil(stencil) fileID = fopen(stencil,'r'); line = fgetl(fileID); while ~feof(fileID) if isempty(line) elseif strcmp(line(1),'#') else varname = genvarname(line); val = []; line = fgetl(fileID); while ~isempty(str2num(line)) val = [val; str2num(line)]; line = fgets(fileID); if line == -1 break end end stencil_variables.(varname) = val; end line = fgetl(fileID); end end