No subject
Sun Apr 3 09:54:08 EDT 2011
ach for initializing the number of nodal variables, but I what I really wan=
t to do is just modify the metadata from the original file rather than to s=
tart from scratch. I see no method in vtkExodusIIReader that returns this =
structure.
I tried vtkExodusIIReader::GetExodusModel() because there is a method, vtkE=
xodusModel::GetModelMetadata(), that returns it, but I never was able to g=
et the reader to return anything other than NULL (I tried turning on and of=
f ExodusModelMetadata, but it had no effect). In the reader code, I cannot=
see any place that the ExodusModel is set to an actual data structure. I =
even tried modifying the constructor in the reader to initialize ExodusMode=
l using New() instead of NULL, but that didn't work either because the Exod=
usModel's internal link to the metadata pointer was never initialized (once=
again I tried calls to turn on/off the ExodusModelMetadata in an effort to=
create it).
Giving up on the reader as a source for the metadata handle, I tried creati=
ng a vtkModelMetadata instance and initializing it using vtkModelMetadata::=
Unpack() combined with my unstructured grid. But the structure that was re=
turned by Unpack() was empty with everything zeroed out. None of the infor=
mation from the original file was present when I looked at the structure in=
the debugger.
So my question to you is this: is there a way to get the metadata from the =
original exodus file into this (or some other structure that the exodus wri=
ter can input) and to get a handle to that structure so that I can modify i=
t?
As an aside, I can read the exodus file in and write it back out without mo=
dification without any problem (the new file is smaller because the reader =
doesn't read in the variable arrays, so it isn't the discarding of the orig=
inal data that creates the problem, it is the addition of the new variables=
which outnumber the old).
Pat
--_000_A8E6CE0BD84AED4786D0136E6F99BC1901BB0BEXMB02srnsandiago_
Content-Type: text/html;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left:=
#800000 2px solid; } --></style>
</head>
<body>
<font face=3D"Calibri" size=3D"2"><span style=3D"font-size:11pt;">
<div>My goal is to read in an exodus file, keep only the topology of the me=
sh (discarding any node or element variables), add some new variables to al=
l of the nodes, and write the resulting mesh and new variable arrays out to=
a new exodus file. The problem
that I am having occurs in vtkExodusIIWriter::WriteVariableArrayNames() in =
the call to ex_put_var_param(), which ends up as “Error: failed to de=
fine number of nodal variables in file id %d". </div>
<div> </div>
<div>From the documentation on vtkModelMetadata, it looks like this is the =
approach for initializing the number of nodal variables, but I what I reall=
y want to do is just modify the metadata from the original file rather than=
to start from scratch. I see no
method in vtkExodusIIReader that returns this structure. </div>
<div> </div>
<div>I tried vtkExodusIIReader::GetExodusModel() because there is a method,=
vtkExodusModel::GetModelMetadata(), that returns it, but I never was=
able to get the reader to return anything other than NULL (I tried turning=
on and off ExodusModelMetadata, but
it had no effect). In the reader code, I cannot see any place that th=
e ExodusModel is set to an actual data structure. I even tried modify=
ing the constructor in the reader to initialize ExodusModel using New() ins=
tead of NULL, but that didn’t work either
because the ExodusModel’s internal link to the metadata pointer was n=
ever initialized (once again I tried calls to turn on/off the ExodusModelMe=
tadata in an effort to create it). </div>
<div> </div>
<div>Giving up on the reader as a source for the metadata handle, I tried c=
reating a vtkModelMetadata instance and initializing it using vtkModelMetad=
ata::Unpack() combined with my unstructured grid. But the structure t=
hat was returned by Unpack() was empty
with everything zeroed out. None of the information from the original=
file was present when I looked at the structure in the debugger. </d=
iv>
<div> </div>
<div>So my question to you is this: is there a way to get the metadata from=
the original exodus file into this (or some other structure that the exodu=
s writer can input) and to get a handle to that structure so that I can mod=
ify it?</div>
<div> </div>
<div>As an aside, I can read the exodus file in and write it back out witho=
ut modification without any problem (the new file is smaller because the re=
ader doesn’t read in the variable arrays, so it isn’t the disca=
rding of the original data that creates the
problem, it is the addition of the new variables which outnumber the old).<=
/div>
<div> </div>
<div>Pat</div>
<div> </div>
</span></font>
</body>
</html>
--_000_A8E6CE0BD84AED4786D0136E6F99BC1901BB0BEXMB02srnsandiago_--
More information about the Paraview-developers
mailing list