Dear Developers,
Is it possible to introduce in the C++ file some code that would print out desired results to a file?
More exactly, I am interested in printing out the stiffness matrix for each analysis step.
It is true that I can print the values in the prompt window, but I makes the calculation very slow and also it is very hard to analyze the values after the run if the matrix is large.
Thank you in advance!
Search found 26 matches
- Thu Mar 07, 2019 10:58 am
- Forum: Framework
- Topic: print stiffness matrix C++
- Replies: 0
- Views: 8103
- Tue Feb 26, 2019 8:50 am
- Forum: Framework
- Topic: OPS Procedure
- Replies: 0
- Views: 5183
OPS Procedure
Dear Community,
I would like to consider a new structural element with 4 nodes, 11 springs and 12 degrees of freedom.
I believe that there are some mistakes in the OPS procedure that I wrote at the beginning of the .cpp file, since I obtain this error:
UniaxialMaterial *getUniaxialMaterial(int tag) - none found with tag: 261909344
WARNING: material 261909344 is not defined.
TclElementCommand -- unable to create element of type : SPPlastic
There is not mat tag (261909344)!?
The OPS procedure is:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static int numSPP = 0;
void* OPS_SPPlastic()
{
Element *theSPPanel = 0;
int numRemainingArgs = OPS_GetNumRemainingInputArgs();
if (numRemainingArgs == 0)
{
theSPPanel = new SPPlastic();
return theSPPanel;
}
if (numRemainingArgs != 16)
{
opserr << "WARNING insufficient arguments\n";
opserr << "Want: element SPPlastic eleTag? node1? node2? node3? node4? matTag1? matTag2? matTag3?\n";
opserr << "matTag4? matTag5? matTag6? matTag7? matTag8? matTag9? matTag10? matTag11?\n";
numSPP++;
//return 0;
}
int iData[16];
int numData;
numData = 5;
if (OPS_GetIntInput(&numData, iData) != 0)
{
opserr << "WARNING invalid element data\n";
return 0;
}
UniaxialMaterial* mats[11];
for (int i = 0; i < 11; i++)
{
mats[i] = OPS_getUniaxialMaterial(iData[5+i]);
if (mats[i] == 0)
{
opserr<<"WARNING: material "<< iData[5+i] <<" is not defined.\n";
return 0;
}
}
theSPPanel = new SPPlastic(iData[0],iData[1],iData[2],iData[3],iData[4],
*mats[0],*mats[1],*mats[2],*mats[3],*mats[4],
*mats[5],*mats[6],*mats[7],*mats[8],*mats[9],
*mats[10]);
if (theSPPanel == 0)
{
opserr << "WARNING ran out of memory creating element with tag " << iData[0] << endln;
for (int i = 0; i < 11; i++)
{
delete mats[i];
return 0;
}
}
return theSPPanel;
}
Any ideas?
I would like to consider a new structural element with 4 nodes, 11 springs and 12 degrees of freedom.
I believe that there are some mistakes in the OPS procedure that I wrote at the beginning of the .cpp file, since I obtain this error:
UniaxialMaterial *getUniaxialMaterial(int tag) - none found with tag: 261909344
WARNING: material 261909344 is not defined.
TclElementCommand -- unable to create element of type : SPPlastic
There is not mat tag (261909344)!?
The OPS procedure is:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static int numSPP = 0;
void* OPS_SPPlastic()
{
Element *theSPPanel = 0;
int numRemainingArgs = OPS_GetNumRemainingInputArgs();
if (numRemainingArgs == 0)
{
theSPPanel = new SPPlastic();
return theSPPanel;
}
if (numRemainingArgs != 16)
{
opserr << "WARNING insufficient arguments\n";
opserr << "Want: element SPPlastic eleTag? node1? node2? node3? node4? matTag1? matTag2? matTag3?\n";
opserr << "matTag4? matTag5? matTag6? matTag7? matTag8? matTag9? matTag10? matTag11?\n";
numSPP++;
//return 0;
}
int iData[16];
int numData;
numData = 5;
if (OPS_GetIntInput(&numData, iData) != 0)
{
opserr << "WARNING invalid element data\n";
return 0;
}
UniaxialMaterial* mats[11];
for (int i = 0; i < 11; i++)
{
mats[i] = OPS_getUniaxialMaterial(iData[5+i]);
if (mats[i] == 0)
{
opserr<<"WARNING: material "<< iData[5+i] <<" is not defined.\n";
return 0;
}
}
theSPPanel = new SPPlastic(iData[0],iData[1],iData[2],iData[3],iData[4],
*mats[0],*mats[1],*mats[2],*mats[3],*mats[4],
*mats[5],*mats[6],*mats[7],*mats[8],*mats[9],
*mats[10]);
if (theSPPanel == 0)
{
opserr << "WARNING ran out of memory creating element with tag " << iData[0] << endln;
for (int i = 0; i < 11; i++)
{
delete mats[i];
return 0;
}
}
return theSPPanel;
}
Any ideas?
- Tue Feb 26, 2019 4:17 am
- Forum: Framework
- Topic: new Joint element
- Replies: 1
- Views: 9040
Re: new Joint element
This is the setDomain() method.
The 4 nodes are identified, but somehow the element is created only with 2 node. Any ideas?
void
SPPlastic::setDomain(Domain *theDomain)
{
if (theDomain == 0)
{
opserr << "ERROR : SPPlastic::setDomain -- Domain is null" << endln;
return;
}
// first ensure nodes exist in Domain and set the node pointers
Node *end1Ptr, *end2Ptr, *end3Ptr, *end4Ptr;
int Nd1 = connectedExternalNodes(0);
int Nd2 = connectedExternalNodes(1);
int Nd3 = connectedExternalNodes(2);
int Nd4 = connectedExternalNodes(3);
opserr << "Nd1" << Nd1 << endln;
opserr << "Nd2" << Nd2 << endln;
opserr << "Nd3" << Nd3 << endln;
opserr << "Nd4" << Nd4 << endln;
end1Ptr = theDomain->getNode(Nd1);
end2Ptr = theDomain->getNode(Nd2);
end3Ptr = theDomain->getNode(Nd3);
end4Ptr = theDomain->getNode(Nd4);
if (end1Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd1 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
if (end2Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd2 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
if (end3Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd3 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
if (end4Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd4 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
nodePtr[0] = end1Ptr;
nodePtr[1] = end2Ptr;
nodePtr[2] = end3Ptr;
nodePtr[3] = end4Ptr;
// call the base class method (DomainComponent class method) THIS IS VERY IMPORTANT
this->DomainComponent::setDomain(theDomain);
// ensure connected nodes have correct number of dof's
int dofNd1 = nodePtr[0]->getNumberDOF();
int dofNd2 = nodePtr[1]->getNumberDOF();
int dofNd3 = nodePtr[2]->getNumberDOF();
int dofNd4 = nodePtr[3]->getNumberDOF();
if ((dofNd1 != 3) || (dofNd2 != 3) || (dofNd3 != 3) || (dofNd4 != 3))
{
opserr << "ERROR : SPPlastic::setDomain -- number of DOF associated with the node incorrect"<< endln;
exit(-1); // donot go any further - otherwise segmentation fault
}
// now determine the area
const Vector &end1Crd = nodePtr[0]->getCrds();
const Vector &end2Crd = nodePtr[1]->getCrds();
const Vector &end3Crd = nodePtr[2]->getCrds();
const Vector &end4Crd = nodePtr[3]->getCrds();
Vector Node1(end1Crd);
Vector Node2(end2Crd);
Vector Node3(end3Crd);
Vector Node4(end4Crd);
// set the height and width of the element and perform check
Node2 = Node2 - Node4;
Node3 = Node3 - Node1;
dc = fabs(Node2.Norm());
db = fabs(Node3.Norm());
opserr << "dc: " << dc << endln;
opserr << "db: " << db << endln;
Aweb = (sqrt(db*db))*(sqrt(dc*dc));
Alpha = atan(fabs(Node3.Norm()) / fabs(Node2.Norm()));
opserr << "Aweb: " << Aweb << endln;
opserr << "Alpha: " << Alpha << endln;
if ((db <= 1e-12) || (dc <= 1e-12))
{
opserr << "ERROR : SPPlastic::setDomain -- length or width not correct, division by zero occurs"<< endln;
exit(-1); // donot go any further - otherwise segmentation fault
}
getBCJoint();
getdg_df();
getdDef_du();
}
The 4 nodes are identified, but somehow the element is created only with 2 node. Any ideas?
void
SPPlastic::setDomain(Domain *theDomain)
{
if (theDomain == 0)
{
opserr << "ERROR : SPPlastic::setDomain -- Domain is null" << endln;
return;
}
// first ensure nodes exist in Domain and set the node pointers
Node *end1Ptr, *end2Ptr, *end3Ptr, *end4Ptr;
int Nd1 = connectedExternalNodes(0);
int Nd2 = connectedExternalNodes(1);
int Nd3 = connectedExternalNodes(2);
int Nd4 = connectedExternalNodes(3);
opserr << "Nd1" << Nd1 << endln;
opserr << "Nd2" << Nd2 << endln;
opserr << "Nd3" << Nd3 << endln;
opserr << "Nd4" << Nd4 << endln;
end1Ptr = theDomain->getNode(Nd1);
end2Ptr = theDomain->getNode(Nd2);
end3Ptr = theDomain->getNode(Nd3);
end4Ptr = theDomain->getNode(Nd4);
if (end1Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd1 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
if (end2Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd2 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
if (end3Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd3 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
if (end4Ptr == 0) {
opserr << "WARNING DoublePanel::setDomain() - at DoublePanel " << this->getTag() << " node " << Nd4 << " does not exist in domain\n";
return; // don't go any further - otherwise segmentation fault
}
nodePtr[0] = end1Ptr;
nodePtr[1] = end2Ptr;
nodePtr[2] = end3Ptr;
nodePtr[3] = end4Ptr;
// call the base class method (DomainComponent class method) THIS IS VERY IMPORTANT
this->DomainComponent::setDomain(theDomain);
// ensure connected nodes have correct number of dof's
int dofNd1 = nodePtr[0]->getNumberDOF();
int dofNd2 = nodePtr[1]->getNumberDOF();
int dofNd3 = nodePtr[2]->getNumberDOF();
int dofNd4 = nodePtr[3]->getNumberDOF();
if ((dofNd1 != 3) || (dofNd2 != 3) || (dofNd3 != 3) || (dofNd4 != 3))
{
opserr << "ERROR : SPPlastic::setDomain -- number of DOF associated with the node incorrect"<< endln;
exit(-1); // donot go any further - otherwise segmentation fault
}
// now determine the area
const Vector &end1Crd = nodePtr[0]->getCrds();
const Vector &end2Crd = nodePtr[1]->getCrds();
const Vector &end3Crd = nodePtr[2]->getCrds();
const Vector &end4Crd = nodePtr[3]->getCrds();
Vector Node1(end1Crd);
Vector Node2(end2Crd);
Vector Node3(end3Crd);
Vector Node4(end4Crd);
// set the height and width of the element and perform check
Node2 = Node2 - Node4;
Node3 = Node3 - Node1;
dc = fabs(Node2.Norm());
db = fabs(Node3.Norm());
opserr << "dc: " << dc << endln;
opserr << "db: " << db << endln;
Aweb = (sqrt(db*db))*(sqrt(dc*dc));
Alpha = atan(fabs(Node3.Norm()) / fabs(Node2.Norm()));
opserr << "Aweb: " << Aweb << endln;
opserr << "Alpha: " << Alpha << endln;
if ((db <= 1e-12) || (dc <= 1e-12))
{
opserr << "ERROR : SPPlastic::setDomain -- length or width not correct, division by zero occurs"<< endln;
exit(-1); // donot go any further - otherwise segmentation fault
}
getBCJoint();
getdg_df();
getdDef_du();
}
- Tue Feb 05, 2019 5:12 am
- Forum: Framework
- Topic: new Joint element
- Replies: 1
- Views: 9040
new Joint element
Dear Community Members,
I am trying to build a 4 nodes joint model, based on BeamColumnJoint2D element.
After creating and loading a frame using the joint created, it looks like the 4 nodes are not connected.
I thought the error comes from setDomain() function but it's not.
Does anyone of you have an idea where my bug could be?
Thank you in advance:
photo: before loading https://www.dropbox.com/s/j4ira0ct6m0ul ... oading.PNG
photo: after loading https://www.dropbox.com/s/z87jywsb71kf7 ... oading.PNG
I am trying to build a 4 nodes joint model, based on BeamColumnJoint2D element.
After creating and loading a frame using the joint created, it looks like the 4 nodes are not connected.
I thought the error comes from setDomain() function but it's not.
Does anyone of you have an idea where my bug could be?
Thank you in advance:
photo: before loading https://www.dropbox.com/s/j4ira0ct6m0ul ... oading.PNG
photo: after loading https://www.dropbox.com/s/z87jywsb71kf7 ... oading.PNG
- Tue Nov 27, 2018 10:25 am
- Forum: OpenSees.exe Users
- Topic: run tcl with code in dll - same dir
- Replies: 0
- Views: 1492
run tcl with code in dll - same dir
Dear Community,
I have .dll (code for element), .tcl and OpenSees.exe in the same directory.
When I try to run the tcl file, nothing happens? No errors and no results.
Does anyone know why? Is there anything more to do when running with codes in dll?
Thanks in advance!
I have .dll (code for element), .tcl and OpenSees.exe in the same directory.
When I try to run the tcl file, nothing happens? No errors and no results.
Does anyone know why? Is there anything more to do when running with codes in dll?
Thanks in advance!
- Tue Nov 27, 2018 10:17 am
- Forum: OpenSees.exe Users
- Topic: problem GID+OpenSees v2.6.0
- Replies: 1
- Views: 2287
Re: problem GID+OpenSees v2.6.0
Please contact the GiD+OpenSees developers: http://gidopensees.rclab.civil.auth.gr/contact
- Tue Oct 09, 2018 8:21 am
- Forum: OpenSees.exe Users
- Topic: add/remove BC multi-step analysis
- Replies: 0
- Views: 1476
add/remove BC multi-step analysis
Dear Community,
I am intending to perform a 2 step analysis.
Is it possible that in the 2nd step to remove some of the BCs defined in the 1st step? and how?
Thank you!
I am intending to perform a 2 step analysis.
Is it possible that in the 2nd step to remove some of the BCs defined in the 1st step? and how?
Thank you!
- Tue Sep 25, 2018 1:41 am
- Forum: OpenSees.exe Users
- Topic: Different app. load value & no steps -> different results!?
- Replies: 4
- Views: 3610
Re: Different app. load value & no steps -> different result
yes, but that value of the force will be equal to the one in the second case, so both cases have the same value of the force, right?
case 1 => force x load control x no steps = 250 000 * 0.1 * 14 = 350 000
case 2 => force x load control x no steps = 350 000 * 0.1 * 10 = 350 000
case 1 => force x load control x no steps = 250 000 * 0.1 * 14 = 350 000
case 2 => force x load control x no steps = 350 000 * 0.1 * 10 = 350 000
- Mon Sep 24, 2018 6:09 am
- Forum: OpenSees.exe Users
- Topic: Different app. load value & no steps -> different results!?
- Replies: 4
- Views: 3610
Different app. load value & no steps -> different results!?
Dear all,
I am performing some research on steel frames and joints.
Using the same type of integrator (load control) with the value of 0.1 and changing the number of steps and the value of the applied force, I obtain some very different results.
Please check the results file in my dropbox: https://www.dropbox.com/s/6pl5uaayymqeq ... s.JPG?dl=0
Can anyone please suggest me why the results are not the same or why they are so different?
Definition of the analysis (red curve):
...
set p1 -250000.0;
...
# Analysis Definition
constraints Transformation;
numberer Plain;
system BandGeneral;
# test NormDispIncr 1.0e-10 3;
algorithm Linear;
integrator LoadControl 0.1;
analysis Static;
analyze 14;
Definition of the analysis (yellow curve):
...
set p1 -350000;
...
# Analysis Definition
constraints Transformation;
numberer Plain;
system BandGeneral;
# test NormDispIncr 1.0e-10 3;
algorithm Linear;
integrator LoadControl 0.1;
analysis Static;
analyze 10;
I am performing some research on steel frames and joints.
Using the same type of integrator (load control) with the value of 0.1 and changing the number of steps and the value of the applied force, I obtain some very different results.
Please check the results file in my dropbox: https://www.dropbox.com/s/6pl5uaayymqeq ... s.JPG?dl=0
Can anyone please suggest me why the results are not the same or why they are so different?
Definition of the analysis (red curve):
...
set p1 -250000.0;
...
# Analysis Definition
constraints Transformation;
numberer Plain;
system BandGeneral;
# test NormDispIncr 1.0e-10 3;
algorithm Linear;
integrator LoadControl 0.1;
analysis Static;
analyze 14;
Definition of the analysis (yellow curve):
...
set p1 -350000;
...
# Analysis Definition
constraints Transformation;
numberer Plain;
system BandGeneral;
# test NormDispIncr 1.0e-10 3;
algorithm Linear;
integrator LoadControl 0.1;
analysis Static;
analyze 10;
- Tue Sep 18, 2018 7:03 am
- Forum: Framework
- Topic: Can't download OpenSees 2.5.0 source code
- Replies: 1
- Views: 3270
- Wed Sep 05, 2018 5:45 am
- Forum: Framework
- Topic: SVN Problem
- Replies: 13
- Views: 13303
Re: SVN Problem
It's working, but not from my university due to the firewall. It might be your case too.
- Thu Jul 26, 2018 5:40 am
- Forum: Framework
- Topic: Problem with running disp.out and force.out command :) :?
- Replies: 3
- Views: 4253
Re: Problem with running disp.out and force.out command :)
I also ran the code. It works fine, and yes, it prints results to the *.out files.
- Thu Jul 26, 2018 5:30 am
- Forum: Framework
- Topic: SVN Problem
- Replies: 13
- Views: 13303
Re: SVN Problem
Yes, I do obtain the same errors, almost for one week already.
Their website was down in the last weekend, probably some maintenance is done.
Let's hope it will work soon!
Their website was down in the last weekend, probably some maintenance is done.
Let's hope it will work soon!
- Wed Jun 27, 2018 6:49 am
- Forum: Documentation
- Topic: Error in compilation (python.h file not included)
- Replies: 3
- Views: 10378
Re: Error in compilation (python.h file not included)
Which python version are you using?
- Tue May 15, 2018 5:04 am
- Forum: OpenSees.exe Users
- Topic: Error while building OpenSees source code by Visual Studio
- Replies: 5
- Views: 2209
Re: Error while building OpenSees source code by Visual Stud
kesavapraba wrote:
> Dear Frank
> Thanks for your quick and prompt reply. Yes, I have installed Tcl in the
> correct location as you instructed. I could not find tcl86t.dll anywhere
> in Tcl folder. Does the very recent source that I downloaded yesterday
> requires me to install Tcl version 8.6? Is that error due to the conflict
> in Tcl version? Because I had Tcl version 8.5 installed when I build the
> source code.
I am facing the same problem. Did you manage to solve it?
> Dear Frank
> Thanks for your quick and prompt reply. Yes, I have installed Tcl in the
> correct location as you instructed. I could not find tcl86t.dll anywhere
> in Tcl folder. Does the very recent source that I downloaded yesterday
> requires me to install Tcl version 8.6? Is that error due to the conflict
> in Tcl version? Because I had Tcl version 8.5 installed when I build the
> source code.
I am facing the same problem. Did you manage to solve it?