usm3d Package

bc_to_nastran Module

pyNastran.converters.usm3d.bc_to_nastran.cogsg_bc_to_nastran(cogsg_filename, bc_filename, nastran_filename, include_shells=True, include_solids=False)[source]

converts a *.cogsg and a *.bc file to a *.bdf file

iface_format Module

Inheritance diagram of pyNastran.converters.usm3d.iface_format
class pyNastran.converters.usm3d.iface_format.IFace(log=None, debug=None)[source]

Bases: object

read_iface(iface_filename)[source]

BC File… nFaces nBouc, nRegions, ???

nFaces - number of faces on the surface nBouc - ??? nRegions - number of independent surfaces that are set in the mapbc file ???? -

Cogsg File… header = {

‘dummy’: 6266912, ‘nBoundPts’: 28434, ‘nPoints’: 79734, ‘nElements’: 391680, ‘nViscPts’: 26304, ‘nViscElem’: 130560, ‘tc’: 0.0, ‘inew’: -1,

}

read_poin1(poin1_filename)[source]
pyNastran.converters.usm3d.iface_format.factors(nraw)[source]

function for getting the primes factors of a number.

This is supposed to help with figuring out the file format. I’m sure there’s a better method, but it doesn’t matter too much.

time_accurate_results Module

pyNastran.converters.usm3d.time_accurate_results.get_flo_files(dirname, model_name, nstart=0, nlimit=None, include_dirname_in_path=True)[source]

get the flo files in ascending order

pyNastran.converters.usm3d.time_accurate_results.get_flo_files_from_n(dirname, model_name, n_list, include_dirname_in_path=True)[source]

get the flo files in ascending order

pyNastran.converters.usm3d.time_accurate_results.get_n_list(dirname, model_name)[source]
gets files of the form:
  • modelname + ‘_xxx.flo’

pyNastran.converters.usm3d.time_accurate_results.main()[source]
pyNastran.converters.usm3d.time_accurate_results.run_time_acc(dirname, model_name, node_ids, nstart=0, nlimit=None, num_cpus=8)[source]

node ids start at index=0

pyNastran.converters.usm3d.time_accurate_results.write_loads(csv_filename, loads, node_id)[source]

usm3d_reader Module

Inheritance diagram of pyNastran.converters.usm3d.usm3d_reader
Defines:
  • Usm3d(log=None, debug=False)
    • read_cogsg(cogsg_file, stop_after_header=False)

    • read_usm3d(self, basename, dimension_flag, read_loads=True)

    • write_usm3d(basename)

    • read_mapbc(mapbc_filename)

    • read_bc(self, bc_filename, stop_after_header=False, get_lbouf=False)

    • read_flo(self, flo_filename, n=None, node_ids=None)

class pyNastran.converters.usm3d.usm3d_reader.Usm3d(log=None, debug=None)[source]

Bases: object

Usm3d interface class

Initializes the Usm3d object

Parameters
debugbool/None; default=True
used to set the logger if no logger is passed in

True: logs debug/info/error messages False: logs info/error messages None: logs error messages

loglogging module object / None

if log is set, debug is ignored and uses the settings the logging object has

bcmap_to_bc_name = {0: 'Supersonic Inflow', 1: 'Reflection plane', 2: 'Supersonic Outflow', 3: 'Subsonic Outer Boundaries', 4: 'Viscous Surfaces', 5: 'Inviscid aerodynamic surface', 44: 'Blunt base', 55: 'Thick Trailing Edges', 101: 'Engine-intake', 102: 'Engine-exhaust (Jet Core)', 103: 'Engine-exhaust (Fan)', 201: 'Engine-intake', 202: 'Engine-exhaust (Jet Core)', 203: 'Engine-exhaust (Fan)', 1001: 'Special inflow', 1002: 'Special Outflow (Fixed Pressure)'}
read_bc(bc_filename, stop_after_header=False, get_lbouf=False)[source]
read_cogsg(cogsg_filename, stop_after_header=False)[source]

Reads the *.cogsg file

Returns
nodes(N, 3) float ndarray

the nodes

tet_elements???

???

