Open liaohaiyang1534 opened 1 year ago
Hi Haiyang Liao,
There may be an issue with voids.
Alternatively, you can define the sidesets within the Cubit, and use the exodus2specfem3d application in MeshAssist package (https://github.com/homnath/MeshAssist). It generally works in any complex models including voids. https://github.com/homnath/MeshAssist Check section 4.6 of the documentation https://github.com/homnath/MeshAssist/blob/master/doc/manual_MeshAssist.pdf
Best, Hom Nath
From: liaohaiyang1534 @.> Sent: Wednesday, June 28, 2023 9:20 AM To: SPECFEM/specfem3d @.> Cc: Subscribed @.***> Subject: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620)
Hi,
I'm going to create a model with a hole in it, I put seven blocks together, the middle block adds the materiall property of the hole. The python code runs successfully, but it doesn't seem to generate the mesh_file and materials_file.
Here is a picture of the model, which looks alright
Here is a small portion of the output of python code:
In case you need more detailed code information, here is the python code:
from future import print_function
import os import sys
dll_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" path = os.environ.get('PATH', '') if dll_path not in path.split(';'): new_path = path + ';' + dll_path if path else dll_path os.environ['PATH'] = new_path
sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin") sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin\_cubit3.pyd")
cubit_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" python_path = os.environ.get('PYTHONPATH', '') if cubit_path not in python_path.split(';'): new_python_path = python_path + ';' + cubit_path if python_path else cubit_path os.environ['PYTHONPATH'] = new_python_path
sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT/geocubitlib") sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT")
elementsize = 1
SEMoutput='MESH' CUBIToutput='MESH_GEOCUBIT'
os.system('mkdir -p '+ SEMoutput) os.system('mkdir -p '+ CUBIToutput)
import cubit try: cubit.init(["-noecho","-nojournal"]) except: pass
version = cubit.get_version() version_major = int(version.split(".")[0]) version_minor = int(version.split(".")[1]) print("cubit version: ",version)
cubit.cmd('reset')
cubit.cmd('brick x 3 y 3 z 3') cubit.cmd('volume 1 move x 0 y 0 z -4')
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 2 move x 0 y 0 z 4.25')
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 3 move x 0 y 0 z -12.25')
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 4 move x 25.75 y 0 z -4')
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 5 move x -25.75 y 0 z -4')
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 6 move x 0 y 4.75 z -4')
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 7 move x 0 y -4.75 z -4')
cubit.cmd('merge all') cubit.cmd('imprint all')
cubit.cmd('volume all size 1') cubit.cmd('mesh volume all')
cubit.cmd('block 1 volume 1') cubit.cmd('block 1 name "elastic 1"') cubit.cmd('block 1 attribute count 7') cubit.cmd('block 1 attribute index 1 1') cubit.cmd('block 1 attribute index 2 340') cubit.cmd('block 1 attribute index 3 17') cubit.cmd('block 1 attribute index 4 500') cubit.cmd('block 1 attribute index 5 9999') cubit.cmd('block 1 attribute index 6 9999') cubit.cmd('block 1 attribute index 7 0')
cubit.cmd('block 2 volume 2') cubit.cmd('block 2 name "elastic 2"') cubit.cmd('block 2 attribute count 7') cubit.cmd('block 2 attribute index 1 2') cubit.cmd('block 2 attribute index 2 475') cubit.cmd('block 2 attribute index 3 230') cubit.cmd('block 2 attribute index 4 2000') cubit.cmd('block 2 attribute index 5 9999') cubit.cmd('block 2 attribute index 6 9999') cubit.cmd('block 2 attribute index 7 0')
cubit.cmd('block 3 volume 3') cubit.cmd('block 3 name "elastic 2"') cubit.cmd('block 3 attribute count 7') cubit.cmd('block 3 attribute index 1 3') cubit.cmd('block 3 attribute index 2 475') cubit.cmd('block 3 attribute index 3 230') cubit.cmd('block 3 attribute index 4 2000') cubit.cmd('block 3 attribute index 5 9999') cubit.cmd('block 3 attribute index 6 9999') cubit.cmd('block 3 attribute index 7 0')
cubit.cmd('block 4 volume 4') cubit.cmd('block 4 name "elastic 2"') cubit.cmd('block 4 attribute count 7') cubit.cmd('block 4 attribute index 1 4') cubit.cmd('block 4 attribute index 2 475') cubit.cmd('block 4 attribute index 3 230') cubit.cmd('block 4 attribute index 4 2000') cubit.cmd('block 4 attribute index 5 9999') cubit.cmd('block 4 attribute index 6 9999') cubit.cmd('block 4 attribute index 7 0')
cubit.cmd('block 5 volume 5') cubit.cmd('block 5 name "elastic 2"') cubit.cmd('block 5 attribute count 7') cubit.cmd('block 5 attribute index 1 5') cubit.cmd('block 5 attribute index 2 475') cubit.cmd('block 5 attribute index 3 230') cubit.cmd('block 5 attribute index 4 2000') cubit.cmd('block 5 attribute index 5 9999') cubit.cmd('block 5 attribute index 6 9999') cubit.cmd('block 5 attribute index 7 0')
cubit.cmd('block 6 volume 6') cubit.cmd('block 6 name "elastic 2"') cubit.cmd('block 6 attribute count 7') cubit.cmd('block 6 attribute index 1 6') cubit.cmd('block 6 attribute index 2 475') cubit.cmd('block 6 attribute index 3 230') cubit.cmd('block 6 attribute index 4 2000') cubit.cmd('block 6 attribute index 5 9999') cubit.cmd('block 6 attribute index 6 9999') cubit.cmd('block 6 attribute index 7 0')
cubit.cmd('block 7 volume 7') cubit.cmd('block 7 name "elastic 2"') cubit.cmd('block 7 attribute count 7') cubit.cmd('block 7 attribute index 1 7') cubit.cmd('block 7 attribute index 2 475') cubit.cmd('block 7 attribute index 3 230') cubit.cmd('block 7 attribute index 4 2000') cubit.cmd('block 7 attribute index 5 9999') cubit.cmd('block 7 attribute index 6 9999') cubit.cmd('block 7 attribute index 7 0')
cubit.cmd('export mesh MESH_GEOCUBIT/top.e dimension 3 overwrite') cubit.cmd('save as MESH_GEOCUBIT/top.cub overwrite')
cubit2specfem3d.export2SPECFEM3D(SEMoutput)
if version_major >= 16 and version_minor >= 4: cubit.cmd('view top') cubit.cmd('hardcopy "' + CUBIToutput + '/waterlayered.png" png')
I'm very appreciated to have any advice and suggestions for this. (If you need any more clarifications, please let me know)
Regards
Haiyang Liao @.**@.>
— Reply to this email directly, view it on GitHubhttps://github.com/SPECFEM/specfem3d/issues/1620, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABMCQ4UDWOEO3QNYOBJZKDLXNQVTJANCNFSM6AAAAAAZXD6IUA. You are receiving this because you are subscribed to this thread.Message ID: @.***>
could you try with a small different definition of the blocks?
for example
cubit.cmd('block 4 hex in volume 4')
instead of
cubit.cmd('block 4 volume 4')
On Thu, Jun 29, 2023 at 6:11 AM Hom Nath Gharti @.***> wrote:
Hi Haiyang Liao,
There may be an issue with voids.
Alternatively, you can define the sidesets within the Cubit, and use the exodus2specfem3d application in MeshAssist package ( https://github.com/homnath/MeshAssist). It generally works in any complex models including voids. https://github.com/homnath/MeshAssist Check section 4.6 of the documentation https://github.com/homnath/MeshAssist/blob/master/doc/manual_MeshAssist.pdf
Best, Hom Nath
From: liaohaiyang1534 @.> Sent: Wednesday, June 28, 2023 9:20 AM To: SPECFEM/specfem3d @.> Cc: Subscribed @.***> Subject: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620)
Hi,
I'm going to create a model with a hole in it, I put seven blocks together, the middle block adds the materiall property of the hole. The python code runs successfully, but it doesn't seem to generate the mesh_file and materials_file.
Here is a picture of the model, which looks alright
Here is a small portion of the output of python code:
In case you need more detailed code information, here is the python code:
!/usr/bin/env python
from future import print_function
import os import sys
Add the PATH of Cubit-associated DLL files to path
dll_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" path = os.environ.get('PATH', '') if dll_path not in path.split(';'): new_path = path + ';' + dll_path if path else dll_path os.environ['PATH'] = new_path
sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin") sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin\_cubit3.pyd")
Add cubit path to PYTHONPATH
cubit_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" python_path = os.environ.get('PYTHONPATH', '') if cubit_path not in python_path.split(';'): new_python_path = python_path + ';' + cubit_path if python_path else cubit_path os.environ['PYTHONPATH'] = new_python_path
sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT/geocubitlib") sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT")
elementsize = 1
SEMoutput='MESH' CUBIToutput='MESH_GEOCUBIT'
os.system('mkdir -p '+ SEMoutput) os.system('mkdir -p '+ CUBIToutput)
import cubit try: cubit.init(["-noecho","-nojournal"]) except: pass
version = cubit.get_version() version_major = int(version.split(".")[0]) version_minor = int(version.split(".")[1]) print("cubit version: ",version)
cubit.cmd('reset')
create a hole
cubit.cmd('brick x 3 y 3 z 3') cubit.cmd('volume 1 move x 0 y 0 z -4')
create the top volume of the hole
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 2 move x 0 y 0 z 4.25')
create the bottom volume of the hole
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 3 move x 0 y 0 z -12.25')
create the front volume of the hole
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 4 move x 25.75 y 0 z -4')
create the back volume of the hole
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 5 move x -25.75 y 0 z -4')
create the left volume of the hole
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 6 move x 0 y 4.75 z -4')
create the right volume of the hole
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 7 move x 0 y -4.75 z -4')
cubit.cmd('merge all') cubit.cmd('imprint all')
cubit.cmd('volume all size 1') cubit.cmd('mesh volume all')
cubit.cmd('block 1 volume 1') cubit.cmd('block 1 name "elastic 1"') cubit.cmd('block 1 attribute count 7') cubit.cmd('block 1 attribute index 1 1') cubit.cmd('block 1 attribute index 2 340') cubit.cmd('block 1 attribute index 3 17') cubit.cmd('block 1 attribute index 4 500') cubit.cmd('block 1 attribute index 5 9999') cubit.cmd('block 1 attribute index 6 9999') cubit.cmd('block 1 attribute index 7 0')
cubit.cmd('block 2 volume 2') cubit.cmd('block 2 name "elastic 2"') cubit.cmd('block 2 attribute count 7') cubit.cmd('block 2 attribute index 1 2') cubit.cmd('block 2 attribute index 2 475') cubit.cmd('block 2 attribute index 3 230') cubit.cmd('block 2 attribute index 4 2000') cubit.cmd('block 2 attribute index 5 9999') cubit.cmd('block 2 attribute index 6 9999') cubit.cmd('block 2 attribute index 7 0')
cubit.cmd('block 3 volume 3') cubit.cmd('block 3 name "elastic 2"') cubit.cmd('block 3 attribute count 7') cubit.cmd('block 3 attribute index 1 3') cubit.cmd('block 3 attribute index 2 475') cubit.cmd('block 3 attribute index 3 230') cubit.cmd('block 3 attribute index 4 2000') cubit.cmd('block 3 attribute index 5 9999') cubit.cmd('block 3 attribute index 6 9999') cubit.cmd('block 3 attribute index 7 0')
cubit.cmd('block 4 volume 4') cubit.cmd('block 4 name "elastic 2"') cubit.cmd('block 4 attribute count 7') cubit.cmd('block 4 attribute index 1 4') cubit.cmd('block 4 attribute index 2 475') cubit.cmd('block 4 attribute index 3 230') cubit.cmd('block 4 attribute index 4 2000') cubit.cmd('block 4 attribute index 5 9999') cubit.cmd('block 4 attribute index 6 9999') cubit.cmd('block 4 attribute index 7 0')
cubit.cmd('block 5 volume 5') cubit.cmd('block 5 name "elastic 2"') cubit.cmd('block 5 attribute count 7') cubit.cmd('block 5 attribute index 1 5') cubit.cmd('block 5 attribute index 2 475') cubit.cmd('block 5 attribute index 3 230') cubit.cmd('block 5 attribute index 4 2000') cubit.cmd('block 5 attribute index 5 9999') cubit.cmd('block 5 attribute index 6 9999') cubit.cmd('block 5 attribute index 7 0')
cubit.cmd('block 6 volume 6') cubit.cmd('block 6 name "elastic 2"') cubit.cmd('block 6 attribute count 7') cubit.cmd('block 6 attribute index 1 6') cubit.cmd('block 6 attribute index 2 475') cubit.cmd('block 6 attribute index 3 230') cubit.cmd('block 6 attribute index 4 2000') cubit.cmd('block 6 attribute index 5 9999') cubit.cmd('block 6 attribute index 6 9999') cubit.cmd('block 6 attribute index 7 0')
cubit.cmd('block 7 volume 7') cubit.cmd('block 7 name "elastic 2"') cubit.cmd('block 7 attribute count 7') cubit.cmd('block 7 attribute index 1 7') cubit.cmd('block 7 attribute index 2 475') cubit.cmd('block 7 attribute index 3 230') cubit.cmd('block 7 attribute index 4 2000') cubit.cmd('block 7 attribute index 5 9999') cubit.cmd('block 7 attribute index 6 9999') cubit.cmd('block 7 attribute index 7 0')
cubit.cmd('export mesh MESH_GEOCUBIT/top.e dimension 3 overwrite') cubit.cmd('save as MESH_GEOCUBIT/top.cub overwrite')
cubit2specfem3d.export2SPECFEM3D(SEMoutput)
if version_major >= 16 and version_minor >= 4: cubit.cmd('view top') cubit.cmd('hardcopy "' + CUBIToutput + '/waterlayered.png" png')
I'm very appreciated to have any advice and suggestions for this. (If you need any more clarifications, please let me know)
Regards
Haiyang Liao @.**@.>
— Reply to this email directly, view it on GitHub< https://github.com/SPECFEM/specfem3d/issues/1620>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ABMCQ4UDWOEO3QNYOBJZKDLXNQVTJANCNFSM6AAAAAAZXD6IUA>.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
— Reply to this email directly, view it on GitHub https://github.com/SPECFEM/specfem3d/issues/1620#issuecomment-1612405149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQG2CNXH2KFEJJX2IGUVDXNT6ALANCNFSM6AAAAAAZXD6IUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi, casarotti
it really works! thanks a lot! i really appreciate that
Hi, Hom Nath
Thanks for your suggestion, I'll take a closer look
Best
could you try with a small different definition of the blocks? for example cubit.cmd('block 4 hex in volume 4') instead of cubit.cmd('block 4 volume 4') … On Thu, Jun 29, 2023 at 6:11 AM Hom Nath Gharti @.> wrote: Hi Haiyang Liao, There may be an issue with voids. Alternatively, you can define the sidesets within the Cubit, and use the exodus2specfem3d application in MeshAssist package ( https://github.com/homnath/MeshAssist). It generally works in any complex models including voids. https://github.com/homnath/MeshAssist Check section 4.6 of the documentation https://github.com/homnath/MeshAssist/blob/master/doc/manual_MeshAssist.pdf Best, Hom Nath ____ From: liaohaiyang1534 @.> Sent: Wednesday, June 28, 2023 9:20 AM To: SPECFEM/specfem3d @.> Cc: Subscribed @.> Subject: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620) Hi, I'm going to create a model with a hole in it, I put seven blocks together, the middle block adds the materiall property of the hole. The python code runs successfully, but it doesn't seem to generate the mesh_file and materials_file. Here is a picture of the model, which looks alright [image]< https://user-images.githubusercontent.com/104192749/249480543-17edb8bb-e8bd-4cb2-b7c5-7f4cbc86c53c.png> Here is a small portion of the output of python code: [image]< https://user-images.githubusercontent.com/104192749/249481018-af69c3e3-7a1b-4045-8b03-1598e4f7b36a.png> In case you need more detailed code information, here is the python code: #!/usr/bin/env python from future import print_function import os import sys # Add the PATH of Cubit-associated DLL files to path dll_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" path = os.environ.get('PATH', '') if dll_path not in path.split(';'): new_path = path + ';' + dll_path if path else dll_path os.environ['PATH'] = new_path sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin") sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin\_cubit3.pyd") # Add cubit path to PYTHONPATH cubit_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" python_path = os.environ.get('PYTHONPATH', '') if cubit_path not in python_path.split(';'): new_python_path = python_path + ';' + cubit_path if python_path else cubit_path os.environ['PYTHONPATH'] = new_python_path sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT/geocubitlib") sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT") elementsize = 1 SEMoutput='MESH' CUBIToutput='MESH_GEOCUBIT' os.system('mkdir -p '+ SEMoutput) os.system('mkdir -p '+ CUBIToutput) import cubit try: cubit.init(["-noecho","-nojournal"]) except: pass version = cubit.get_version() version_major = int(version.split(".")[0]) version_minor = int(version.split(".")[1]) print("cubit version: ",version) cubit.cmd('reset') # create a hole cubit.cmd('brick x 3 y 3 z 3') cubit.cmd('volume 1 move x 0 y 0 z -4') # create the top volume of the hole cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 2 move x 0 y 0 z 4.25') # create the bottom volume of the hole cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 3 move x 0 y 0 z -12.25') # create the front volume of the hole cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 4 move x 25.75 y 0 z -4') # create the back volume of the hole cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 5 move x -25.75 y 0 z -4') # create the left volume of the hole cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 6 move x 0 y 4.75 z -4') # create the right volume of the hole cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 7 move x 0 y -4.75 z -4') cubit.cmd('merge all') cubit.cmd('imprint all') cubit.cmd('volume all size 1') cubit.cmd('mesh volume all') cubit.cmd('block 1 volume 1') cubit.cmd('block 1 name "elastic 1"') cubit.cmd('block 1 attribute count 7') cubit.cmd('block 1 attribute index 1 1') cubit.cmd('block 1 attribute index 2 340') cubit.cmd('block 1 attribute index 3 17') cubit.cmd('block 1 attribute index 4 500') cubit.cmd('block 1 attribute index 5 9999') cubit.cmd('block 1 attribute index 6 9999') cubit.cmd('block 1 attribute index 7 0') cubit.cmd('block 2 volume 2') cubit.cmd('block 2 name "elastic 2"') cubit.cmd('block 2 attribute count 7') cubit.cmd('block 2 attribute index 1 2') cubit.cmd('block 2 attribute index 2 475') cubit.cmd('block 2 attribute index 3 230') cubit.cmd('block 2 attribute index 4 2000') cubit.cmd('block 2 attribute index 5 9999') cubit.cmd('block 2 attribute index 6 9999') cubit.cmd('block 2 attribute index 7 0') cubit.cmd('block 3 volume 3') cubit.cmd('block 3 name "elastic 2"') cubit.cmd('block 3 attribute count 7') cubit.cmd('block 3 attribute index 1 3') cubit.cmd('block 3 attribute index 2 475') cubit.cmd('block 3 attribute index 3 230') cubit.cmd('block 3 attribute index 4 2000') cubit.cmd('block 3 attribute index 5 9999') cubit.cmd('block 3 attribute index 6 9999') cubit.cmd('block 3 attribute index 7 0') cubit.cmd('block 4 volume 4') cubit.cmd('block 4 name "elastic 2"') cubit.cmd('block 4 attribute count 7') cubit.cmd('block 4 attribute index 1 4') cubit.cmd('block 4 attribute index 2 475') cubit.cmd('block 4 attribute index 3 230') cubit.cmd('block 4 attribute index 4 2000') cubit.cmd('block 4 attribute index 5 9999') cubit.cmd('block 4 attribute index 6 9999') cubit.cmd('block 4 attribute index 7 0') cubit.cmd('block 5 volume 5') cubit.cmd('block 5 name "elastic 2"') cubit.cmd('block 5 attribute count 7') cubit.cmd('block 5 attribute index 1 5') cubit.cmd('block 5 attribute index 2 475') cubit.cmd('block 5 attribute index 3 230') cubit.cmd('block 5 attribute index 4 2000') cubit.cmd('block 5 attribute index 5 9999') cubit.cmd('block 5 attribute index 6 9999') cubit.cmd('block 5 attribute index 7 0') cubit.cmd('block 6 volume 6') cubit.cmd('block 6 name "elastic 2"') cubit.cmd('block 6 attribute count 7') cubit.cmd('block 6 attribute index 1 6') cubit.cmd('block 6 attribute index 2 475') cubit.cmd('block 6 attribute index 3 230') cubit.cmd('block 6 attribute index 4 2000') cubit.cmd('block 6 attribute index 5 9999') cubit.cmd('block 6 attribute index 6 9999') cubit.cmd('block 6 attribute index 7 0') cubit.cmd('block 7 volume 7') cubit.cmd('block 7 name "elastic 2"') cubit.cmd('block 7 attribute count 7') cubit.cmd('block 7 attribute index 1 7') cubit.cmd('block 7 attribute index 2 475') cubit.cmd('block 7 attribute index 3 230') cubit.cmd('block 7 attribute index 4 2000') cubit.cmd('block 7 attribute index 5 9999') cubit.cmd('block 7 attribute index 6 9999') cubit.cmd('block 7 attribute index 7 0') cubit.cmd('export mesh MESH_GEOCUBIT/top.e dimension 3 overwrite') cubit.cmd('save as MESH_GEOCUBIT/top.cub overwrite') cubit2specfem3d.export2SPECFEM3D(SEMoutput) if version_major >= 16 and version_minor >= 4: cubit.cmd('view top') cubit.cmd('hardcopy "' + CUBIToutput + '/waterlayered.png" png') I'm very appreciated to have any advice and suggestions for this. (If you need any more clarifications, please let me know) Regards Haiyang Liao @.**@.> — Reply to this email directly, view it on GitHub< #1620>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ABMCQ4UDWOEO3QNYOBJZKDLXNQVTJANCNFSM6AAAAAAZXD6IUA>. You are receiving this because you are subscribed to this thread.Message ID: @.> — Reply to this email directly, view it on GitHub <#1620 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQG2CNXH2KFEJJX2IGUVDXNT6ALANCNFSM6AAAAAAZXD6IUA . You are receiving this because you are subscribed to this thread.Message ID: @.>
Hi casarotti,
You gave me a suggestion last time, which worked, but then I encountered a problem, which has not been resolved until now. The problem is that an error occurs when running this line of command: cubit2specfem3d.export2SPECFEM3D(SEMoutput) An error occurred while generating the boundary conditions:
Although this error is due to adding boundary conditions, and I can add better CPML in specfem3d, maybe I can ignore this error. But I later found that there may be a problem inside the grid, so I wonder if it is related to the error here. I haven't been able to solve this error for days.
Do you have any other suggestions? I will be very grateful!
In case you need more detailed information, here is the python code and error information: TypeError 'NoneType' object is not iterable.txt
@liaohaiyang1534 I've been working on this model building issue recently as well, did you finally fix it,Have you ever tried treating the hole with a free surface instead of treating it as air?
I haven't done simulations for a long time, and the issue wasn't resolved last time. I plan to continue with noise simulations in the future. Please let me know if there are any updates. Recently, I have been working on noise imaging.
廖海洋 | |
---|---|
@. | ---- Replied Message ---- | From | @.> | | Date | 7/2/2024 11:17 | | To | @.> | | Cc | @.> , @.***> | | Subject | Re: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620) |
@liaohaiyang1534 I've been working on this model building issue recently as well, did you finally fix it
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Yes, I clearly remember trying that, but it didn't work either. I don't quite remember the specific error.
Any suggestions are welcome at any time~
廖海洋 | |
---|---|
@. | ---- Replied Message ---- | From | emanuele @.> | | Date | 6/29/2023 12:31 | | To | @.> | | Cc | @.> , @.***> | | Subject | Re: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620) |
could you try with a small different definition of the blocks?
for example
cubit.cmd('block 4 hex in volume 4')
instead of
cubit.cmd('block 4 volume 4')
On Thu, Jun 29, 2023 at 6:11 AM Hom Nath Gharti @.***> wrote:
Hi Haiyang Liao,
There may be an issue with voids.
Alternatively, you can define the sidesets within the Cubit, and use the exodus2specfem3d application in MeshAssist package ( https://github.com/homnath/MeshAssist). It generally works in any complex models including voids. https://github.com/homnath/MeshAssist Check section 4.6 of the documentation https://github.com/homnath/MeshAssist/blob/master/doc/manual_MeshAssist.pdf
Best, Hom Nath
From: liaohaiyang1534 @.> Sent: Wednesday, June 28, 2023 9:20 AM To: SPECFEM/specfem3d @.> Cc: Subscribed @.***> Subject: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620)
Hi,
I'm going to create a model with a hole in it, I put seven blocks together, the middle block adds the materiall property of the hole. The python code runs successfully, but it doesn't seem to generate the mesh_file and materials_file.
Here is a picture of the model, which looks alright
Here is a small portion of the output of python code:
In case you need more detailed code information, here is the python code:
!/usr/bin/env python
from future import print_function
import os import sys
Add the PATH of Cubit-associated DLL files to path
dll_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" path = os.environ.get('PATH', '') if dll_path not in path.split(';'): new_path = path + ';' + dll_path if path else dll_path os.environ['PATH'] = new_path
sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin") sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin\_cubit3.pyd")
Add cubit path to PYTHONPATH
cubit_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" python_path = os.environ.get('PYTHONPATH', '') if cubit_path not in python_path.split(';'): new_python_path = python_path + ';' + cubit_path if python_path else cubit_path os.environ['PYTHONPATH'] = new_python_path
sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT/geocubitlib") sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT")
elementsize = 1
SEMoutput='MESH' CUBIToutput='MESH_GEOCUBIT'
os.system('mkdir -p '+ SEMoutput) os.system('mkdir -p '+ CUBIToutput)
import cubit try: cubit.init(["-noecho","-nojournal"]) except: pass
version = cubit.get_version() version_major = int(version.split(".")[0]) version_minor = int(version.split(".")[1]) print("cubit version: ",version)
cubit.cmd('reset')
create a hole
cubit.cmd('brick x 3 y 3 z 3') cubit.cmd('volume 1 move x 0 y 0 z -4')
create the top volume of the hole
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 2 move x 0 y 0 z 4.25')
create the bottom volume of the hole
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 3 move x 0 y 0 z -12.25')
create the front volume of the hole
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 4 move x 25.75 y 0 z -4')
create the back volume of the hole
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 5 move x -25.75 y 0 z -4')
create the left volume of the hole
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 6 move x 0 y 4.75 z -4')
create the right volume of the hole
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 7 move x 0 y -4.75 z -4')
cubit.cmd('merge all') cubit.cmd('imprint all')
cubit.cmd('volume all size 1') cubit.cmd('mesh volume all')
cubit.cmd('block 1 volume 1') cubit.cmd('block 1 name "elastic 1"') cubit.cmd('block 1 attribute count 7') cubit.cmd('block 1 attribute index 1 1') cubit.cmd('block 1 attribute index 2 340') cubit.cmd('block 1 attribute index 3 17') cubit.cmd('block 1 attribute index 4 500') cubit.cmd('block 1 attribute index 5 9999') cubit.cmd('block 1 attribute index 6 9999') cubit.cmd('block 1 attribute index 7 0')
cubit.cmd('block 2 volume 2') cubit.cmd('block 2 name "elastic 2"') cubit.cmd('block 2 attribute count 7') cubit.cmd('block 2 attribute index 1 2') cubit.cmd('block 2 attribute index 2 475') cubit.cmd('block 2 attribute index 3 230') cubit.cmd('block 2 attribute index 4 2000') cubit.cmd('block 2 attribute index 5 9999') cubit.cmd('block 2 attribute index 6 9999') cubit.cmd('block 2 attribute index 7 0')
cubit.cmd('block 3 volume 3') cubit.cmd('block 3 name "elastic 2"') cubit.cmd('block 3 attribute count 7') cubit.cmd('block 3 attribute index 1 3') cubit.cmd('block 3 attribute index 2 475') cubit.cmd('block 3 attribute index 3 230') cubit.cmd('block 3 attribute index 4 2000') cubit.cmd('block 3 attribute index 5 9999') cubit.cmd('block 3 attribute index 6 9999') cubit.cmd('block 3 attribute index 7 0')
cubit.cmd('block 4 volume 4') cubit.cmd('block 4 name "elastic 2"') cubit.cmd('block 4 attribute count 7') cubit.cmd('block 4 attribute index 1 4') cubit.cmd('block 4 attribute index 2 475') cubit.cmd('block 4 attribute index 3 230') cubit.cmd('block 4 attribute index 4 2000') cubit.cmd('block 4 attribute index 5 9999') cubit.cmd('block 4 attribute index 6 9999') cubit.cmd('block 4 attribute index 7 0')
cubit.cmd('block 5 volume 5') cubit.cmd('block 5 name "elastic 2"') cubit.cmd('block 5 attribute count 7') cubit.cmd('block 5 attribute index 1 5') cubit.cmd('block 5 attribute index 2 475') cubit.cmd('block 5 attribute index 3 230') cubit.cmd('block 5 attribute index 4 2000') cubit.cmd('block 5 attribute index 5 9999') cubit.cmd('block 5 attribute index 6 9999') cubit.cmd('block 5 attribute index 7 0')
cubit.cmd('block 6 volume 6') cubit.cmd('block 6 name "elastic 2"') cubit.cmd('block 6 attribute count 7') cubit.cmd('block 6 attribute index 1 6') cubit.cmd('block 6 attribute index 2 475') cubit.cmd('block 6 attribute index 3 230') cubit.cmd('block 6 attribute index 4 2000') cubit.cmd('block 6 attribute index 5 9999') cubit.cmd('block 6 attribute index 6 9999') cubit.cmd('block 6 attribute index 7 0')
cubit.cmd('block 7 volume 7') cubit.cmd('block 7 name "elastic 2"') cubit.cmd('block 7 attribute count 7') cubit.cmd('block 7 attribute index 1 7') cubit.cmd('block 7 attribute index 2 475') cubit.cmd('block 7 attribute index 3 230') cubit.cmd('block 7 attribute index 4 2000') cubit.cmd('block 7 attribute index 5 9999') cubit.cmd('block 7 attribute index 6 9999') cubit.cmd('block 7 attribute index 7 0')
cubit.cmd('export mesh MESH_GEOCUBIT/top.e dimension 3 overwrite') cubit.cmd('save as MESH_GEOCUBIT/top.cub overwrite')
cubit2specfem3d.export2SPECFEM3D(SEMoutput)
if version_major >= 16 and version_minor >= 4: cubit.cmd('view top') cubit.cmd('hardcopy "' + CUBIToutput + '/waterlayered.png" png')
I'm very appreciated to have any advice and suggestions for this. (If you need any more clarifications, please let me know)
Regards
Haiyang Liao @.**@.>
— Reply to this email directly, view it on GitHub< https://github.com/SPECFEM/specfem3d/issues/1620>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ABMCQ4UDWOEO3QNYOBJZKDLXNQVTJANCNFSM6AAAAAAZXD6IUA>.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
— Reply to this email directly, view it on GitHub https://github.com/SPECFEM/specfem3d/issues/1620#issuecomment-1612405149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQG2CNXH2KFEJJX2IGUVDXNT6ALANCNFSM6AAAAAAZXD6IUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Thank you, I have used this before. Thanks for this library, I should try it again later.
I hope this cavity simulation will be more convenient in the future.
By the way, do you have any recommended software for ambient noise simulation?
廖海洋 | |
---|---|
@. | ---- Replied Message ---- | From | Hom Nath @.> | | Date | 6/29/2023 12:11 | | To | @.> | | Cc | @.> , @.***> | | Subject | Re: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620) |
Hi Haiyang Liao,
There may be an issue with voids.
Alternatively, you can define the sidesets within the Cubit, and use the exodus2specfem3d application in MeshAssist package (https://github.com/homnath/MeshAssist). It generally works in any complex models including voids. https://github.com/homnath/MeshAssist Check section 4.6 of the documentation https://github.com/homnath/MeshAssist/blob/master/doc/manual_MeshAssist.pdf
Best, Hom Nath
From: liaohaiyang1534 @.> Sent: Wednesday, June 28, 2023 9:20 AM To: SPECFEM/specfem3d @.> Cc: Subscribed @.***> Subject: [SPECFEM/specfem3d] error when creating a model with a hole (Issue #1620)
Hi,
I'm going to create a model with a hole in it, I put seven blocks together, the middle block adds the materiall property of the hole. The python code runs successfully, but it doesn't seem to generate the mesh_file and materials_file.
Here is a picture of the model, which looks alright
Here is a small portion of the output of python code:
In case you need more detailed code information, here is the python code:
from future import print_function
import os import sys
dll_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" path = os.environ.get('PATH', '') if dll_path not in path.split(';'): new_path = path + ';' + dll_path if path else dll_path os.environ['PATH'] = new_path
sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin") sys.path.append("E:\coreforum cubit\coreform cubit 2022.11\bin\_cubit3.pyd")
cubit_path = r"E:\coreform cubit\coreform cubit 2022.11\bin" python_path = os.environ.get('PYTHONPATH', '') if cubit_path not in python_path.split(';'): new_python_path = python_path + ';' + cubit_path if python_path else cubit_path os.environ['PYTHONPATH'] = new_python_path
sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT/geocubitlib") sys.path.append("../../specfem3d-master/CUBIT_GEOCUBIT")
elementsize = 1
SEMoutput='MESH' CUBIToutput='MESH_GEOCUBIT'
os.system('mkdir -p '+ SEMoutput) os.system('mkdir -p '+ CUBIToutput)
import cubit try: cubit.init(["-noecho","-nojournal"]) except: pass
version = cubit.get_version() version_major = int(version.split(".")[0]) version_minor = int(version.split(".")[1]) print("cubit version: ",version)
cubit.cmd('reset')
cubit.cmd('brick x 3 y 3 z 3') cubit.cmd('volume 1 move x 0 y 0 z -4')
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 2 move x 0 y 0 z 4.25')
cubit.cmd('brick x 100 y 16 z 13.5') cubit.cmd('volume 3 move x 0 y 0 z -12.25')
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 4 move x 25.75 y 0 z -4')
cubit.cmd('brick x 48.5 y 16 z 3') cubit.cmd('volume 5 move x -25.75 y 0 z -4')
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 6 move x 0 y 4.75 z -4')
cubit.cmd('brick x 3 y 6.5 z 3') cubit.cmd('volume 7 move x 0 y -4.75 z -4')
cubit.cmd('merge all') cubit.cmd('imprint all')
cubit.cmd('volume all size 1') cubit.cmd('mesh volume all')
cubit.cmd('block 1 volume 1') cubit.cmd('block 1 name "elastic 1"') cubit.cmd('block 1 attribute count 7') cubit.cmd('block 1 attribute index 1 1') cubit.cmd('block 1 attribute index 2 340') cubit.cmd('block 1 attribute index 3 17') cubit.cmd('block 1 attribute index 4 500') cubit.cmd('block 1 attribute index 5 9999') cubit.cmd('block 1 attribute index 6 9999') cubit.cmd('block 1 attribute index 7 0')
cubit.cmd('block 2 volume 2') cubit.cmd('block 2 name "elastic 2"') cubit.cmd('block 2 attribute count 7') cubit.cmd('block 2 attribute index 1 2') cubit.cmd('block 2 attribute index 2 475') cubit.cmd('block 2 attribute index 3 230') cubit.cmd('block 2 attribute index 4 2000') cubit.cmd('block 2 attribute index 5 9999') cubit.cmd('block 2 attribute index 6 9999') cubit.cmd('block 2 attribute index 7 0')
cubit.cmd('block 3 volume 3') cubit.cmd('block 3 name "elastic 2"') cubit.cmd('block 3 attribute count 7') cubit.cmd('block 3 attribute index 1 3') cubit.cmd('block 3 attribute index 2 475') cubit.cmd('block 3 attribute index 3 230') cubit.cmd('block 3 attribute index 4 2000') cubit.cmd('block 3 attribute index 5 9999') cubit.cmd('block 3 attribute index 6 9999') cubit.cmd('block 3 attribute index 7 0')
cubit.cmd('block 4 volume 4') cubit.cmd('block 4 name "elastic 2"') cubit.cmd('block 4 attribute count 7') cubit.cmd('block 4 attribute index 1 4') cubit.cmd('block 4 attribute index 2 475') cubit.cmd('block 4 attribute index 3 230') cubit.cmd('block 4 attribute index 4 2000') cubit.cmd('block 4 attribute index 5 9999') cubit.cmd('block 4 attribute index 6 9999') cubit.cmd('block 4 attribute index 7 0')
cubit.cmd('block 5 volume 5') cubit.cmd('block 5 name "elastic 2"') cubit.cmd('block 5 attribute count 7') cubit.cmd('block 5 attribute index 1 5') cubit.cmd('block 5 attribute index 2 475') cubit.cmd('block 5 attribute index 3 230') cubit.cmd('block 5 attribute index 4 2000') cubit.cmd('block 5 attribute index 5 9999') cubit.cmd('block 5 attribute index 6 9999') cubit.cmd('block 5 attribute index 7 0')
cubit.cmd('block 6 volume 6') cubit.cmd('block 6 name "elastic 2"') cubit.cmd('block 6 attribute count 7') cubit.cmd('block 6 attribute index 1 6') cubit.cmd('block 6 attribute index 2 475') cubit.cmd('block 6 attribute index 3 230') cubit.cmd('block 6 attribute index 4 2000') cubit.cmd('block 6 attribute index 5 9999') cubit.cmd('block 6 attribute index 6 9999') cubit.cmd('block 6 attribute index 7 0')
cubit.cmd('block 7 volume 7') cubit.cmd('block 7 name "elastic 2"') cubit.cmd('block 7 attribute count 7') cubit.cmd('block 7 attribute index 1 7') cubit.cmd('block 7 attribute index 2 475') cubit.cmd('block 7 attribute index 3 230') cubit.cmd('block 7 attribute index 4 2000') cubit.cmd('block 7 attribute index 5 9999') cubit.cmd('block 7 attribute index 6 9999') cubit.cmd('block 7 attribute index 7 0')
cubit.cmd('export mesh MESH_GEOCUBIT/top.e dimension 3 overwrite') cubit.cmd('save as MESH_GEOCUBIT/top.cub overwrite')
cubit2specfem3d.export2SPECFEM3D(SEMoutput)
if version_major >= 16 and version_minor >= 4: cubit.cmd('view top') cubit.cmd('hardcopy "' + CUBIToutput + '/waterlayered.png" png')
I'm very appreciated to have any advice and suggestions for this. (If you need any more clarifications, please let me know)
Regards
Haiyang Liao @.**@.>
— Reply to this email directly, view it on GitHubhttps://github.com/SPECFEM/specfem3d/issues/1620, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABMCQ4UDWOEO3QNYOBJZKDLXNQVTJANCNFSM6AAAAAAZXD6IUA. You are receiving this because you are subscribed to this thread.Message ID: @.***>
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Hi,
I'm going to create a model with a hole in it, I put seven blocks together, the middle block adds the materiall property of the hole. The python code runs successfully, but it doesn't seem to generate the mesh_file and materials_file.
Here is a picture of the model, which looks alright
Here is a small portion of the output of python code:
In case you need more detailed code information, here is the python code:
I'm very appreciated to have any advice and suggestions for this. (If you need any more clarifications, please let me know)
Regards
Haiyang Liao haiyangliao@smail.nju.edu.cn