Skip to content

define 2d geometry from binary file

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics define 2d geometry from binary file

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5094
    lmkerguelen
    Participant

    Hello,

    I’m wondering what’s the most straightforward way to load a 2d binary file (microfluidic configuration with 0’s as void and 1’s as solid) as a simulation domain. From the cylinder2d example I understand I have to set the material numbers in my superGeometry to their appropriate values. In the example, this is done using Indicators. However, obstacles in my domain are irregular and would be challenging to define using indicators.
    Is there a way I can access elements directly in my superGeometry to set the material numbers by iterating through my 2d binary file and modifying the elements at their corresponding indices? Or perhaps a way to load a geometry with appropriate material numbers (generated via matlab or another platform)?

    Thanks,

    Lucas

    #5095
    mathias
    Keymaster

    Dear Lucas,

    you can save the data as vti file and use the reader BlockVTKwriter2D. From it get BlockF and transform the functur by using an iterpolation fonctor to an indicator functor. You may also right your own reader with an indicator interface.

    Best
    Mathias

    #5465
    Aleks
    Participant

    Dear Mathias,

    Could you share some example of the usage of vti files as a straightforward source of the material numbers? User Guide and examples contain nothing close while Developer Guide is just doxygen files which do not allow to catch the approach easily.

    Kind regards,
    Aleks

    #5466
    mathias
    Keymaster

    I have no example for it, sorry. In a common project, we can set it up for you. Best Mathias

    #5467
    Aleks
    Participant

    Please, let me ask the following questions then

    * You said: “save the data as vti file and use the reader BlockVTKwriter2D”. Isn’t some typo here, since BlockVTKwriter2D is a writer, not a reader?

    * If it’s typo and we are talking about vtiReader in particular, I’d like to ask about principle ability to import 2D vti files so far as declaration and implementation of VTIreader2D is commented in current version of code?

    * If my guesses are incorrect partially or completely could you point sort of some more detailed workflow to import material numbers from 2D vti files?

    • This reply was modified 3 years, 8 months ago by Aleks.
    • This reply was modified 3 years, 8 months ago by Aleks.
    #5470
    mathias
    Keymaster

    You are right, I meant the vtiReader!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.