Skip to content

Commit

Permalink
merge with beta, QuadRuleDegree set back to 4 for linear tri
Browse files Browse the repository at this point in the history
  • Loading branch information
GHilmarG committed May 29, 2024
2 parents 5088d0a + 878ea44 commit 0764252
Show file tree
Hide file tree
Showing 8 changed files with 254 additions and 173 deletions.
1 change: 1 addition & 0 deletions BuildMuaWorkers.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@




function MUAworkers=BuildMuaWorkers(CtrlVar,MUA,MUAworkers)


Expand Down
29 changes: 20 additions & 9 deletions FE_inner_product.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,32 @@

[nM,mM]=size(M);

theta=nan;

if nM==nf

fg=f'*M*g; % = (M*f)' * g
fNorm=sqrt(f'*M*f) ;
gNorm=sqrt(g'*M*g) ;
theta=acos(fg/(fNorm*gNorm)) ;


if nargout>1
fNorm=sqrt(f'*M*f) ;
gNorm=sqrt(g'*M*g) ;
theta=acos(fg/(fNorm*gNorm)) ;
else
theta=nan;
end

elseif nf==2*nM

fg=f(1:nM)'*M*g(1:nM)+f(1+nM:nf)'*M*g(1+nM:ng);


if nargout>1
fNorm=sqrt(f(1:nM)'*M*f(1:nM)+f(1+nM:nf)'*M*f(1+nM:nf)) ;
gNorm=sqrt(g(1:nM)'*M*g(1:nM)+g(1+nM:ng)'*M*g(1+nM:ng)) ;
theta=acos(fg/(fNorm*gNorm)) ;

theta=acos(fg/(fNorm*gNorm)) ;
else
theta=nan;
end

end


Expand Down
4 changes: 2 additions & 2 deletions QuadratureRuleDegree.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

case 3

Degree=4;
Degree=25;
Degree=4; % 6 integration points
% Degree=25; % this would give 126 integration points


case 6
Expand Down
15 changes: 15 additions & 0 deletions UaUtilities/InsideOutside.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
% Just a simple wrapper around inpoly2 to take care of the possibility of
% several boundaries within the array 'boundary' seperated by NaNs
%
% xy : n x 2 array
% Boundary : m x 2 Array
%
% Example
%
%
% xy=[ 0.5 0.5 ; 0.5 1.5] ;
% boundary=[ 0 0 ; 1 0 ; 1 1 ; 0 1 ; 0 0 ; nan nan ; 0 2 ; 1 2 ; 1 3 ; 0 3 ; 0 2] ;
% [isInside,isOnBounday]=InsideOutside(xy,boundary) ;
%
% figure ;
% plot(boundary(:,1),boundary(:,2),LineWidth=2) ; hold on ;
% plot(xy(:,1),xy(:,2),"*r")
% plot(xy(isInside,1),xy(isInside,2),"ok") ; axis padded
%
%%

Kisnan=find(isnan(boundary(:,1)));
Expand Down
3 changes: 2 additions & 1 deletion UaUtilities/ModifyColormap.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
%
% Use with cmocean, setting colormap to gray around -100 to 100
%
% CM=cmocean('balanced',25,'pivot',0) ; colormap(CM); ModifyColormap(100,nan,ChangeColormap=false) ;
% CM=cmocean('balanced',25,'pivot',0) ; colormap(CM);
% ModifyColormap(100,nan,ChangeColormap=false) ;
%
%%

Expand Down
4 changes: 4 additions & 0 deletions UaUtilities/PlotCalvingFronts.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@




function [xc,yc]=PlotCalvingFronts(CtrlVar,MUA,F,varargin)

%
Expand Down
2 changes: 1 addition & 1 deletion UpdateMUA.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
% first make sure that the element is of the right type
[MUA.coordinates,MUA.connectivity]=ChangeElementType(MUA.coordinates,MUA.connectivity,CtrlVar.TriNodes);

% checking if MUA as the QuadratureRuleDegree field
% checking if MUA has the QuadratureRuleDegree field
if CtrlVar.QuadRules2021 && ~isfield(MUA,"QuadratureRuleDegree")
QuadratureFieldMissing=true;
else
Expand Down
Loading

0 comments on commit 0764252

Please sign in to comment.