Comments (2)
Your intermediate solution is the correct way to handle this. It is not possible to modify the number of variables in an existing file; you must create a new file with the correct number of variables and then copy the old variables and add the new variables to the new file.
from seacas.
There is a copyTransfer routine that may do what you want:
def copyTransfer(fromFileName, toFileName, array_type='ctype', \
additionalGlobalVariables=[], additionalNodalVariables=[], \
additionalElementVariables=[], additionalElementAttributes=[]):
"""
This function creates an exodus file toFileName and copies
everything from exodus file fromFileName returning a file handle
to toFileName.
Additional space is allocated for additionalGlobalVariables,
additionalNodalVariables and additionalElementVariables if
specified.
additionalGlobalVariables: list of global variable names to add.
additionalNodalVaraibles: list of nodal variable names to add.
additionalElementVariables: should be a list of element variable
names to add to all blocks or tuples (name, blkIds) where name is
the element variable to add and blkIds is a list of blkIds to add
it to.
additionalElementAttributes: list of element attribute names to
add to all blocks or tuples ( name, blkIds ) where name is the
element attribute to add and blkIds is a list of blkIds to add it
to. Usage:
fromFileName = "input.e"
toFileName = "output.e"
addGlobalVariables = [] ## Do not add any new global variables
addNodeVariables = ["node_dummy1", "node_dummy2"] ## Add node_dummy1 and node_dummy2 as new node variables
addElementVariables = [ ("elem_dummy1", [1, 2, 3]), "elem_dummy2" ] ## Add elem_dummy1 on blkIds 1, 2, 3 and elem_dummy2 on all blocks
addElementAttributes = [ ("elem_attr_dummy1",[1,2,3]), "elem_attr_dummy2" ] ## Add elem_attr_dummy1 on blkIds 1,2,3 and elem_attr_dummy2 on all blocks
toFileHandle = copyTranfer(fromFileName,toFileName,addGlobalVariables,addNodeVariables,addElementVariables,addElementAttributes)
## Fill in new variables
toFileHandle.close()
"""
from seacas.
Related Issues (20)
- -Wreserved-identifier warnings in public API names HOT 7
- Build error in "Linking CXX executable struc_to_unstruc" HOT 1
- exodus 2023.10.24 and msys2/mingw HOT 3
- Need Curl under Windows 10's WSL HOT 2
- Nem_spread should have option to set single-file-read from command line
- Grepos subsetting corrupts sideset variable data
- How to instantiate a transform? HOT 7
- Publish packaged exodus python bindings to PyPI HOT 2
- testwt-assembly.c: Error c2057 when building with MSVC and NetCDF binaries are found HOT 3
- Improve epu variable inclusion/exclusion handling.
- Verify that properties passed to IOSS are used.
- Add option to EPU to delete the file-per-rank files after joining successfully
- io_modify geometry modification does not work with CGNS structured HOT 1
- installation issue: not creating lib and include folder with ./install-tpl.sh HOT 11
- Aprepro Robustness
- Python bindings include absolute path to build directory. HOT 1
- ex_close fails if file is mode is EX_READ or EX_CLOBBER in parallel HOT 8
- EPU: Add capability to select "last 3 steps" HOT 1
- [MSVC][c++20][c++latest] Ioss_DatabaseIO.C failed with error 7525: call to immediate function is not a constant expression HOT 4
- [URGENT] Exonull does not compile with SEACAS_HAVE_MPI ON on Windows HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seacas.