Code Monkey home page Code Monkey logo

Comments (5)

jerabaul29 avatar jerabaul29 commented on July 19, 2024

Hi,

Yes, basically you will need to change this file as you said, which is basically a scripted description of your geometry in gmsh format:

https://github.com/jerabaul29/Cylinder2DFlowControlDRL/blob/master/Cylinder2DFlowControlWithRL/geometry_2d.template_geo

and possibly a bit of this, which is setting up the relevant parameters there:

https://github.com/jerabaul29/Cylinder2DFlowControlDRL/blob/master/Cylinder2DFlowControlWithRL/generate_msh.py

I also recommend that you base your work on the more recent code available there:

https://github.com/jerabaul29/Cylinder2DFlowControlDRLParallel

Let me know if anything is unclear. You may need to spend a bit of time learning about gmsh at first. Also, gmsh, fenics, and tensorforce are all packages undergoing rapid development, and the code here (and on the parallel repo) is already 2 and 1 years old respective, so if you want to use the latest features of the underlying packages, you may have a bit of porting / small updates to do.

from cylinder2dflowcontroldrl.

turtle-mei avatar turtle-mei commented on July 19, 2024

I think I know the general idea,thanks for your help! Thank you.

from cylinder2dflowcontroldrl.

turtle-mei avatar turtle-mei commented on July 19, 2024

hi,
I apologize for distracting you. I would be very grateful for any help!
i change the geo and parameters. when i run the code,there are the below error.

`Info : 5913 vertices 11054 elements
Info : Writing 'mesh/turek_2d.msh'...
Info : Done writing 'mesh/turek_2d.msh'
Info : Stopped on Mon Apr 27 01:48:42 2020
Converting from Gmsh format (.msh, .gmsh) to DOLFIN XML format
Expecting 5110 vertices
Found all vertices
Expecting 9810 cells
Found all cells
Traceback (most recent call last):
File "/usr/bin/dolfin-convert", line 132, in
main(sys.argv[1:])
File "/usr/bin/dolfin-convert", line 79, in main
meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1304, in convert2xml
convert(ifilename, XmlHandler(ofilename), iformat=iformat)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1325, in convert
gmsh2xml(ifilename, handler)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 495, in gmsh2xml
index = nodes_as_facets[tuple(nodes)]
KeyError: (0, 16)
Aborted
Traceback (most recent call last):
File "make_mesh.py", line 2, in
env.resume_env(plot=500, remesh=True)
File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/env.py", line 181, in resume_env
simu_name = simu_name)
File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/../Env2DCylinder.py", line 132, in init
self.start_class(complete_reset=True)
File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/../Env2DCylinder.py", line 190, in start_class
convert(msh_file, h5_file)
File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/../msh_convert.py", line 17, in convert
mesh = Mesh(xml_file)
File "/usr/lib/python2.7/dist-packages/dolfin/mesh/meshes.py", line 63, in init
cpp.Mesh.cppinit(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/dolfin/cpp/mesh.py", line 2074, in init
_mesh.Mesh_swiginit(self, _mesh.new_Mesh(*args))
RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at


*** [email protected]


*** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.


*** -------------------------------------------------------------------------
*** Error: Unable to read data from XML file.
*** Reason: Error while parsing XML with status "Start-end tags mismatch".
*** Where: This error was encountered inside XMLFile.cpp.
*** Process: 0


*** DOLFIN version: 2017.2.0
*** Git changeset: unknown
*** -------------------------------------------------------------------------

Aborted`
but when i comment out the part that about define the jet surface in the geometry_2d.template_geo ,it run normally.
i feel so comfused.

from cylinder2dflowcontroldrl.

jerabaul29 avatar jerabaul29 commented on July 19, 2024
  • Have you ever been able to create any mesh with custom geometry successfully before?

  • if yes, have you changed anything regarding the packages used? For example, gmsh or other version?

  • Are you sure you use the right gmsh version? You should use the one there: https://github.com/jerabaul29/Cylinder2DFlowControlDRL/blob/master/gmsh . Other versions may not be compatible. Please check that you well use the gmsh in question, not something else linked by your system.

  • have you checked on the other issues if you get the answer to your problems:

#12

#4

  • are you sure that your mesh is 'valid' and well described? Can you mesh directly with gmsh tool in GUI, and display the mesh to check that everything looks good?

from cylinder2dflowcontroldrl.

jerabaul29 avatar jerabaul29 commented on July 19, 2024

Other than that, there is not much I can do, as things quickly become machine / installation / case specific.

from cylinder2dflowcontroldrl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.