Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abaqus C++ API to access an ODB

Status
Not open for further replies.

94710

Structural
May 16, 2007
21
I wrote a C++ post-processing program (I copied instructions written in abaqus documentation):

Code:
#include <odb_API.h>

int ABQmain(int argc, char **argv)
{

//Open the output database used by the tutorial.

odb_Odb& odb = openOdb("viewer_tutorial.odb");


//Create a variable that refers to the last frame of the first step.

odb_Step& step = odb.steps()["Step-1"];
odb_SequenceFrame& allFramesInStep = step.frames();
int numFrames = allFramesInStep.size();
odb_Frame& lastFrame = allFramesInStep[numFrames-1];


//Create a variable that refers to the displacement 'U' in the last frame of the first step.

odb_FieldOutput& displacements = 
lastFrame.fieldOutputs().get("U");

//Create a variable that refers to the node set 'PUNCH' in the part instance'PART-1–1' :

odb_Instance& instance = 
odb.rootAssembly().instances()["PART-1-1"];
odb_Set& nodeSet = 
instance.nodeSets["PUNCH"];

//Create a variable that refers to the displacement of the node set in the last frame of the first step: 

odb_FieldOutput myDisplacements = 
displacements.getSubset(nodeSet);

//close odb

odb.close();

return 0;
}

and I get :

Code:
C:\Documents and Settings\alorenzom\Documenti\HC3FEM\AbC++Api>abaqus make job=ex
periment user=experiment.cpp
ABAQUS JOB experiment
Begin Compiling User Post-Processing Program
6/22/2007 11:37:50 AM
Compiling: C:\Documents and Settings\alorenzom\Documenti\HC3FEM\AbC++Api\experim
ent.cpp
experiment.cpp
C:\Documents and Settings\alorenzom\Documenti\HC3FEM\AbC++Api\experiment.cpp(34)
: error C2475: 'odb_DiscreteEntity::nodeSets' : forming a pointer-to-member req
uires explicit use of the address-of operator ('&') and a qualified name
C:\Documents and Settings\alorenzom\Documenti\HC3FEM\AbC++Api\experiment.cpp(34)
: error C2475: 'odb_DiscreteEntity::nodeSets' : forming a pointer-to-member req
uires explicit use of the address-of operator ('&') and a qualified name
C:\Documents and Settings\alorenzom\Documenti\HC3FEM\AbC++Api\experiment.cpp(34)
: error C2107: illegal index, indirection not allowed
ABAQUS Error: Problem during compilation - C:\Documents and Settings\alorenzom\D
ocumenti\HC3FEM\AbC++Api\experiment.cpp
The ABAQUS Make execution procedure exited with errors


Can someone help me?
 
Replies continue below

Recommended for you

See:

odb_Set& nodeSet = instance.nodeSets["PUNCH"];

try

odb_Set& nodeSet = instance.nodeSets()["PUNCH"];


instead.
 
Sorry for my stupidity!

Thank you so much
 
It may be another of my stupid questions ... but I don't know how can I execute my c++ post processing program now that I have my .exe and .obj files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor