[cig-commits] [commit] devel: Merge HEX27 mesher + clean stuff in DSM directory (db45edb)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Nov 27 15:41:46 PST 2014
Repository : https://github.com/geodynamics/specfem3d
On branch : devel
Link : https://github.com/geodynamics/specfem3d/compare/c03570160da2904c3100ec5e80b5068857972a33...b2e6274976c364b76f2990b3c8ce2d19dd18c938
>---------------------------------------------------------------
commit db45edb22e1b98c6613db0e19692f71a72b324cc
Author: Clément Durochat <c.durochat at gmail.com>
Date: Thu Nov 27 17:30:39 2014 +0100
Merge HEX27 mesher + clean stuff in DSM directory
>---------------------------------------------------------------
db45edb22e1b98c6613db0e19692f71a72b324cc
.../example_simple_small/DATA/Par_file | 2 +-
.../batch_run_benchmark_all_process.sh | 24 ++++++-----
.../example_simple_small/clean_this_example_dir | 2 +-
.../example_simple_small/params.in | 7 ++--
src/meshfem3D/earth_chunk_HEX27_Mesher.f90 | 16 ++++---
src/meshfem3D/earth_chunk_all_Utils.f90 | 49 ++++++++++++++--------
src/meshfem3D/meshfem3D.f90 | 2 -
.../DSM_FOR_SPECFEM3D/shells/scripts_specfem3D.sh | 2 -
.../HEX27/visualize_HEX27_chunk_w_medit.f90 | 4 --
.../HEX8/visualize_HEX8_chunk_w_medit.f90 | 4 --
10 files changed, 61 insertions(+), 51 deletions(-)
diff --git a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/DATA/Par_file b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/DATA/Par_file
index db5be59..ebfbd62 100644
--- a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/DATA/Par_file
+++ b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/DATA/Par_file
@@ -26,7 +26,7 @@ DT = 0.1
# If you use our internal mesher, the only option is 8-node bricks (27-node elements are not supported)
# CUBIT does not support HEX27 elements either (it can generate them, but they are flat, i.e. identical to HEX8).
# To generate HEX27 elements with curvature properly taken into account, you can use Gmsh http://geuz.org/gmsh/
-NGNOD = 8
+NGNOD = 27
# models:
# available options are:
diff --git a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/batch_run_benchmark_all_process.sh b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/batch_run_benchmark_all_process.sh
index debbf26..6570dee 100755
--- a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/batch_run_benchmark_all_process.sh
+++ b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/batch_run_benchmark_all_process.sh
@@ -3,13 +3,13 @@
# ------------ BACTH AND SPECIFIC CLUSTER DIRECTIVES ------
-#MSUB -r Benchmark_finalcouple32_SPECFEM3D_DSM # Nom du job
+#MSUB -r Benchmark_SPECFEM3D_DSM_HEX27_32p # Nom du job
#MSUB -n 32
#MSUB -N 2
#MSUB -T 5400
#MSUB -q standard
-#MSUB -e Benchmark_finalcouple_run_32.e
-#MSUB -o Benchmark_finalcouple_run_32.o
+#MSUB -e Benchmark_SPECFEM3D_DSM_HEX27_32p_run.e
+#MSUB -o Benchmark_SPECFEM3D_DSM_HEX27_32p_run.o
#MSUB -A ra2410
set -x
@@ -152,7 +152,7 @@ clean_and_make_dir
# clean and make directories DSM
clean_and_make_dir_dsm
-# mv some input files in rigth place
+# mv some input files in right place
mv input_dsm_for_write_coef $IN_DSM/inputIASP.infTra_for_coef
mv input_dsm_for_read_xmin $IN_DSM/inputIASP.infTra_stxmin
mv input_dsm_for_read_xmax $IN_DSM/inputIASP.infTra_stxmax
@@ -169,12 +169,15 @@ echo " BENCHMARK RUN " >> $flog_file
echo >> $flog_file
echo $(date) >> $flog_file
-
+# ----------------------------------------------------
# 1 / ------- create mesh
+# ----------------------------------------------------
run_create_mesh
+# ----------------------------------------------------
# 2 / ----- compute DSM tractions
+# ----------------------------------------------------
cd $DSM_tractions
make_dir_exp
copy_input_files_exp
@@ -182,9 +185,9 @@ compute_exp_coeff
run_dsm_traction
-
-
+# ----------------------------------------------------
# 3 / ------- create specfem3D data base
+# ----------------------------------------------------
echo "" >> $flog_file
echo $(date) >> $flog_file
run_create_specfem_databases
@@ -192,7 +195,9 @@ echo " create specfem3D data base" >> $flog_file
echo $(date) >> $flog_file
+# ----------------------------------------------------
# 4 / -------- create tractions for specfem3D from DSM
+# ----------------------------------------------------
echo "" >> $flog_file
echo " create traction database" >> $flog_file
echo $(date) >> $flog_file
@@ -202,10 +207,9 @@ run_create_tractions_for_specfem
echo $(date) >> $flog_file
-
-
-
+# ----------------------------------------------------
# 5 / --------------- run simulation
+# ----------------------------------------------------
echo "" >> $flog_file
echo " simulation" >> $flog_file
echo $(date) >> $flog_file
diff --git a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/clean_this_example_dir b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/clean_this_example_dir
index 8fbfdbb..d14b46c 100755
--- a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/clean_this_example_dir
+++ b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/clean_this_example_dir
@@ -1,3 +1,3 @@
#!/bin/bash
-rm -rf *~ Tract/ OUTPUT_FILES/ DSM_tractions/ MESH/* xmin_gll_for_dsm_0000* *.out
+rm -rf *~ Tract/ OUTPUT_FILES/ DSM_tractions/ MESH/* xmin_gll_for_dsm_0000* *.out fort.* DATA/DSM_tractions_for_specfem3D/
diff --git a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/params.in b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/params.in
index 4d32de1..bd331d7 100644
--- a/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/params.in
+++ b/EXAMPLES/DSM_FOR_SPECFEM3D/example_simple_small/params.in
@@ -1,7 +1,6 @@
-HOME_SPECFEM3D=/ccc/scratch/cont003/gen7165/durochtc/Codes/SPECFEM3Ds/specfem3d
-BIN=$HOME_SPECFEM3D/utils/DSM_FOR_SPECFEM3D/bin
-BINSEM=$HOME_SPECFEM3D/bin
-SCRIPTS=$HOME_SPECFEM3D/utils/DSM_FOR_SPECFEM3D/shells
+BIN=${HOME_SPECFEM3D}/utils/DSM_FOR_SPECFEM3D/bin
+BINSEM=${HOME_SPECFEM3D}/bin
+SCRIPTS=${HOME_SPECFEM3D}/utils/DSM_FOR_SPECFEM3D/shells
DSM_tractions=$(pwd)/DSM_tractions/
OUT=$DSM_tractions
REP=Tract/
diff --git a/src/meshfem3D/earth_chunk_HEX27_Mesher.f90 b/src/meshfem3D/earth_chunk_HEX27_Mesher.f90
index f7e2160..1adc948 100644
--- a/src/meshfem3D/earth_chunk_HEX27_Mesher.f90
+++ b/src/meshfem3D/earth_chunk_HEX27_Mesher.f90
@@ -484,7 +484,6 @@
iboun(6,ispec)=.true.
endif
- ! 8 vertices of the element ispec
do ia=1,NGNOD
!! MODIF HEX27 LA -----------------------------
@@ -493,21 +492,28 @@
j=iaddy(ia)
k=iaddz(ia)
- z = 1000d0*ProfForGemini(iz,1+k)
+ SELECT CASE (k)
+ CASE(0)
+ z = 1000d0*ProfForGemini(iz,1)
+ CASE(1)
+ z = 1000d0*ProfForGemini(iz,3)
+ CASE(2)
+ z = 1000d0*ProfForGemini(iz,2)
+ END SELECT
! longitude
- ratio_xi = (dble(ilon+i)) / dble(NX)
+ ratio_xi = (dble(ilon) + dble(i)/2.d0 ) / dble(NX)
x = 2.d0*ratio_xi-1.d0
x = tan((ANGULAR_WIDTH_XI_RAD/2.d0) * x)
! latitude
- ratio_eta = (dble(ilat+j)) / dble(NY)
+ ratio_eta = (dble(ilat) + dble(j)/2.d0 ) / dble(NY)
y = 2.d0*ratio_eta-1.d0
y = tan((ANGULAR_WIDTH_ETA_RAD/2.d0) * y)
! mapping cubic sphere (k=6, Chevrot at al 2012, avec -z)
- pz= z/dsqrt(1.d0 + y*y + x*x) !(=r/s)
+ pz= z/dsqrt(1.d0 + y*y + x*x) !(=r/s)
px= pz * x !(tan(xi) * r/s)
py= pz * y !(tan(eta) * r/s)
diff --git a/src/meshfem3D/earth_chunk_all_Utils.f90 b/src/meshfem3D/earth_chunk_all_Utils.f90
index 55ee96f..bfe8133 100644
--- a/src/meshfem3D/earth_chunk_all_Utils.f90
+++ b/src/meshfem3D/earth_chunk_all_Utils.f90
@@ -1011,17 +1011,18 @@ end subroutine StorePointZ
enddo
enddo
- ifseg(:)=.false.
-
- nseg=1
- ifseg(1)=.true.
- ninseg(1)=npointot
+ ifseg(:) = .false.
+ nseg = 1
+ ifseg(1) = .true.
+ ninseg(1) = npointot
do j=1,3 !,NDIM
! sort within each segment
- ioff=1
+ ioff = 1
+
do iseg=1,nseg
+
if (j == 1) then
call rank(xp(ioff),ind,ninseg(iseg))
else if (j == 2) then
@@ -1029,46 +1030,58 @@ end subroutine StorePointZ
else
call rank(zp(ioff),ind,ninseg(iseg))
endif
+
call swap_all(loc(ioff),xp(ioff),yp(ioff),zp(ioff),iwork,work,ind,ninseg(iseg))
- ioff=ioff+ninseg(iseg)
+
+ ioff = ioff + ninseg(iseg)
+
enddo
! check for jumps in current coordinate
! compare the coordinates of the points within a small tolerance
if (j == 1) then
+
do i=2,npointot
- if (dabs(xp(i)-xp(i-1)) > SMALLVALTOL) ifseg(i)=.true.
+ if (dabs(xp(i)-xp(i-1)) > SMALLVALTOL) ifseg(i) = .true.
enddo
+
else if (j == 2) then
+
do i=2,npointot
- if (dabs(yp(i)-yp(i-1)) > SMALLVALTOL) ifseg(i)=.true.
+ if (dabs(yp(i)-yp(i-1)) > SMALLVALTOL) ifseg(i) = .true.
enddo
+
else
+
do i=2,npointot
- if (dabs(zp(i)-zp(i-1)) > SMALLVALTOL) ifseg(i)=.true.
+ if (dabs(zp(i)-zp(i-1)) > SMALLVALTOL) ifseg(i) = .true.
enddo
+
endif
! count up number of different segments
- nseg=0
+ nseg = 0
+
do i=1,npointot
if (ifseg(i)) then
- nseg=nseg+1
- ninseg(nseg)=1
+ nseg = nseg + 1
+ ninseg(nseg) = 1
else
- ninseg(nseg)=ninseg(nseg)+1
+ ninseg(nseg) = ninseg(nseg) + 1
endif
enddo
enddo
! assign global node numbers (now sorted lexicographically)
- ig=0
+ ig = 0
+
do i=1,npointot
- if (ifseg(i)) ig=ig+1
- iglob(loc(i))=ig
+ if (ifseg(i)) ig = ig + 1
+
+ iglob(loc(i)) = ig
enddo
- nglob=ig
+ nglob = ig
! deallocate arrays
deallocate(ind)
diff --git a/src/meshfem3D/meshfem3D.f90 b/src/meshfem3D/meshfem3D.f90
index 1bf997a..e769312 100644
--- a/src/meshfem3D/meshfem3D.f90
+++ b/src/meshfem3D/meshfem3D.f90
@@ -419,8 +419,6 @@
stop 'Done creating a chunk of the earth Mesh (HEX8 elements), see directory MESH/'
else if (NGNOD == 27) then
- ! provisional
- stop 'Creating a chunk of the earth Mesh with HEX27 elements is implmented but not validated yet for coupling with DSM'
! creates mesh in MESH/
call earth_chunk_HEX27_Mesher(NGNOD)
diff --git a/utils/DSM_FOR_SPECFEM3D/shells/scripts_specfem3D.sh b/utils/DSM_FOR_SPECFEM3D/shells/scripts_specfem3D.sh
index a32283c..175d459 100755
--- a/utils/DSM_FOR_SPECFEM3D/shells/scripts_specfem3D.sh
+++ b/utils/DSM_FOR_SPECFEM3D/shells/scripts_specfem3D.sh
@@ -42,8 +42,6 @@ cp $MESH/model_1D.in DATA/
function run_create_specfem_databases ()
{
-cp ParFileInterface bin/.
-
$BINSEM/xdecompose_mesh $NPROC $MESH OUTPUT_FILES/DATABASES_MPI/
mv Numglob2loc_elmn.txt $MESH/.
diff --git a/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX27/visualize_HEX27_chunk_w_medit.f90 b/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX27/visualize_HEX27_chunk_w_medit.f90
index d6823f9..4a7b7b6 100755
--- a/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX27/visualize_HEX27_chunk_w_medit.f90
+++ b/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX27/visualize_HEX27_chunk_w_medit.f90
@@ -28,10 +28,6 @@ PROGRAM visualize_HEX27_chunk_w_medit
READ(35,*) nq5
READ(36,*) nq6
- PRINT*, 'CAUTION : the value for the number of faces on the free surface is hard imposed (225) !'
-
- nq6 = 225 !! pourquoi ??
-
nhexdecoup = 8*nhex
nqdecoup = 4*(nq1 + nq2 + nq3 + nq4 + nq5 + nq6)
diff --git a/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX8/visualize_HEX8_chunk_w_medit.f90 b/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX8/visualize_HEX8_chunk_w_medit.f90
index 034a037..d487f3d 100755
--- a/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX8/visualize_HEX8_chunk_w_medit.f90
+++ b/utils/Visualization/visualize_chunk_of_the_earth_with_MEDIT/HEX8/visualize_HEX8_chunk_w_medit.f90
@@ -27,10 +27,6 @@ PROGRAM visualize_HEX8_chunk_w_medit
READ(35,*) nq5
READ(36,*) nq6
- PRINT*, 'CAUTION : the value for the number of faces on the free surface is hard imposed (225) !'
-
- nq6 = 225 !! pourquoi ??
-
nquad = nq1 + nq2 + nq3 + nq4 + nq5 + nq6
WRITE(20,*) 'MeshVersionFormatted 1'
More information about the CIG-COMMITS
mailing list