inpRW._inpW¶
Module Contents¶
This module contains functions for writing a new input file from the information in keywords.
- class inpRW._inpW.Write¶
The
Writeclass contains functions that write input files from the parsed data structure.- generateInpSum()¶
Generates the .sum file, which includes the keyword line and
pathfor each keyword block.The file will be written to
_kwsumName.
- writeBlocks(iterable, output=None)¶
Generates strings from a sequence of
inpKeywordobjects.This function generates strings from a sequence of
inpKeywordobjects. It will either write the strings to output, if output is a file, or it will append the strings to output if output is a list.This function will call itself recursively to handle suboptions.
- Parameters:
iterable (list) – Items in list should be
inpKeywordblocks.output (file object or
list) – Output will be written to this object. Defaults to [].
- Returns:
If output is a list, this function will return a list. If output is a file, there is no return.
- Return type:
- writeInp(blocks=None, output='')¶
This function writes out the contents of the input file structure (including any changes) to the file indicated by output.
If blocks is not specified, every keyword block will be written. If output is not specified, the output .inp will be
inpName+jobSuffix.inpNamewill have “.inp” removed beforejobSuffixis added.- Parameters:
blocks (list) – The list of
inpKeywordsto write to output. Defaults to None, which will write out all keyword blocks.output (str) – The name of the file to which the new input file will be written. Defaults to ‘’, which will write to
inpName+jobSuffix.