Commit ad02aca7 authored by Pierre Cazenave's avatar Pierre Cazenave

Cosmetic changes to better match the format of the other functions

parent 85154e0b
function [fieldout] = nodes2elems(fieldin,Mobj) function [fieldout] = nodes2elems(fieldin,Mobj)
% Transfer a field from vertices to elements % Transfer a field from vertices to elements
% %
% function [fieldout] = nodes2elems(fieldin,Mobj) % function [fieldout] = nodes2elems(fieldin, Mobj)
% %
% DESCRIPTION: % DESCRIPTION:
% Smooth a vertex based field % Transfer a field from vertices (nodes) to elements
% %
% INPUT % INPUT
% Mobj = Matlab mesh object % Mobj = Matlab mesh object
...@@ -15,36 +14,36 @@ function [fieldout] = nodes2elems(fieldin,Mobj) ...@@ -15,36 +14,36 @@ function [fieldout] = nodes2elems(fieldin,Mobj)
% fieldout = element-based field % fieldout = element-based field
% %
% EXAMPLE USAGE % EXAMPLE USAGE
% f = smoothfield(fv,Mobj) % f = smoothfield(fv, Mobj)
% %
% Author(s): % Author(s):
% Geoff Cowles (University of Massachusetts Dartmouth) % Geoff Cowles (University of Massachusetts Dartmouth)
% %
% Revision history % Revision history
% %
%============================================================================== %==========================================================================
subname = 'nodes2elems'; subname = 'nodes2elems';
global ftbverbose; global ftbverbose;
if(ftbverbose); if ftbverbose;
fprintf('\n') fprintf('\n')
fprintf(['begin : ' subname '\n']) fprintf(['begin : ' subname '\n'])
end; end
%------------------------------------------------------------------------------ %--------------------------------------------------------------------------
% Parse input % Parse input
%------------------------------------------------------------------------------ %--------------------------------------------------------------------------
if(exist('fieldin')*exist('Mobj') == 0) if exist('fieldin', 'var') ~= 1 || exist('Mobj', 'var') ~= 1
error('arguments to nodes2elems are missing') error('arguments to nodes2elems are missing')
end; end
if(length(fieldin) ~= Mobj.nVerts) if length(fieldin) ~= Mobj.nVerts
error('field size in nodes2elems is not the same as number of nodes in Mesh') error('field size in nodes2elems is not the same as number of nodes in Mesh')
end; end
%------------------------------------------------------------------------------ %--------------------------------------------------------------------------
% Tranfser % Tranfser
%------------------------------------------------------------------------------ %--------------------------------------------------------------------------
fieldout = zeros(Mobj.nElems,1); fieldout = zeros(Mobj.nElems,1);
for i=1:Mobj.nElems for i=1:Mobj.nElems
...@@ -52,7 +51,7 @@ for i=1:Mobj.nElems ...@@ -52,7 +51,7 @@ for i=1:Mobj.nElems
end; end;
if(ftbverbose); if ftbverbose
fprintf(['end : ' subname '\n']) fprintf(['end : ' subname '\n'])
end; end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment