I want to add a output field to an odb. Not all the values are available and I would like to input an "invalid data". What should I pass? I tried nan, string, 1/0, which do not work
The basic coding I used to add a field output is:
instance = odb.rootAssembly.instances['nameOfYourInstance']
field_output = odb.steps['stepName'].frames[frameId].FieldOutput(
name='DefineTheName', description='WhatItRepresents',
type=SCALAR # or whatever other type you need
)
field.addData(
position=NODAL, instance=instance, labels=your_node_labels,
data=your_data
)
I want to pass an invalid data in a specific place in your_data
You keep only those nodes in
your_node_labels
variable for which you have data inyour_data
variable.For Ex. Let's say, you have the data for
your_node_labels=[1, 10, 12, 14, 50]
nodes only and corresponding values areyour_data=[10.0, 1.0, 2.2, 3.3, 15.5]
something like this. Here, for node1
you have value10.0
, for node10
you have value1.0
and so on. In this case, no data is written for the nodes other than the nodes inyour_node_labels
variable, hence no contour will be shown for those nodes.