plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | iwbailey/thermomech-master | faultcreep_bz96.m | .m | thermomech-master/matlab/creep/faultcreep_bz96.m | 1,579 | utf_8 | a95d5ad19efbf30e1525fc9ea082d3a3 | function creepCoeffs = faultcreep_bz96( nL, nD, cellLength, cellHeight, xBD, zBD, ...
strainRate, strength_zBD )
%FAULTCREEP_BZ96 Generate A values that are like the Ben-Zion 1996 Creep mask
%
% faultA = faultcreep_bz96( nL, nD, cellL, cellH, xBD, zBD, strainRate, strength_ZBD )
... |
github | GHilmarG/UaSource-master | InversionUsingMatlabOptimizationToolbox3.m | .m | UaSource-master/InversionUsingMatlabOptimizationToolbox3.m | 2,440 | utf_8 | b26813d3e2d35268ef9107bd34ced17e |
function [p,RunInfo]=InversionUsingMatlabOptimizationToolbox3(UserVar,CtrlVar,RunInfo,MUA,func,p0,plb,pub,Hfunc)
CtrlVar.Inverse.MatlabOptimisationGradientParameters= optimoptions(CtrlVar.Inverse.MatlabOptimisationGradientParameters,'MaxIterations',CtrlVar.Inverse.Iterations);
CtrlVar.Inverse.MatlabOptimisation... |
github | GHilmarG/UaSource-master | InvertForModelParameters.m | .m | UaSource-master/InvertForModelParameters.m | 4,175 | utf_8 | 706b87f41a7a5c6eaf97e3ddba5a668f |
function [UserVar,F,l,InvFinalValues,RunInfo]=...
InvertForModelParameters(UserVar,CtrlVar,MUA,BCs,F,l,InvStartValues,Priors,Meas,BCsAdjoint,RunInfo)
narginchk(11,11)
InvFinalValues=InvStartValues;
if isempty(CtrlVar.Inverse.InitialLineSearchStepSize) || CtrlVar.Inverse.InitialLineSearchStepSize==0
... |
github | GHilmarG/UaSource-master | uvhSemiImplicit.m | .m | UaSource-master/uvhSemiImplicit.m | 3,509 | utf_8 | 3299314b3beb8bc42dc545286b0ff0ef |
function [UserVar,RunInfo,F1,F0,l,Kuv,Ruv,Lubvb]= uvhSemiImplicit(UserVar,RunInfo,CtrlVar,MUA,BCs,F0,Fm1,l)
nargoutchk(8,8)
narginchk(8,8)
%% 1) Calculate uv at the beginning of the time step.
%
% This is not expected to be
% strictly needed as uv should have been calculated on the basis of the new
% g... |
github | GHilmarG/UaSource-master | GetInitialInputs.m | .m | UaSource-master/GetInitialInputs.m | 964 | utf_8 | c7133812964139969f6264a9835fce14 |
function [UserVar,CtrlVar]=GetInitialInputs(UserVar,CtrlVar,varargin)
OldInputFile="Ua2D_InitialUserInput.m" ;
NewInputFile="DefineInitialInputs.m" ;
if exist(OldInputFile,'file')==2 && ~(exist(NewInputFile,'file')==2)
warning("OldInputFormat:Ua2D_InitialUserInpu... |
github | GHilmarG/UaSource-master | SSTREAM2d.m | .m | UaSource-master/SSTREAM2d.m | 331 | utf_8 | b43083905a48868e2ac0766dd3e900dc |
function [u,v,lambda,kv,rh]=...
SSTREAM2d(s,S,B,h,u,v,coordinates,connectivity,Boundary,nip,AGlen,C,L,Lb,lambda,n,m,alpha,rho,rhow,g,CtrlVar,Itime)
[u,v,lambda,kv,rh]=...
SSTREAM2dNR(s,S,B,h,u,v,coordinates,connectivity,Boundary,nip,AGlen,C,L,Lb,lambda,n,m,alpha,rho,rhow,g,Itime,CtrlVar);
... |
github | GHilmarG/UaSource-master | calcStrainRatesEtaInt.m | .m | UaSource-master/calcStrainRatesEtaInt.m | 3,805 | utf_8 | a826bf7bc9cbad5625fb838f9138cda3 |
function [etaInt,xint,yint,exx,eyy,exy,Eint,e,txx,tyy,txy]=...
calcStrainRatesEtaInt(CtrlVar,MUA,ub,vb,AGlen,n)
% [etaInt,xint,yint,exx,eyy,exy,Eint,e,txx,tyy,txy]=calcStrainRatesEtaInt(CtrlVar,MUA,u,v,AGlen,n)
% calculates strain rates and effective viscosity at integration points and Eint needed for the di... |
github | GHilmarG/UaSource-master | TestFunction.m | .m | UaSource-master/TestFunction.m | 800 | utf_8 | 403a8f06af9f8c885e1f45604a07a421 |
function [J,dJdp,Hess,fOuts]=TestFunction(p,TestFunctionParameters)
x=p(1);
y=p(2);
a=TestFunctionParameters.a;
b=TestFunctionParameters.b;
switch lower(TestFunctionParameters.Name)
case 'sphere'
J=p(1)^2+p(2)^2 ;
dJdp=[2*p(1) ; 2*p(2)];
case... |
github | GHilmarG/UaSource-master | DefineAGlenDistribution.m | .m | UaSource-master/DefineAGlenDistribution.m | 498 | utf_8 | 67843c9b3098c1d95aae546609a27ea2 |
function [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%%
%
% User input m-file to define A and n in the Glenn-Steinemann flow law
%
% [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%
% Usually A is defined on the node... |
github | GHilmarG/UaSource-master | DescentMinimisationUsingProjectedGradients.m | .m | UaSource-master/DescentMinimisationUsingProjectedGradients.m | 14,610 | utf_8 | 3f6320d33328fecab881f83e40c7c6de |
function [C,AGlen,u,v,JoptVector]=DescentMinimisationUsingProjectedGradients(sMeas,uMeas,vMeas,wMeas,bMeas,BMeas,AGlen_prior,CAGlen,C_prior,CC,b_prior,Cd,...
s,S,B,h,u,v,coordinates,connectivity,Xint,Yint,xint,yint,Boundary,DTxy,TRIxy,DTint,TRIint,...
nip,AGlen,C,Luv,Luvrhs,lambdauv,LAdjoint,LAdjoin... |
github | GHilmarG/UaSource-master | CalcLevelSetPertubationFunctional.m | .m | UaSource-master/CalcLevelSetPertubationFunctional.m | 530 | utf_8 | 643dfc0ec78200208a39763d26de21b3 |
function [P,N]=CalcLevelSetPertubationFunctional(CtrlVar,MUA,f)
txt=char(CtrlVar.LevelSetFABCostFunction);
idp = strfind(CtrlVar.LevelSetFABCostFunction,"p");
idq = strfind(CtrlVar.LevelSetFABCostFunction,"q");
p=str2double(txt(idp+1:idp+1));
q=str2double(txt(idq+1:idq+1));
xa=CtrlVar.LSFslope;
[dfdx,dfdy]=calc... |
github | GHilmarG/UaSource-master | SSTREAM_Tsb_t_3d_m.m | .m | UaSource-master/SSTREAM_Tsb_t_3d_m.m | 1,394 | utf_8 | d70e1e5b5bcd3c188b53de82123308ce |
function [trans]=SSTREAM_Tsb_t_3d_m(kx,ky,t,alpha,H,eta,C,rho,g,m)
% time-dependent ratio between surface topography and
% bedrock in Fourier space in dimensional units
% for non-dimensional a la gudmundsson 2003
% put eta=1/2, H0=1,rho*g=1/sin(alpha), lambda in units of mean ice thickness
% Cnondimensiona... |
github | GHilmarG/UaSource-master | interparc.m | .m | UaSource-master/interparc.m | 17,272 | utf_8 | e038716e7cf80ca03562e79411c8317f | function [pt,dudt,fofthandle] = interparc(t,px,py,varargin)
% interparc: interpolate points along a curve in 2 or more dimensions
% usage: pt = interparc(t,px,py) % a 2-d curve
% usage: pt = interparc(t,px,py,pz) % a 3-d curve
% usage: pt = interparc(t,px,py,pz,pw,...) % a 4-d or higher dimensional curve
% usage: pt... |
github | GHilmarG/UaSource-master | geog_to_pol_wgs84_71S.m | .m | UaSource-master/geog_to_pol_wgs84_71S.m | 1,153 | utf_8 | 8493b8170bfd48dfd47d4fff3f7f6c50 | %Transforms from geodetic coordinates (lat,lon) to
%Southern Hemisphere polar stereographic coordinates (x,y)
%with latitude of true scale at 71S.
%Reference:
%Snyder, John P. Map Projections Used by the United States Geological Survey-2nd edition.
%U.S.G.S. Bulletin No. 1532. Washington D.C.: U.S. Government Pri... |
github | GHilmarG/UaSource-master | deriv.m | .m | UaSource-master/deriv.m | 1,264 | utf_8 | 861ca586174c06b1f484364f8111455a |
function [J11,J12,J21,J22,detJ,Deriv]=deriv(coordinates,connectivity,nip,Iint)
[Nele,nod]=size(connectivity); ndim=2; dof=2;
[points,weights]=sample('triangle',nip,ndim);
J11=zeros(Nele,1) ; J12=J11 ; J21=J11 ; J22=J11;
iJ11=zeros(Nele,1) ; iJ12=iJ11 ; iJ21=iJ11 ; iJ22=iJ11;
detJ=J11... |
github | GHilmarG/UaSource-master | GetBoundaryConditions.m | .m | UaSource-master/GetBoundaryConditions.m | 5,757 | utf_8 | d9bfaf252057056281a77cdb232098ae |
function [UserVar,BCs]=GetBoundaryConditions(UserVar,CtrlVar,MUA,BCs,F)
narginchk(5,5)
nargoutchk(2,2)
% Only allow the use of the (not so new anymore) DefineBoundaryConditions.m file
InputFile="DefineBoundaryConditions.m" ; TestIfInputFileInWorkingDirectory(InputFile) ;
InputFileNargIn=nargin(InputFile)... |
github | GHilmarG/UaSource-master | ghg_arrow.m | .m | UaSource-master/ghg_arrow.m | 1,281 | utf_8 | a83a5506856edb933fed2c9221cf0819 |
function ghg_arrow(x,y,vx,vy,velscale,headscale,sharp,head,col,lw,io,xyratio)
[nx,ny]=size(x);
if nx ==1
x=x' ; y=y' ;vx=vx' ;vy=vy';
end
if nargin == 4
velscale=1 ;
headscale=0.3;
sharp=0.3;
head=1;
col='k';
end
if nargin == 5
headscale=0.3;
sharp=0.3;... |
github | GHilmarG/UaSource-master | CalcHorizontalNodalStrainRates.m | .m | UaSource-master/CalcHorizontalNodalStrainRates.m | 1,466 | utf_8 | ec2a8565f15261afbbc375b2694dc711 |
function [exx,eyy,exy,e]=CalcHorizontalNodalStrainRates(CtrlVar,MUA,u,v)
%%
%
% Calculates horizontal strain rates given horizontal velocities.
%
% [exx,eyy,exy,e]=CalcNodalStrainRates(CtrlVar,MUA,u,v)
%
% Returns nodal values.
%
% Note: The strain rates are calculated at integration points and then... |
github | GHilmarG/UaSource-master | LevelSetFixPointSolver.m | .m | UaSource-master/LevelSetFixPointSolver.m | 3,091 | utf_8 | 81f378eb5ec6f87a8086188149c2b9cc |
function [UserVar,RunInfo,LSF,l]=LevelSetFixPointSolver(UserVar,RunInfo,CtrlVar,MUA,BCs,F0,F1,l)
%clearvars ; load TestSaveFixPoint.mat
fprintf("\n LSF: fix point solver \n")
FixPointConverged=0 ;
CtrlVar.LevelSetFixPointSolverApproach="-initial fix point (IFP) then pseudo time stepping (PTS) follo... |
github | GHilmarG/UaSource-master | MeshAdvanceRetreat.m | .m | UaSource-master/MeshAdvanceRetreat.m | 5,220 | utf_8 | 52c91a8bac5a9a2d5299aa9bd1543b31 |
function [UserVar,RunInfo,MUAnew]=MeshAdvanceRetreat(UserVar,RunInfo,CtrlVar,MUAold,BCsOld,Fold,lold,GFold,Ruv,Lubvb)
persistent MUA_Background
%% FE mesh advance or retreat
if CtrlVar.InfoLevelAdaptiveMeshing>=1
fprintf(CtrlVar.fidlog,' FE mesh advance or retreat, element activated/deactivated at time... |
github | GHilmarG/UaSource-master | GetDensities.m | .m | UaSource-master/GetDensities.m | 693 | utf_8 | ec0f0795070bd3888e6d8f4194e5be0d |
function [UserVar,F]=GetDensities(UserVar,CtrlVar,MUA,F)
narginchk(4,4)
nargoutchk(2,2)
InputFile="DefineDensities.m" ;
TestIfInputFileInWorkingDirectory(InputFile) ;
N=nargout('DefineDensities');
switch N
case 3
[F.rho,F.rhow,F.g]=DefineDensities(CtrlVar.Experiment,Ctr... |
github | GHilmarG/UaSource-master | FE2dRefineMesh.m | .m | UaSource-master/FE2dRefineMesh.m | 978 | utf_8 | 023befa4ead2f02dca2e931cdd92a9bf |
function [coordinates,connectivity]=FE2dRefineMesh(coordinates,connectivity)
% refines mesh by subdividing all triangles into four
[NeleIn,nodIn]=size(connectivity);
% change all elements into 3-node elemetns
[coordinates,connectivity]=ChangeElementType(coordinates,connecti... |
github | GHilmarG/UaSource-master | MinimisationSilly.m | .m | UaSource-master/MinimisationSilly.m | 23,275 | utf_8 | 30e1c8a6ba819b6ae306b239c963a305 | function [Cest,AGlenEst,u,v,JoptVector]=MinimisationSilly(sMeas,uMeas,vMeas,wMeas,bMeas,BMeas,AGlen_prior,CAGlen,C_prior,CC,b_prior,Cd,...
s,S,B,h,u,v,coordinates,connectivity,Xint,Yint,xint,yint,Boundary,DTxy,TRIxy,DTint,TRIint,...
nip,AGlen,C,Luv,Luvrhs,lambdauv,LAdjoint,LAdjointrhs,lambdaAdjoint,..... |
github | GHilmarG/UaSource-master | TestGPU.m | .m | UaSource-master/TestGPU.m | 2,370 | utf_8 | 57cf1e99a789a7cd47b4b4c47d78643e |
function TestGPU
%%
%
% conclusion on 19 April,2019.
% GPU linsolve using sparse matrices about 3 to 4 times slower than CPU
% GPU linsolve using full matrices a bit faster than CPU
%
%
%%
iExperiment=0;
density=0.05 ;
timings=zeros(10,6)+NaN;
nRepeat=1;
for N=[100 1000 3000 5000 20000 ] % 500 100... |
github | GHilmarG/UaSource-master | ModelDataMisfit.m | .m | UaSource-master/ModelDataMisfit.m | 4,281 | utf_8 | f445f2effe551ad49fbc101a45063db2 |
function Imisfit=ModelDataMisfit(sModel,bModel,hModel,uModel,vModel,B,M,sMeas,uMeas,vMeas,wMeasInt,bMeas,BMeas,coordinates,connectivity,nip,Itype)
% misfit calculated as integral (not vectorized)
% for plotting misfit I need BModel, must add at some sate
Nnodes=length(coordinates); %[Nele,n... |
github | GHilmarG/UaSource-master | MapNodalVariablesFromMesh1ToMesh2.m | .m | UaSource-master/MapNodalVariablesFromMesh1ToMesh2.m | 1,419 | utf_8 | 031bca5b4f025e0e8dc370ee8661dd93 |
function [RunInfo,varargout]=MapNodalVariablesFromMesh1ToMesh2(CtrlVar,RunInfo,MUAold,MUAnew,OutsideValues,varargin)
nVar=length(varargin) ;
varargout=cell(nVar,1);
switch CtrlVar.MapOldToNew.method
case "scatteredInterpolant"
[RunInfo,varargout{:}]=MapNodalVar... |
github | GHilmarG/UaSource-master | parabolamin.m | .m | UaSource-master/parabolamin.m | 2,510 | utf_8 | bbc9774d34019ad763b2aac5531fd93a |
function [ xmin , status] = parabolamin(a,b,c,fa,fb,fc,InfoLevel)
if nargin <7
InfoLevel=10;
end
% [ xmin , status] = parabolamin(a,b,c,fa,fb,fc)
% finds the abscissa x that is the minimum of a parabola trhough three points
% status: 0 if everything went OK
% 1 problem, for example: not conve... |
github | GHilmarG/UaSource-master | CircularStringShift.m | .m | UaSource-master/CircularStringShift.m | 445 | utf_8 | 54ec0bc4f9803ff441e5f470fe7f1af4 |
function [NewString,FirstInstance]=CircularStringShift(String)
%% Get rid of eventual dashes at beginning and end
if String(1,1)=='-'
String=String(1,2:end);
end
if String(1,end)=='-'
String=String(1,1:end-1);
end
%%
NewString=String;
FirstInstance=String;
%% Now split and rejoin after ... |
github | GHilmarG/UaSource-master | AdjointNR2D.m | .m | UaSource-master/AdjointNR2D.m | 5,828 | utf_8 | e7de4ac29af7f7ab8ed8cea01e9f5f56 |
function [Cest,AGlenEst,JoptVector,ub,vb,ud,vd,lx,ly,gammaAdjoint]=AdjointNR2D(CtrlVar,MUA,JoptVector,...
s,b,h,S,B,ub,vb,ud,vd,AGlen,n,C,m,rho,rhow,alpha,g,...
sMeas,uMeas,vMeas,wMeas,bMeas,BMeas,...
AGlen_prior,CAGlen,C_prior,CC,b_prior,uError,vEr... |
github | GHilmarG/UaSource-master | dhdtExplicit.m | .m | UaSource-master/dhdtExplicit.m | 2,514 | utf_8 | fe59b8aedc7d250daa827d9e77b1cbb4 |
function [UserVar,dhdt]=dhdtExplicit(UserVar,CtrlVar,MUA,F,BCs)
%%
% Calculates dh/dt from flux divergence as
%
% dh/dt = a - ( dqx/dx + dqy/dy)
%
% [UserVar,dhdt]=dhdtExplicit(UserVar,CtrlVar,MUA,F)
%
% uses u=F.ub, and hence only correct for plug flow, e.g. SSA
%
% Projects the values directly onto ... |
github | GHilmarG/UaSource-master | SearchAndReplaceInverseFieldsInCtrlVar.m | .m | UaSource-master/SearchAndReplaceInverseFieldsInCtrlVar.m | 1,858 | utf_8 | edb2965fb1c2cc4d0aa7dceeb9f49f3b |
function [InvertString,status]=SearchAndReplaceInverseFieldsInCtrlVar(InvertString)
% On return "InvertString" should have one of the following forms:
%
% "-?AGlen-" "-?C-" , "-AGlen-?C-"
% where ? is either "" or "log"
%
%
status=true;
InvertString=string(InvertString) ;
InvertString=replace... |
github | GHilmarG/UaSource-master | multiWaitbar.m | .m | UaSource-master/multiWaitbar.m | 28,077 | utf_8 | 48ad83659e5f447ab677fd5f668c91f9 | function cancel = multiWaitbar( label, varargin )
%multiWaitbar: add, remove or update an entry on the multi waitbar
%
% multiWaitbar(LABEL,VALUE) adds a waitbar for the specified label, or
% if it already exists updates the value. LABEL must be a string and
% VALUE a number between zero and one or the strin... |
github | GHilmarG/UaSource-master | SSTREAM_Tsc_t_3d_m.m | .m | UaSource-master/SSTREAM_Tsc_t_3d_m.m | 850 | utf_8 | c568f4d64485c6453b11e573b2462372 |
function [trans]=SSTREAM_Tsc_t_3d_m(kx,ky,t,alpha,H,eta,C,rho,g,m)
% for non-dimensional a la gudmundsson 2003
% put eta=1/2, H0=1,rho*g=1/sin(alpha), lambda in units of mean ice thickness
% Cnondimensional=2 eta/H0 Cdimesional, and then
% U0nondimensional=Cnondimensional
[k,l] = kxky2kl(kx,ky);
j2=k.^2+... |
github | GHilmarG/UaSource-master | AssembleLuvhSSTREAM.m | .m | UaSource-master/AssembleLuvhSSTREAM.m | 1,212 | utf_8 | 6256f86a112c2ffef7bb519bf3f858e8 |
function [L,cuvh,luvh]=AssembleLuvhSSTREAM(CtrlVar,MUA,BCs,l)
MLC=BCs2MLC(CtrlVar,MUA,BCs);
Luv=MLC.ubvbL;
cuv=MLC.ubvbRhs;
Lh=MLC.hL;
ch=MLC.hRhs;
% Luv : #uv constrains x 2MUA.Nnodes
% Lh : #h constrains x MUA.Nnodes
% L=[Luv 0]
% [0 Lh]
[nu,~]=size(Luv) ;
[nh,~]=size(Lh) ;
if CtrlVar.L... |
github | GHilmarG/UaSource-master | FromMLCtoBCs.m | .m | UaSource-master/FromMLCtoBCs.m | 699 | utf_8 | 616c5aaf3805a65d59f8f8a7ddc641a9 |
function [ufixednode,ufixedvalue,vfixednode,vfixedvalue,...
utiedA,utiedB,vtiedA,vtiedB,FixedNormalVelocityNode,FixedNormalVelocityValue,...
hfixednode,hfixedvalue,htiedA,htiedB]=FromMLCtoBCs(Luv,Luvrhs,Lh,Lhrhs)
% Takes the multi-linear constraint matrices, on which the BCs are based internally
% and r... |
github | GHilmarG/UaSource-master | LineSearchNR.m | .m | UaSource-master/LineSearchNR.m | 5,631 | utf_8 | bdd82e63301f4df269db388c9796e538 |
function [gamma,fgamma,LineSearchStagnated]=LineSearchNR(fdata,a,b,c,fa,fb,fc,f0,solrange,solbracket)
InfoLevel=100;
Slope=-f0;
% f0 value at gamma=0
% a<b<c on input, and fa fb fc function values at these points
LineSearchStagnated=0;
fvector=[fa;fb;fc]; dis... |
github | GHilmarG/UaSource-master | BasalDrag.m | .m | UaSource-master/BasalDrag.m | 15,212 | utf_8 | f41836d84dd8c04ef491f5e8a004004f | function [taubx,tauby,dtaubxdu,dtaubxdv,dtaubydu,dtaubydv,dtaubxdh,dtaubydh,taubxo,taubyo,taubxa,taubya] = ...
BasalDrag(CtrlVar,MUA,He,delta,h,B,H,rho,rhow,ub,vb,C,m,uo,vo,Co,mo,ua,va,Ca,ma,q,g,muk)
narginchk(24,24)
%%
% Returns basal drag and the directional derivatives of basal dr... |
github | GHilmarG/UaSource-master | SetUaPath.m | .m | UaSource-master/SetUaPath.m | 535 | utf_8 | e5569dce0fe71a17c45398d9cba2d426 |
function SetUaPath()
% If here, then Ua is on the path, or user is running Ua from the Ua
% installation directory.
%
% Check if the path includes, for example, Mesh2d.
% And if not, add Ua directory and all subdirectory to the path
%
if ispc
onPath = contains(lower(path),lower('Mesh2d'));
else
on... |
github | GHilmarG/UaSource-master | fe2dErrorEstimate.m | .m | UaSource-master/fe2dErrorEstimate.m | 4,357 | utf_8 | 98fb99d8750419b0ea900323898527ac |
function [EleError,NormalizedEleError,rmsEleError]=fe2dErrorEstimate(iRefinement,Experiment,coordinates0,connectivity0,...
Boundary0,MeshBoundaryCoordinates,u0,v0,h0,s0,b0,AGlen0,C0,n,m,rho,rhow,g,Itime,nip,DTxy0,TRIxy0,...
CtrlVar)
% estimates errors for each element
x0=coordinate... |
github | GHilmarG/UaSource-master | CreateLuv.m | .m | UaSource-master/CreateLuv.m | 2,586 | utf_8 | 0daf7eeed45466995726e91a8aeb9367 |
function [Luv,b]=CreateLuv(MUA,ufixednode,ufixedvalue,vfixednode,vfixedvalue,utiedA,utiedB,vtiedA,vtiedB,FixedNormalVelocityNode,FixedNormalVelocityValue)
if isempty(ufixednode) && isempty(ufixedvalue) && isempty(vfixednode) && isempty(vfixedvalue) ...
&& isempty(utiedA) && isempty(utiedB) && isempty(vtie... |
github | GHilmarG/UaSource-master | RemoveNodesNotInConnectivity.m | .m | UaSource-master/RemoveNodesNotInConnectivity.m | 1,393 | utf_8 | a3792b1d341cf1de2a7ac0c954f65604 |
function [coordinates,connectivity]=RemoveNodesNotInConnectivity(coordinates,connectivity)
%
% [coordinates,connectivity]=RemoveNodesNotInConnectivity(coordinates,connectivity)
% gets rid of nodes that are not in connectivity
% relabels all nodes so that numbers start with 1 with no gaps
if numel(coordin... |
github | GHilmarG/UaSource-master | fminbndAdjoint2d.m | .m | UaSource-master/fminbndAdjoint2d.m | 16,571 | utf_8 | 14e2a0a4230f083aa0abd5b2882062f5 | function [xf,fval,exitflag,output,Vx,Vy] = fminbndAdjoint2d(funfcn,ax,bx,options,varargin)
%FMINBND Single-variable bounded nonlinear function minimization.
% X = FMINBND(FUN,x1,x2) attempts to find a local minimizer X of the function
% FUN in the interval x1 < X < x2. FUN is a function handle. FUN accepts
... |
github | GHilmarG/UaSource-master | MassContinuityEquationAssembly.m | .m | UaSource-master/MassContinuityEquationAssembly.m | 6,115 | utf_8 | a9a5efd8f8c025821c62f0d423912a10 |
function [UserVar,f0,K,dFdt]=MassContinuityEquationAssembly(UserVar,CtrlVar,MUA,h0,rho,ub0,vb0,as0,ab0,h1,ub1,vb1,as1,ab1,das1dh,dab1dh)
% Assembly
%
% K dh =-f0
%
% dFdt is the matrix F in d deltah/dt = F deltah
% This matrix can be used to assess (linear) stability, from eigenvalues of M\dFdt
%
narginchk(16,16... |
github | GHilmarG/UaSource-master | WriteForwardRunRestartFile.m | .m | UaSource-master/WriteForwardRunRestartFile.m | 947 | utf_8 | f8bac81c492274adbe2e782318966a71 |
function WriteForwardRunRestartFile(UserVar,CtrlVar,MUA,BCs,F,GF,l,RunInfo)
RestartFile=CtrlVar.NameOfRestartFiletoWrite;
fprintf(CtrlVar.fidlog,' \n ################## %s %s ################### \n Writing restart file %s at t=%-g \n %s \n ',CtrlVar.Experiment,datestr(now),RestartFile,CtrlVar.time);
... |
github | GHilmarG/UaSource-master | DefineSlipperyDistribution.m | .m | UaSource-master/DefineSlipperyDistribution.m | 903 | utf_8 | 804fa377c365e9453e7006fdd7078bee |
function [UserVar,C,m,q,muk]=DefineSlipperyDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%%
%
% [UserVar,C,m,q,muk]=DefineSlipperyDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%
%
% Defines sliding-law parameters.
%
% The sliding law us... |
github | GHilmarG/UaSource-master | createLh.m | .m | UaSource-master/createLh.m | 1,118 | utf_8 | be73e052e82bf07264954c2520cabf5d |
function [L,b]=createLh(Nnodes,hfixednode,hfixedvalue,htiedA,htiedB)
%%
if isempty(hfixednode) && isempty(hfixedvalue) && isempty(htiedA) && isempty(htiedB)
L=[];
b=[];
return
end
if numel(hfixednode) ~= numel(hfixedvalue)
numel(hfixednode)
numel(hfixedvalue)
error(' # of f... |
github | GHilmarG/UaSource-master | AllElementsContainingGivenNodes.m | .m | UaSource-master/AllElementsContainingGivenNodes.m | 922 | utf_8 | d131672c3fdb15105112daa4fce69c42 |
function I=AllElementsContainingGivenNodes(connectivity,NodeList,EleList)
%%
% I=AllElementsContainingGivenNodes(connectivity,NodeList,EleList)
%
% NodeList must be an index variable, ie not a logical index
%
% Returns a logical list of elements containing one or more of the nodes in Node... |
github | GHilmarG/UaSource-master | TracerConservationEquationAssembly.m | .m | UaSource-master/TracerConservationEquationAssembly.m | 5,766 | utf_8 | 913ac57829064ddb26cd4576c2b8bb85 |
function [UserVar,kv,rh]=TracerConservationEquationAssembly(UserVar,CtrlVar,MUA,dt,h0,u0,v0,a0,u1,v1,a1,kappa)
% Note: Assembly for the linear tracer equationU
% dc/dt + d (u c)/dx + d (v c)/dy - div (kappa grad c) = a
%%
%
% $$ \partial c/\partial t + \partial ( u c)/ \partial x + \partial ( v c)/\part... |
github | GHilmarG/UaSource-master | FindAllElementsContainingGivenNodes.m | .m | UaSource-master/FindAllElementsContainingGivenNodes.m | 528 | utf_8 | a261f0f2a4c2f957a3e78ecdfd3548ab |
function E=FindAllElementsContainingGivenNodes(connectivity,NodeList)
% E=FindAllElementsContainingGivenNodes(connectivity,NodeList)
% Finds elements containing nodes in NodeList
%
% Returns a cell array
% Example :
% E=FindAllElementsContainingGivenNodes(connectivity,[13 23])
% returns E{13} listing... |
github | GHilmarG/UaSource-master | PlotCostFunctionsVersusGamma.m | .m | UaSource-master/PlotCostFunctionsVersusGamma.m | 2,901 | utf_8 | 53694cfca21e9c6419f9c0c94f54cf34 |
function [ForceFig,WorkFig]=PlotCostFunctionsVersusGamma(CtrlVar,RunInfo,gamma,r,iteration,IdString,...
gammaTestVector,rForceTestvector,rWorkTestvector,rD2Testvector,...
slopeForce,slopeWork,slopeD2,rForce,rWork,D2)
[temp,I0]=min(abs(gammaTestVector)) ;
Lower=min(gammaTestVec... |
github | GHilmarG/UaSource-master | calcDerivedGLquantities.m | .m | UaSource-master/calcDerivedGLquantities.m | 5,165 | utf_8 | a961b04d2284e3f383c82026aabe7038 |
function [Fx,Fy,Ngl,Tgl,Theta,Ffree,f,qgl,nx,ny,xGLele,yGLele,GLele,hGL,uGL,vGL]=...
calcDerivedGLquantities(CtrlVar,s,b,h,S,B,u,v,rho,rhow,g,coordinates,connectivity,nip,GF,GLgeo,xGL,yGL,txx,tyy,txy)
% Calculates various quantaties that are of interest for the grounding line
%
% All returne... |
github | GHilmarG/UaSource-master | IceStreamBed.m | .m | UaSource-master/IceStreamBed.m | 504 | utf_8 | 43632ff2834c0bf5c7130bbfe8ae6f30 |
function B=IceStreamBed(x,y,w,d,sigma)
% w : half-width of ice stream bed
% d : depth of the channel
% sigma : sharpness of the channel (affects transvese slope)
B=720-778.5*x/750e3+d*(1./(1+exp(-2*(y-w)/sigma))+1./(1+exp(2*(y+w)/sigma)));
% B=d*(1./(1+exp(-2*(y-w)/sigma))+1... |
github | GHilmarG/UaSource-master | Vars2InvValues.m | .m | UaSource-master/Vars2InvValues.m | 2,661 | utf_8 | 3d662728d11e893a6d92c9f5dad4d3b0 |
function InvValues=Vars2InvValues(CtrlVar,F,InvValues,J,dJdp,JGHouts,RunInfo,dJdpTest)
NA=numel(F.AGlen);
Nb=numel(F.b);
NC=numel(F.C);
if contains(CtrlVar.Inverse.InvertForField,'A')
InvValues.AGlen=F.AGlen;
end
if contains(CtrlVar.Inverse.InvertForField,'B')
InvValues.B=F... |
github | GHilmarG/UaSource-master | Deblurr2D.m | .m | UaSource-master/Deblurr2D.m | 15,030 | utf_8 | 84a5efe067d73bf4a162d53efec5f9ea |
function [db,dc] = Deblurr2D(time,...
sModel,uModel,vModel,bModel,BModel,...
sMeas,uMeas,vMeas,wMeas,bMeas,BMeas,xMeas,yMeas,...
Experiment,...
coordinates,connectivity,Nnodes,Nele,nip,nod,etaInt,gfint,AGlen,C,...
Luv,Luvrhs,lambdau,n,m,alpha,rho,rhow,g,Itime)
... |
github | GHilmarG/UaSource-master | GHGprojbfgsAdjoint.m | .m | UaSource-master/GHGprojbfgsAdjoint.m | 26,413 | utf_8 | 9764ab8f8a5756f5306579a6f85e33b2 | function [Cest,AGlenEst,JoptVector,ub,vb,ud,vd,lx,ly,gammaAdjoint]=GHGprojbfgsAdjoint(...
CtrlVar,MUA,JoptVector,...
s,b,h,S,B,ub,vb,ud,vd,AGlen,n,C,m,rho,rhow,alpha,g,...
sMeas,uMeas,vMeas,wMeas,bMeas,BMeas,...
AGlen_prior,CAGlen,C_prior,CC,b_prior,Cd,...
Luv,Luvrhs,lambdauv,LAdjoint,LAdjointr... |
github | GHilmarG/UaSource-master | ChangeElementType.m | .m | UaSource-master/ChangeElementType.m | 1,261 | utf_8 | 8c54108f04fb6abd5753f6cd99778a8a |
function [coordinates,connectivity]=ChangeElementType(coordinates,connectivity,To)
%%
%
% Changes element type from 3, 6, or 10 node triangles to 3, 6 or 10 node triangles
%
% [coordinates,connectivity]=ChangeElementType(coordinates,connectivity,To)
%
% To : number of nodes of desired element type [3,6,10]... |
github | GHilmarG/UaSource-master | AGlenVersusTemp.m | .m | UaSource-master/AGlenVersusTemp.m | 527 | utf_8 | 337e711fa6b58e225549c0b39cf333a6 |
function AGlen=AGlenVersusTemp(T)
% Gives A as a function of temperatur (degrees Celcius) in the units a^{-1} kPa^{-3}
T=T+273.15;
% a0= 5.3d-15 % s-1 kPa-3
% a0= 5.3d-24 % s-1 Pa-3 = m+3 s+5 kg-3
a0 = 5.3e-15*365.25*24.*60.*60. ; % a-1 kPa-3
% a0= 1.699d-61 ! m+... |
github | GHilmarG/UaSource-master | SSTREAM_Tuc_t_3d_m.m | .m | UaSource-master/SSTREAM_Tuc_t_3d_m.m | 1,079 | utf_8 | 35e9842cc4b68132c71366bd0ab285b6 |
function [trans]=SSTREAM_Tuc_t_3d_m(kx,ky,t,alpha,H,eta,C,rho,g,m)
% for non-dimensional a la gudmundsson 2003
% put eta=1/2, H0=1,rho.*g=1/sin(alpha), lambda in units of mean ice thickness
% Cnondimensional=2 eta/H0 Cdimesional, and then
% U0nondimensional=Cnondimensional
[k,l] = kxky2kl(kx,ky);
j2=k.^2... |
github | GHilmarG/UaSource-master | LevelSetEquationAssemblyNR2consistentParfor.m | .m | UaSource-master/LevelSetEquationAssemblyNR2consistentParfor.m | 4,244 | utf_8 | e3626f0551b8d7a59bdcc30b7b59cb13 |
function [UserVar,rh,kv,Tv,Lv,Pv,Qx,Qy,Rv]=LevelSetEquationAssemblyNR2consistentParfor(UserVar,CtrlVar,MUA,f0,c0,u0,v0,f1,c1,u1,v1,qx0,qy0,qx1,qy1)
narginchk(15,53)
ndim=2; dof=1; neq=dof*MUA.Nnodes;
theta=CtrlVar.LevelSetTheta;
dt=CtrlVar.dt;
CtrlVar.Tracer.SUPG.t... |
github | GHilmarG/UaSource-master | GroundingLineCurvePlots.m | .m | UaSource-master/GroundingLineCurvePlots.m | 10,228 | utf_8 | f2fa58432453ac53180def594f02d2c0 |
function GroundingLineCurvePlots(FileName)
%
if nargin==0
[FileName,PathName,FilterIndes]=uigetfile('*.mat');
end
if isequal(FileName,0) ; return ; end
% plotting setting for exporting
%%
CtrlVar.GLtension=1e-11;
... |
github | GHilmarG/UaSource-master | ReplaceStructureFields.m | .m | UaSource-master/ReplaceStructureFields.m | 2,481 | utf_8 | cc46574a8d0807ceffedf51a6ebb9edc |
function CtrlVar=ReplaceStructureFields(CtrlVar,CtrlVarOnInput)
%%
%
% Replaces structure fields in CtrlVar by those in CtrlVarOnInput
%
% Limitations: Only up to three sub-structures are considered.
%
% Example:
%
% CrlVar.a="a" ;
% CtrlVar.b="b" ;
% CtrlVar.c="c" ;
%
% CtrlVar.Field.a="a";
... |
github | GHilmarG/UaSource-master | TestSlipperinessInputValues.m | .m | UaSource-master/TestSlipperinessInputValues.m | 5,118 | utf_8 | 485cbb339a275a059e85d44ec3f3b8a4 |
function [C,m,q,muk]=TestSlipperinessInputValues(CtrlVar,MUA,C,m,q,muk)
narginchk(4,6)
nargoutchk(2,4)
[nC,mC]=size(C);
[nm,mm]=size(m);
if nargin<5
q=[];
end
if nargin<6
muk=[];
end
if numel(C)==1
%fprintf(' C given by user is a scalar. Assuming that C is same everywhere. \n... |
github | GHilmarG/UaSource-master | QuasiNewtonInversion.m | .m | UaSource-master/QuasiNewtonInversion.m | 9,963 | utf_8 | 482bdedcd4436407dfc6a85a92f5b9ac |
function [UserVar,F,l,InvFinalValues,xAdjoint,yAdjoint,RunInfo,gammaAdjoint]=...
QuasiNewtonInversion...
(UserVar,CtrlVar,MUA,BCs,F,l,GF,InvStartValues,Priors,Meas,BCsAdjoint,RunInfo)
%[UserVar,Cest,AGlenEst,Info,ub,vb,ud,vd,l,xAdjoint,yAdjoint,gammaAdjoint]=...
% QuasiNewtonInversion(UserVar,Ctr... |
github | GHilmarG/UaSource-master | kk_proj.m | .m | UaSource-master/kk_proj.m | 505 | utf_8 | db2fc6f3e3f95cd37da1bbb84477ca17 |
function [x,iU,iL] = kk_proj(x,upper,lower,Eps)
%
% projection onto active set
%
%ndim=length(x);
%px=zeros(ndim,1);
if nargin==3
Eps=0;
end
if numel(lower) > 1
iL=x<(lower+Eps) ; x(iL)=lower(iL)+Eps;
else
iL=x<(lower+Ep... |
github | GHilmarG/UaSource-master | ApplyAdjointGradientPreMultiplier.m | .m | UaSource-master/ApplyAdjointGradientPreMultiplier.m | 1,378 | utf_8 | 0dadb6d7a9a538ba4a0efdda4ae0ac05 |
function varargout=ApplyAdjointGradientPreMultiplier(CtrlVar,MUA,P,varargin)
narginchk(4,inf)
varargout=varargin;
if CtrlVar.Inverse.AdjointGradientPreMultiplier=="M"
P=MUA.M/MUA.Area ;
elseif CtrlVar.Inverse.AdjointGradientPreMultiplier=="D"
P=MUA.Dxx+MUA.Dyy ;
elseif CtrlVar.Inverse.AdjointG... |
github | GHilmarG/UaSource-master | optimplotlogfval.m | .m | UaSource-master/optimplotlogfval.m | 3,266 | utf_8 | 2481e7cbc40328646771af3203e679d2 | function stop = optimplotlogfval(~,optimValues,state,varargin)
% OPTIMPLOTFVAL Plot value of the objective function at each iteration.
%
% STOP = OPTIMPLOTFVAL(X,OPTIMVALUES,STATE) plots OPTIMVALUES.fval. If
% the function value is not scalar, a bar plot of the elements at the
% current iteration is display... |
github | GHilmarG/UaSource-master | dIhdotduv.m | .m | UaSource-master/dIhdotduv.m | 1,977 | utf_8 | e990dc249ee2f6571117ef44feb0cf3d |
function [UserVar,rh]=dIhdotduv(UserVar,CtrlVar,MUA,F,dhdtres,dhdtErr)
%
% (hdot-hmeas) ( d(h du)/dx + d(h dv)/dv )
%
ndim=2; dof=2; neq=dof*MUA.Nnodes;
neqx=MUA.Nnodes ;
dhdtresnod=reshape(dhdtres(MUA.connectivity,1),MUA.Nele,MUA.nod);
dhdtErrnod=reshape(dhdtErr(MUA.connectivity,1),MUA.Nele,MUA.nod... |
github | GHilmarG/UaSource-master | v2struct.m | .m | UaSource-master/v2struct.m | 16,238 | utf_8 | 9c044796e1839854495029f183ca7234 |
function varargout = v2struct(varargin)
%% Description
% v2struct has dual functionality in packing & unpacking variables into structures and
% vice versa, according to the syntax and inputs.
%
% Function features:
% * Pack variables to structure with enhanced field naming
% * Pack and upd... |
github | GHilmarG/UaSource-master | Calc_IRegC.m | .m | UaSource-master/Calc_IRegC.m | 429 | utf_8 | 5cf1b5fec71219f0893e54d2f0a61762 |
function [RegC,dRegCdC]=Calc_IRegC(CtrlVar,MUA,CC,C,C_prior)
narginchk(5,5)
if CtrlVar.isRegC
% R= (C-C_prior)' CC^{-1} (C-C_prior) / (2N)
N=numel(C);
Cres=(C-C_prior);
temp=CC\Cres;
RegC=Cres'*temp/(2*N) ;
dRegCdC=temp/N;
RegC=CtrlVar.RegCMultiplier... |
github | GHilmarG/UaSource-master | quadtriangle.m | .m | UaSource-master/quadtriangle.m | 173,892 | utf_8 | 8f7eb59012d43f2065f45a6abcd82a52 | function Q = quadtriangle(d,varargin)
%% QUADTRIANGLE Quadrature weights and points for a triangle
% Q = QUADTRIANGLE(d) returns the weights and points of a Gauss-Jacobi
% product rule of degree d for numerically integrating over a (default)
% triangle defined by the vertices (-1,-1),(1,-1) and (-1,1). The ... |
github | GHilmarG/UaSource-master | AssembleLuvSSTREAM.m | .m | UaSource-master/AssembleLuvSSTREAM.m | 596 | utf_8 | 71c3a6c271ca4c20938d96a02285db64 |
function [Luv,cuv]=AssembleLuvSSTREAM(CtrlVar,MUA,BCs)
MLC=BCs2MLC(CtrlVar,MUA,BCs);
Luv=MLC.ubvbL;
cuv=MLC.ubvbRhs;
% Luv : #uv constrains x 2MUA.Nnodes
% L=[Luv]
if CtrlVar.LinFEbasis && ( numel(Luv)>0 || numel(cuv)>0 )
% L M L' L
%
% L -> L M
% c -> L M L' c
if ~is... |
github | GHilmarG/UaSource-master | AdaptMesh.m | .m | UaSource-master/AdaptMesh.m | 19,029 | utf_8 | bf40882805c9650651b5e17937cac5da |
function [UserVar,RunInfo,MUAnew,BCsNew,Fnew,lnew]=AdaptMesh(UserVar,RunInfo,CtrlVar,MUAold,BCsOld,Fold,lold,RuvOld,Lubvb)
persistent AdaptMeshTime
narginchk(9,9)
nargoutchk(6,6)
%% Do all mesh modifications on MUAnew
% Only use MUAold and Fold for mapping of variables to the new mesh, ie always
% to th... |
github | GHilmarG/UaSource-master | GLplots.m | .m | UaSource-master/GLplots.m | 4,428 | utf_8 | 126fa97dbb978b92207a118a0f0d545f |
function GLplots(FileName)
%%
if nargin==0
[FileName,PathName,FilterIndes]=uigetfile('*.mat');
end
if isequal(FileName,0) ; return ; end
%% set path
locdir=pwd;
indsGHG=strfind(upper(locdir),'GHG');
addpath([locdir(1:indsGHG+2),'/my_mathlab_functions'],'-begin')
load(FileName,'as'... |
github | GHilmarG/UaSource-master | AssembleLuvh.m | .m | UaSource-master/AssembleLuvh.m | 709 | utf_8 | 353d953b23ee574abf05f5127c3727dd |
function [L,Lrhs,l]=AssembleLuvh(Luv,Lh,cuv,ch,luv,lh,Nnodes)
error('AssembleLuvh:obsolete','AssembleLuvh no longer used. Consider using AssembleLuvhSSTREAM.m instead')
% Luv : #uv constrains x 2Nnodes
% Lh : #h constrains x Nnodes
% L=[Luv 0]
% [0 Lh]
[nu,~]=size(Luv) ;
[nh,~]=size(Lh) ;... |
github | GHilmarG/UaSource-master | CheckUaCtrlVarFields.m | .m | UaSource-master/CheckUaCtrlVarFields.m | 420 | utf_8 | 37c6bb7ece618b2370fc84eb41cb5b1d |
function CheckUaCtrlVarFields(CtrlVar,Field)
if ~ismember(string(CtrlVar.(Field)),string(CtrlVar.MustBe.(Field)))
fprintf(" CtrlVar.%s has the value: \n \t %s \n",Field,string(CtrlVar.(Field)))
fprintf(" But this is not an allowed value! \n")
fprintf(" The allowed values are: \n")
fprint... |
github | GHilmarG/UaSource-master | SelectRefinementEdge.m | .m | UaSource-master/SelectRefinementEdge.m | 742 | utf_8 | 0020edd5dd4c327b1600ff682e9db35d |
function mesh=SelectRefinementEdge(mesh)
d12=(mesh.coordinates(mesh.elements(:,1),1)-mesh.coordinates(mesh.elements(:,2),1)).^2+...
(mesh.coordinates(mesh.elements(:,1),2)-mesh.coordinates(mesh.elements(:,2),2)).^2;
d23=(mesh.coordinates(mesh.elements(:,2),1)-mesh.coordinates(mesh.elements(:,3),1)).^2+..... |
github | GHilmarG/UaSource-master | HelmholtzEquationAssembly.m | .m | UaSource-master/HelmholtzEquationAssembly.m | 3,110 | utf_8 | 488d2a2c2c175e244448afba2be45b60 |
function [UserVar,Matrix,rh]=HelmholtzEquationAssembly(UserVar,CtrlVar,MUA,a,b,c,d)
%
% $$ a(x,y) f(x,y) - \nabla \cdot (b(x,y) \nabla f(x,y)) = c(x,y) - \nabla d(x,y) $$
%
narginchk(7,7)
ndim=2; dof=1; neq=dof*MUA.Nnodes;
a=a+zeros(MUA.Nnodes,1);
b=b+zeros(MUA.Nnodes,1);
c=c+zeros(MUA.Nnodes,1... |
github | GHilmarG/UaSource-master | LevelSetEquationAssembly.m | .m | UaSource-master/LevelSetEquationAssembly.m | 6,406 | utf_8 | f40aea94eea31ac4309ca1699860858b |
function [UserVar,kv,rh]=LevelSetEquationAssembly(UserVar,CtrlVar,MUA,f0,c,u,v)
% df/dt + u df/dx + v df/dy - div (kappa grad f) = c norm(grad f0)
%
%
% Treat the c norm(grad f0) term explicitly
%
% f1-f0 + dt theta ( v0 grad f0 ) + dt (1-theta) (v0 grad f1) = dt c norm... |
github | GHilmarG/UaSource-master | decomposition.m | .m | UaSource-master/decomposition.m | 39,981 | utf_8 | f327f0285d8a81290da5dd14838703eb | classdef (Sealed) decomposition < matlab.mixin.CustomDisplay & matlab.mixin.internal.Scalar
%DECOMPOSITION Matrix decomposition
% DA = DECOMPOSITION(A) returns a decomposition of matrix A, which
% can be used to solve the linear system A*X = B efficiently. The
% call X = DA\B returns the same vect... |
github | GHilmarG/UaSource-master | PlotBCs.m | .m | UaSource-master/UaUtilities/PlotBCs.m | 4,504 | utf_8 | 6ce2677d50ce3d34112a56e8ef3062bd |
function PlotBCs(CtrlVar,coordinates,connectivity,Boundary,...
ufixednode,ufixedvalue,vfixednode,vfixedvalue,utiedA,utiedB,vtiedA,vtiedB,hfixednode,hfixedvalue,htiedA,htiedB,FixedNormalVelocityNode,FixedNormalVelocityValue)
error('do not use. use PlotBoundaryCondtions instead')
... |
github | GHilmarG/UaSource-master | FindEdgeNodesGivenTwoCornerNodes.m | .m | UaSource-master/UaUtilities/FindEdgeNodesGivenTwoCornerNodes.m | 802 | utf_8 | bcac269a91c9402eed664bc20423f646 |
function iE=FindEdgeNodesGivenTwoCornerNodes(MUA,FB)
% Finds nodes along edges given free boundary that only includes corner nodes.
%
% iE=FindEdgeNodesGivenTwoCornerNodes(MUA,FB)
%
% Note:
% Calculate FB using matlab freeBoundary routine, for example as:
%
% triGR=CreateFEmeshTriRep(MUA.connectivit... |
github | GHilmarG/UaSource-master | EleBasedGL.m | .m | UaSource-master/UaUtilities/EleBasedGL.m | 2,519 | utf_8 | b0700d1d623d27988c17afbffeab9587 |
function [xGLele,yGLele,triGR,FB,xEdge,yEdge,nx,ny,ds]=EleBasedGL(CtrlVar,MUA,GF,DoPlots)
%%
% Finds a grounding line defined as the free boundary of all grounded elements.
%
% [xGLele,yGLele,triGR,FB,xEdge,yEdge,nx,ny,ds]=EleBasedGL(CtrlVar,MUA,GF,DoPlots)
%
% Outputs:
%
% xGLele, yGLele : ordered list... |
github | GHilmarG/UaSource-master | AnalyticalOneDimentionalIceShelf.m | .m | UaSource-master/UaUtilities/AnalyticalOneDimentionalIceShelf.m | 1,606 | utf_8 | 7168e7248d8a9e5d77517b97d79d5987 |
function [s,b,u,x]=AnalyticalOneDimentionalIceShelf(CtrlVar,MUA,hgl,ugl,xgl,x,A,n,rho,rhow,a,g)
%
% sorts the outputs with x if x is requied as an output.
% otherwise, s, b, u are ordered as the nodes in the mesh
%
%
%
% Examples:
%
%
% Use default values, and x values ba... |
github | GHilmarG/UaSource-master | EleFlooding.m | .m | UaSource-master/UaUtilities/EleFlooding.m | 1,836 | utf_8 | 85ac42f8252754573efb90f7bd3c6016 |
function IEle=EleFlooding(CtrlVar,MUA,NodeSeed,EleSubset,CreateFigure)
%%
%
% IEle=EleFlooding(CtrlVar,MUA,NodeSeed,EleSubset,CreateFigure)
%
% Finds all elements within an element subset (EleSubset) connected to a given
% node (NodeSeed)
%
% Example: Find all element... |
github | GHilmarG/UaSource-master | distance2curve.m | .m | UaSource-master/UaUtilities/distance2curve.m | 57,512 | utf_8 | 4b32084096438b131611efdf5e076590 | function [xy,distance,t_a] = distance2curve(curvexy,mapxy,interpmethod)
% distance2curve: minimum distance from a point to a general curvilinear n-dimensional arc
% usage: [xy,distance,t] = distance2curve(curvexy,mapxy) % uses linear curve segments
% usage: [xy,distance,t] = distance2curve(curvexy,mapxy,interpmethod... |
github | GHilmarG/UaSource-master | Axis00.m | .m | UaSource-master/UaUtilities/Axis00.m | 176 | utf_8 | 13e7a36c1e933837e8c3c913c0d1e706 |
function Axis00(ax)
%
% Sets the x and y axis at (0,0)
%
%
if nargin==0
ax=gca;
end
ax.XAxisLocation = 'origin';
ax.YAxisLocation = 'origin';
end
|
github | GHilmarG/UaSource-master | RenameFileRecursively.m | .m | UaSource-master/UaUtilities/RenameFileRecursively.m | 1,114 | utf_8 | a41e189536a4ddb90f660bf10e515d55 |
function RenameFileRecursively(OldName,NewName)
%%
%
% RenameFileRecursivly(OldName,NewName)
%
% Change files names in current folder and all subfolders.
%
% Example:
% To change all filenames from UaOutputs.m to DefineOutput.m in current folder and all
% subfolde... |
github | GHilmarG/UaSource-master | FE_outer_product.m | .m | UaSource-master/UaUtilities/FE_outer_product.m | 1,915 | utf_8 | d76bfe7051d870802c6cbab49fbca302 |
function [UserVar,ab]=FE_outer_product(UserVar,CtrlVar,MUA,a,b)
%
% $$ a(x,y) b(x,y) $$
%
% $$ ( a_r \phi_r \phi_p , \phi_q \b_s \phi_s ) $$
%
% Not sure if the name of this m-File really is a good description of what it does,
% But it generates something that I find similar to an outer product.
narginchk(4,5... |
github | GHilmarG/UaSource-master | ReadDepoorterGroundingLine.m | .m | UaSource-master/UaUtilities/ReadDepoorterGroundingLine.m | 239 | utf_8 | b5f42e19b057907bd0377ba9de6790ab | %%
function [xps,yps,lat,log]=ReadDepoorterGroundingLine
M=dlmread('Antarctic_grounding_line.tab','\t',14,0);
lat=M(:,1); lon=M(:,2); ID=M(:,3) ;
[xps,yps]=ll2xy(lat,lon);
%figure ; plot(xps,yps,'-') ; axis equal
end |
github | GHilmarG/UaSource-master | MuaElementsContainingGivenNodes.m | .m | UaSource-master/UaUtilities/MuaElementsContainingGivenNodes.m | 2,192 | utf_8 | b6b3378af6727646b9a56a1b22b796ef |
function I=MuaElementsContainingGivenNodes(CtrlVar,MUA,NodeList,EleList,AllOrAny)
%%
% I=MuaElementsContainingGivenNodes(CtrlVar,MUA,NodeList,EleList,AllOrAny)
%
% Finds elements in *MUA* containing nodes in *NodeList* .
%
%
% *NodeList* must be an index v... |
github | GHilmarG/UaSource-master | refine2.m | .m | UaSource-master/Mesh2d/refine2.m | 42,220 | utf_8 | b8ed3c47baca4f8b7e9a42d49e1627a0 | function [vert,conn,tria,tnum] = refine2(varargin)
%REFINE2 (Frontal)-Delaunay-refinement for two-dimensional,
%polygonal geometries.
% [VERT,EDGE,TRIA,TNUM] = REFINE2(NODE,EDGE) returns a co-
% nstrained Delaunay triangulation of the polygonal region
% {NODE,EDGE}. NODE is an N-by-2 array of polygonal verti... |
github | GHilmarG/UaSource-master | tridemo.m | .m | UaSource-master/Mesh2d/tridemo.m | 28,597 | utf_8 | eeb703b47700b9505f88fb75f29d42bb | function tridemo(demo)
%TRIDEMO run various triangulation demos for MESH2D.
% TRIDEMO(N) runs the N-TH demo problem. The following de-
% mo problems are currently available:
%
% - DEMO-0: very simple example to start with -- construct a
% mesh for a square domain with a square hold cut from its
% centre.... |
github | GHilmarG/UaSource-master | tricost.m | .m | UaSource-master/Mesh2d/tricost.m | 15,731 | utf_8 | 4702866a07c6c7c464cd9673b4432bbc | function tricost(varargin)
%TRICOST draw quality-metrics for a 2-simplex triangulation
%embedded in the two-dimensional plane.
% TRICOST(VERT,EDGE,TRIA,TNUM) draws histograms of quality
% metrics for the triangulation.
% VERT is a V-by-2 array of XY coordinates in the triangu-
% lation, EDGE is an array o... |
github | GHilmarG/UaSource-master | smooth2.m | .m | UaSource-master/Mesh2d/smooth2.m | 18,694 | utf_8 | deac378f31a58a850cd0e01f2e89f478 | function [vert,conn,tria,tnum] = smooth2(varargin)
%SMOOTH2 "hill-climbing" mesh-smoothing for two-dimensional,
%2-simplex triangulations.
% [VERT,EDGE,TRIA,TNUM] = SMOOTH2(VERT,EDGE,TRIA,TNUM) re-
% turns a "smoothed" triangulation {VERT,TRIA}, incorpora-
% ting "optimised" vertex coordinates and mesh topol... |
github | GHilmarG/UaSource-master | savemsh.m | .m | UaSource-master/Mesh2d/mesh-file/savemsh.m | 16,535 | utf_8 | dfee52330f9c2c724696cbf905df56bb | function savemsh(name,mesh)
%SAVEMSH save a *.MSH file for JIGSAW.
%
% SAVEMSH(NAME,MESH);
%
% The following are optionally written to "NAME.MSH". Ent-
% ities are written if they are present in MESH:
%
% .IF. MESH.MSHID == 'EUCLIDEAN-MESH':
% -----------------------------------
%
% MESH.POINT.CO... |
github | GHilmarG/UaSource-master | lfshfn2.m | .m | UaSource-master/Mesh2d/hfun-util/lfshfn2.m | 4,018 | utf_8 | 8539b34b0a3719117b1603282aa05800 | function [vert,tria,hlfs] = lfshfn2(varargin)
%LFSHFN2 calc. a discrete "local-feature-size" estimate for
%a polygonal domain embedded in R^2.
% [VERT,TRIA,HFUN] = LFSHFN2(NODE,EDGE) returns the trian-
% gulated "feature-size" estimate for the polygonal region
% {NODE,EDGE}. NODE is an N-by-2 array of polyg... |
github | GHilmarG/UaSource-master | fixgeo2.m | .m | UaSource-master/Mesh2d/geom-util/fixgeo2.m | 10,958 | utf_8 | b687ab7e79215dd5b6b84538c6c07d66 | function [node,PSLG,part] = fixgeo2(varargin)
%FIXGEO2 attempts to "fix" issues with geometry definitions.
% [NNEW,ENEW,PNEW] = FIXGEO2(NODE,EDGE,PART) returns a new
% "repaired" geometry definition. Currently, the following
% operations are performed:
%
% (1) redundant nodes are "zipped" together.
% (... |
github | GHilmarG/UaSource-master | cdtbal2.m | .m | UaSource-master/Mesh2d/mesh-ball/cdtbal2.m | 2,837 | utf_8 | a580865d27683371c6947a148bfde3c6 | function [cc] = cdtbal2(pp,ee,tt)
%CDTBAL2 compute the modified circumballs associated with a
%constrained 2-simplex Delaunay triangulation in R^2.
% [CC] = CDTBAL2(PP,EE,TT) returns the smallest enclosing
% balls associated with the triangles in [PP,TT], such th-
% at CC = [XC,YC,RC.^2]. Such balls never ... |
github | GHilmarG/UaSource-master | inv_3x3.m | .m | UaSource-master/Mesh2d/mesh-ball/inv_3x3.m | 2,521 | utf_8 | 4b23dc56536b5ed8b0ddb68c9552304c | function [II,DA] = inv_3x3(AA)
%INV_3X3 calc. the inverses for a block of 3-by-3 matrices.
% [IA,DA] = INV_3X3(AA) returns a set of 'inverses' IA and
% an array of determinants DA for the set of 3-by-3 linear
% systems in AA. SIZE(AA), SIZE(IA) = [3,3,N], where N is
% the number of linear systems. DA is ... |
github | GHilmarG/UaSource-master | inv_2x2.m | .m | UaSource-master/Mesh2d/mesh-ball/inv_2x2.m | 1,645 | utf_8 | 4de6112827d6074a860f1e82197a2da5 | function [II,DA] = inv_2x2(AA)
%INV_2X2 calc. the inverses for a block of 2-by-2 matrices.
% [IA,DA] = INV_2X2(AA) returns a set of 'inverses' IA and
% an array of determinants DA for the set of 2-by-2 linear
% systems in AA. SIZE(AA), SIZE(IA) = [2,2,N], where N is
% the number of linear systems. DA is ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.