Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ISSMteam/ISSM
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuMorlighem committed Jul 25, 2024
2 parents b801141 + 6a2b0e0 commit 53bb73e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/m/classes/levelset.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function levelset (){

//stabilization = 1 by default
this.stabilization = 1;
this.reinit_frequency = 5;
this.reinit_frequency = 10;
this.kill_icebergs = 1;
this.migration_max = 1e12; //No need for general cases, unless specified

Expand All @@ -20,7 +20,10 @@ function levelset (){
this.disp= function(){// {{{

console.log(sprintf(' Level-set parameters:'));
fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
fielddisplay(this,'stabilization','0: No Stabilization - No stabilization techniques applied.');
console.log(' 1: Artificial Diffusivity - Most stable, but least accurate.');
console.log(' 2: Streamline Upwinding');
console.log(' 5: SUPG - Most accurate, but may be unstable in some applications.');
fielddisplay(this,'spclevelset','Levelset constraints (NaN means no constraint)');
fielddisplay(this,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized (NaN: no re-initialization).');
fielddisplay(this,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
Expand Down Expand Up @@ -64,7 +67,7 @@ function levelset (){

this.stabilization = 0;
this.spclevelset = NaN;
this.reinit_frequency = NaN;
this.reinit_frequency = 10;
this.kill_icebergs = 0;
this.migration_max = 0.;
this.fe = 'P1';
Expand Down
9 changes: 6 additions & 3 deletions src/m/classes/levelset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class levelset(object):
def __init__(self): # {{{
self.stabilization = 0
self.spclevelset = np.nan
self.reinit_frequency = 5
self.reinit_frequency = 10
self.kill_icebergs = 0
self.migration_max = 0
self.fe = 'P1'
Expand All @@ -26,7 +26,10 @@ def __init__(self): # {{{
# }}}
def __repr__(self): # {{{
s = ' Level-set parameters:\n'
s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding'))
s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: No Stabilization - No stabilization techniques applied.'))
s += '{}\n'.format(' 1: Artificial Diffusivity - Most stable, but least accurate.')
s += '{}\n'.format(' 2: Streamline Upwinding')
s += '{}\n'.format(' 5: SUPG - Most accurate, but may be unstable in some applications.')
s += '{}\n'.format(fielddisplay(self, 'spclevelset', 'Levelset constraints (NaN means no constraint)'))
s += '{}\n'.format(fielddisplay(self, 'reinit_frequency', 'Amount of time steps after which the levelset function in re-initialized'))
s += '{}\n'.format(fielddisplay(self, 'kill_icebergs', 'remove floating icebergs to prevent rigid body motions (1: true, 0: false)'))
Expand All @@ -39,7 +42,7 @@ def __repr__(self): # {{{
def setdefaultparameters(self): # {{{
# Stabilization = 1 by default
self.stabilization = 1
self.reinit_frequency = 5
self.reinit_frequency = 10
self.kill_icebergs = 1
self.migration_max = 1e12 # No need for general cases, unless specified

Expand Down

0 comments on commit 53bb73e

Please sign in to comment.