read_flo(flo_filename, n=None, node_ids=None)[source]
ipltqn is a format code where:
  • ipltqn = 0 (no printout)

  • ipltqn = 1 (unformatted)

  • ipltqn = 2 (formatted) - default

Parameters
flo_filenamestr

the name of the file to read

nint; default=None

the number of points to read (initializes the array) n is typically the number of points, but is not required to be this lets you read nodes 1…n, but not greater than n+1. node_ids must be set to None.

node_idsList[int]; default=None

the specific points to read (n must be set to None).

nvars = 5
  • (nodeID, rho, rhoU, rhoV, rhoW) = sline (e) = line

nvars = 6
  • (nodeID, rho, rhoU, rhoV, rhoW, e) = line

Also, Nastran-esque float formatting is sometimes used,
so 5.0-100 exists, which is 5.0E-100. We just assume it’s 0.
Returns
node_id(nnodes, ) int ndarray

the node ids for the selected loads

loadsdict[result_name]
result_namestr

the name of the result

data(nnodes, ) float ndarray

the data corresponding to the result_name

read_mapbc(mapbc_filename)[source]

0 - Supersonic Inflow 1 - Reflection plane 2 - Supersonic Outflow 3 - Subsonic Outer Boundaries 4 - Viscous Surfaces 5 - Inviscid aerodynamic surface 44 - Blunt base 55 - Thick Trailing Edges n*100+3 - Engine-exhaust (Fan) n*100+2 - Engine-exhaust (Jet Core) n*100+1 - Engine-intake 1001 - Special inflow 1002 - Special Outflow (Fixed Pressure)

0 - Freestream - Supersonic Inflow (Bounding Box) 2 - Extrapolation - Supersonic Outflow (Bounding Box)

1 - Reflection Plane - Tangent Flow - (Symmetry Plane) 3 - Characteristic Inflow - Subsonic Inflow/Outflow/Sideflow (Bounding Box)

4 - Inviscid Surface (Physical) 5 - Viscous Surface (Physical) #==============================

#Thu Dec 19 11:46:03 2013 #bc.map Patch # BC Family #surf surfIDs Family #——————————————————– 1 44 44 0 0 Base -> Blunt base 2 4 4 0 0 Bay -> Viscous Surfaces 3 0 0 0 0 Inflow -> Supersonic Inflow 4 2 2 0 0 Outflow -> Supersonic Outflow 5 3 3 0 0 Sideflow -> Characteristic Inflow/Outflow 7 1 1 0 0 Symmetry -> Reflection plane

read_usm3d(basename, unused_dimension_flag, read_loads=True)[source]
Parameters
basenamestr

the root path to the *.cogsg, *.bc, *.mapbc, *.face, *.front files

unused_dimension_flagint; unused

??? 2?/3

read_loadsbool; default=True

???

Returns
nodes(nnodes, 3) float ndarray

the xyz coordinates

tris_tets???

???

tris(ntri, 3) int ndarray

0-based node indices

bcs(ntris, ) int ndarray

1-based patch/”property” IDs

mapbcdict[patch_id]

patch_id : int map_line : List[bc, family, surf, surf_ids]

bcint

boundary condition number

familyint

family number

surfint

surface number

surf_idsstr

???

loadsdict[]

???

flo_filenamestr

the latest result filename None : no *.flo file could be found static : *.flo transient : *_xxx.flo

write_usm3d(basename)[source]

writes a *.cogsg, *.front, *.face file

pyNastran.converters.usm3d.usm3d_reader.main()[source]

test problem

pyNastran.converters.usm3d.usm3d_reader.parse_float(svalue)[source]

floats a value

pyNastran.converters.usm3d.usm3d_reader.read_flo(flo_filename, n=None, node_ids=None)[source]

reads a *.flo file

pyNastran.converters.usm3d.usm3d_reader.read_usm3d(basename, log=None, debug=None)[source]

reads a usm3d file

pyNastran.converters.usm3d.usm3d_reader.write_cogsg_volume(model, cogsg_fileame)[source]

writes a *.cogsg file

pyNastran.converters.usm3d.usm3d_reader.write_usm3d_volume(model, basename)[source]

writes a *.cogsg, *.front, *.face file