ocmw.design.otm_bcfile module

Tools for generating an Open Telemac-Mascaret boundary condtions file (*.cli) from a *.msh ASCII file.

parse_arguments

Parse the command-line arguments.

initialise_bc_file

Initialise the OpenTelemac oupt boundary conditions file to be generated.

clistr

Generate output string for curent boundary node to write to the OpenTelemac boundary conditions file.

sort_bnds

Sort mesh boundary elemets by ID

extract_mshbnds

Get the mesh boundary elements and sort by boundary ID

extract_bnd_nodes

Get the mesh boundary nodes from mesh boundary elements

create_bc_file

Create an Open Telemac-Mascaret boundary condtions file

msh2cli

Generate an Open Telemac-Mascaret boundary condtions file from a GMsh mesh file that includes bathymetry.

Tools for generating an OpenTelemac boundary condtions file (*.cli) from a Gmsh ASCII mesh file that has the bathymetry (z level) data included.

ocmw.design.otm_bcfile.parse_arguments()[source]

Parse the command-line arguments.

Returns:

arguments (Name-space) – A python name-space containing all the command-line arguments

ocmw.design.otm_bcfile.initialise_bc_file(datapath, clifile)[source]

Initialise the OpenTelemac oupt boundary conditions file to be generated.

Parameters:
  • datapath (string) – Full path string to where the file is to be generated.

  • clifile (string) – Name of the OpenTelemac boundary conditions file to generate.

Returns:

fhnd (file object) – Handle to the open file object.

ocmw.design.otm_bcfile.clistr(bndcond, trctype, node, elem, bndname)[source]

Generate output string for curent boundary node to write to the OpenTelemac boundary conditions file.

Parameters:
  • bndcond (string) – Space delimited 3 digit string defining the boundary condition type. The dafault is ‘5 6 6’ - open bounddary with prescribed UV and H.

  • trctype (string) – A single character string defining the tracer condition for the current boundary node. The dafault is ‘4’ Free tracers.

  • node (string) – Model boundary node ID as a string.

  • elem (string) – Sequential counter value for node element in boundary conditions file.

  • bndname (string) – Open boundary name identifier.

Returns:

line (string) – Formmated line to write to the OpenTelemac boundary conditions file.

ocmw.design.otm_bcfile.sort_bnds(bnds)[source]

Sort mesh boundary elemets by ID

ocmw.design.otm_bcfile.extract_mshbnds(datapath, mshfile)[source]

Get the mesh boundary elements and sort by boundary ID

ocmw.design.otm_bcfile.extract_bnd_nodes(mshbnds, bndids)[source]

Get the mesh boundary nodes from mesh boundary elements

ocmw.design.otm_bcfile.create_bc_file(datapath, mshfile, clifile, bndids=[1], bndconds=['5 6 6'], trcconds=['4'], bndnames=['openBoundary'])[source]

Create an Open Telemac-Mascaret boundary condtions file

ocmw.design.otm_bcfile.msh2cli(datapath, mshfile, bc_suffix=None, bndids=[1], bndconds=['5 6 6'], trcconds=['4'], bndnames=['openBoundary'])[source]

Generate an Open Telemac-Mascaret boundary condtions file from a GMsh mesh file that includes bathymetry.