SPECFEM / specfem2d

SPECFEM2D simulates forward and adjoint seismic wave propagation in two-dimensional acoustic, (an)elastic, poroelastic or coupled acoustic-(an)elastic-poroelastic media, with Convolution PML absorbing conditions.
https://specfem.org
GNU General Public License v3.0
203 stars 147 forks source link

Is it feasible to implement viscous-spring boundary in SPEC-FEM2D by setting up a parallel spring-damper system? #1236

Open ikunhub1 opened 3 months ago

ikunhub1 commented 3 months ago

Because I saw the bug code in the unresolved-bugs file

------------------------------------------------------------------------------

def ProcessParfile_r19804(fic):

Open the file and get all lines from Par_file

ligs= LoadLig(fic)

for ilg, lig in enumerate(ligs):
    if lig.startswith('PERFORM_CUTHILL_MCKEE'):
        ligs[ilg]=ligs[ilg].replace('.true.','.false.')

# Test if already processed
for lig in ligs:
    if 'ADD_SPRING_TO_STACEY' in lig:
        print('----> '+fic+' already processed to r19804')
        return
#
a1='ADD_SPRING_TO_STACEY            = .true.\n'

#--------------------------------------------------------------------------
# Add new parameters
#
for ilg, lig in enumerate(ligs):
    if lig.startswith('absorbing_conditions'):
        ligs.insert(ilg+1,a1)
#
move(fic,fic+'.before_update_to_r19804')
#
fm = open(fic,'w')
fm.writelines(ligs)
fm.close()
#
print('xxxxx------> '+fic+' processed to r19804')
return

------------------------------------------------------------------------------