Esempio n. 1
0
def get_system_from_options(options_file=None,
                            boundary_grid=None,
                            block=None,
                            velocity_name='Velocity',
                            dist=None):
    """Derive particle system from options file."""

    reader = Options.OptionsReader(options_file)

    if boundary_grid is None:

        mesh = IO.GmshMesh()
        mesh.read(reader.get_mesh_filename())

        boundary_grid = IO.make_boundary_from_msh(mesh)

    boundary = IO.BoundaryData(bnd=boundary_grid,
                               outlet_ids=reader.get_outlet_ids(),
                               inlets=reader.get_inlets(),
                               dist=dist)

    if block is None:
        system = System(boundary,
                        base_name=reader.get_name(),
                        gravity=reader.get_gravity(),
                        omega=reader.get_rotation()[0],
                        velocity_name=velocity_name)
    else:
        system = System(boundary,
                        block=block,
                        gravity=reader.get_gravity(),
                        omega=reader.get_rotation()[0],
                        velocity_name=velocity_name)

    return system
Esempio n. 2
0
def get_system_from_options(options_file=None, boundary_grid=None,
                            block=None, velocity_name='Velocity',dist=None):

    reader=Options.OptionsReader(options_file)

    if boundary_grid is None:

        mesh=IO.GmshMesh()
        mesh.read(reader.get_mesh_filename())

        boundary_grid = IO.make_boundary_from_msh(mesh)

    boundary = IO.BoundaryData(bnd=boundary_grid,
                               outlet_ids=reader.get_outlet_ids(),
                               inlets=reader.get_inlets(), dist=dist)

    if block is None:
        system = System(boundary,base_name=reader.get_name(),
                         gravity=reader.get_gravity(),
                        omega=reader.get_rotation()[0],
                        velocity_name=velocity_name)
    else:
        system = System(boundary,block=block,
                        gravity=reader.get_gravity(),
                        omega=reader.get_rotation()[0],
                        velocity_name=velocity_name)

    return system
Esempio n. 3
0
def get_system_from_reader(reader, boundary_grid=None):

    if boundary_grid is None:

        mesh=IO.GmshMesh()
        mesh.read(reader.get_mesh_filename())

        boundary_grid = IO.make_boundary_from_msh(mesh)


    boundary = IO.BoundaryData(bnd=boundary_grid)
    system = System(boundary,base_name=reader.get_name(),
                    gravity=reader.get_gravity(),
                    omega=reader.get_rotation()[0])

    return system
Esempio n. 4
0
def get_system_from_reader(reader, boundary_grid=None):
    """Derive system from options reader."""

    if boundary_grid is None:

        mesh = IO.GmshMesh()
        mesh.read(reader.get_mesh_filename())

        boundary_grid = IO.make_boundary_from_msh(mesh)

    boundary = IO.BoundaryData(bnd=boundary_grid)
    system = System(boundary,
                    base_name=reader.get_name(),
                    gravity=reader.get_gravity(),
                    omega=reader.get_rotation()[0])

    return system
Esempio n. 5
0
 def update_boundary_from_mesh(self, mesh):
     """Update boundary object from mesh."""
     self.boundary.update_boundary_file(IO.make_boundary_from_msh(mesh))