[cig-commits] [commit] devel, master: replaced block_mesh.py with create_mesh.py (1800307)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Jun 18 16:54:57 PDT 2014
Repository : https://github.com/geodynamics/specfem3d
On branches: devel,master
Link : https://github.com/geodynamics/specfem3d/compare/6026e367984905ab133865f62fa6293b343759b9...47f703851338234f96397e7da9fbff63d8178b8a
>---------------------------------------------------------------
commit 180030733bc4a41ec997c814515b6c013ca9c9d2
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date: Fri Jun 6 17:54:55 2014 +0200
replaced block_mesh.py with create_mesh.py
>---------------------------------------------------------------
180030733bc4a41ec997c814515b6c013ca9c9d2
README | 9 ++---
.../block_mesh.py | 38 ----------------------
.../create_mesh.py | 22 ++++++++-----
.../block_mesh.py | 1 -
.../create_mesh.py | 1 +
5 files changed, 16 insertions(+), 55 deletions(-)
diff --git a/README b/README
index b785729..e2bbba6 100644
--- a/README
+++ b/README
@@ -71,18 +71,13 @@ check that the version of cubit 32/64 bit matches the python version...
in order to have the possibility to import cubit in a python script.
+Set CUBITHOME to the directory where you installed CUBIT
export CUBITDIR=$CUBITHOME
export CUBITLIB=$CUBITDIR/bin:$CUBITDIR/structure
export PYTHONPATH=$PYTHONPATH:$CUBITDIR/bin:$CUBITDIR/structure
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUBITDIR/bin
export PATH=$PATH:$CUBITDIR/bin
-if you own the root privileges
+type "source setpaths.sh" in CUBIT_GEOCUBIT/ directory
-python setup.py install
-
-or
-
-export PYTHONPATH=$PYTHONPATH:/import/u/u1/uaf/casarott/GEOCUBIT--experimental
-export PATH=$PATH:/import/u/u1/uaf/casarott/GEOCUBIT--experimental
diff --git a/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py b/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py
deleted file mode 100755
index 8637594..0000000
--- a/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!python
-#!/usr/bin/env python
-
-# block_mesh.py is a script that generates mesh specific to homogenous halfspace example i.e., a uniform mesh of 134 km x 134 km x 60 km with an element size 3.75 km.
-# It is not applicable to other examples.
-
-import cubit
-import boundary_definition
-import cubit2specfem3d
-
-import os
-import sys
-
-cubit.cmd('reset')
-cubit.cmd('brick x 134000 y 134000 z 60000')
-cubit.cmd('volume 1 move x 67000 y 67000 z -30000')
-
-elementsize = 3750.0
-
-cubit.cmd('volume 1 size '+str(elementsize))
-cubit.cmd('mesh volume 1')
-
-boundary_definition.entities=['face']
-boundary_definition.define_bc(boundary_definition.entities,parallel=True)
-
-cubit.cmd('block 4 name "elastic 1" ') # elastic material region
-cubit.cmd('block 4 attribute count 7')
-cubit.cmd('block 4 attribute index 1 1') # flag for material: 1 for 1. material
-cubit.cmd('block 4 attribute index 2 2300') # rho
-cubit.cmd('block 4 attribute index 3 2800') # vp
-cubit.cmd('block 4 attribute index 4 1500') # vs
-cubit.cmd('block 4 attribute index 5 9000.0') # Qkappa
-cubit.cmd('block 4 attribute index 6 9000.0') # Qmu
-cubit.cmd('block 4 attribute index 7 0 ') # anisotropy_flag
-
-os.system('mkdir -p MESH')
-cubit2specfem3d.export2SPECFEM3D('MESH')
-
diff --git a/waterlayered_halfspace/make_mesh_waterlater_verticalboundary.py b/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/create_mesh.py
similarity index 59%
copy from waterlayered_halfspace/make_mesh_waterlater_verticalboundary.py
copy to homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/create_mesh.py
index cd4c2c0..3e30aaf 100755
--- a/waterlayered_halfspace/make_mesh_waterlater_verticalboundary.py
+++ b/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/create_mesh.py
@@ -1,15 +1,16 @@
+#!python
#!/usr/bin/env python
-SEMoutput='MESH'
-CUBIToutput='MESH_GEOCUBIT'
+# "create_mesh.py" is a script that generates mesh specific to homogenous halfspace example
+# i.e., a uniform mesh of 134 km x 134 km x 60 km with an element size 3.75 km.
+# It is not applicable to other examples.
import cubit
-try:
- cubit.init([""])
-except:
- pass
-
+import boundary_definition
+import cubit2specfem3d
+import os
+import sys
cubit.cmd('reset')
cubit.cmd('brick x 67000 y 134000 z 60000')
@@ -21,6 +22,7 @@ cubit.cmd('merge all')
# Meshing the volumes
elementsize = 3000.0
+
cubit.cmd('volume 1 size '+str(elementsize))
cubit.cmd('volume 2 size '+str(elementsize))
cubit.cmd('mesh volume 1 2')
@@ -29,5 +31,7 @@ cubit.cmd('mesh volume 1 2')
from geocubitlib import boundary_definition,exportlib
boundary_definition.define_bc(parallel=True)
-exportlib.collect(outdir=CUBIToutput)
-exportlib.e2SEM(outdir=SEMoutput)
+
+exportlib.collect(outdir='MESH/')
+exportlib.e2SEM(outdir='MESH/')
+
diff --git a/homogeneous_halfspace_HEX8_elastic_no_absorbing/block_mesh.py b/homogeneous_halfspace_HEX8_elastic_no_absorbing/block_mesh.py
deleted file mode 120000
index 6e64dd4..0000000
--- a/homogeneous_halfspace_HEX8_elastic_no_absorbing/block_mesh.py
+++ /dev/null
@@ -1 +0,0 @@
-../homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py
\ No newline at end of file
diff --git a/homogeneous_halfspace_HEX8_elastic_no_absorbing/create_mesh.py b/homogeneous_halfspace_HEX8_elastic_no_absorbing/create_mesh.py
new file mode 120000
index 0000000..dc2f7cb
--- /dev/null
+++ b/homogeneous_halfspace_HEX8_elastic_no_absorbing/create_mesh.py
@@ -0,0 +1 @@
+../homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/create_mesh.py
\ No newline at end of file
More information about the CIG-COMMITS
mailing list