Eigenvalue analysis

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
mrathore
Posts: 18
Joined: Thu May 29, 2008 2:38 am
Location: Mumbai
Contact:

Eigenvalue analysis

Post by mrathore »

I want to change the constraint handler for eigenvalue analysis in my code. For this I opened file OpenSees\SRC\tcl\commands.cpp and replaced the line (line no. 4563):

Code: Select all

    ConstraintHandler *theEigenHandler = new TransformationConstraintHandler();
with the line

Code: Select all

    ConstraintHandler *theEigenHandler = new PenaltyConstraintHandler();
When I compiled the program and I am getting error:
Error 57 error C2512: 'PenaltyConstraintHandler' : no appropriate default constructor available c:\opensees\src\tcl\commands.cpp 4563

Error 1321 fatal error LNK1181: cannot open input file 'tcl.lib' OpenSees
What changes should be made to code to remove above errors?

Thanks in advance.
neallee
Posts: 62
Joined: Sun Aug 14, 2005 4:50 am
Location: Tianjin University

Post by neallee »

That 's mean there is no constructor for that class.

Penalty handler needs penalty multiplyer, see the Cooks book.
Li Ning, Ph.D. and Professor of Civil Engineering
TJU, China
rjaeger
Posts: 102
Joined: Thu Aug 31, 2006 9:57 pm
Location: UC Davis

Post by rjaeger »

Hello,

Neallee is correct. If you look at the penalty constraint handler header file, you'll see the only constructor is:

PenaltyConstraintHandler(double alphaSP, double alphaMP);

Check the manual or the reference Neallee mentioned to find out what these parameters are.
mrathore
Posts: 18
Joined: Thu May 29, 2008 2:38 am
Location: Mumbai
Contact:

thanks

Post by mrathore »

Thank You for your reply.
As quoted:
Hello,

Neallee is correct. If you look at the penalty constraint handler header file, you'll see the only constructor is:

PenaltyConstraintHandler(double alphaSP, double alphaMP);

Check the manual or the reference Neallee mentioned to find out what these parameters are.
What changes should be made to above code to correctly define the constructor.
I have tried with the code:

Code: Select all

PenaltyConstraintHandler(1.0, 1.0);
and

Code: Select all

PenaltyConstraintHandler(*thealphaSP, *thealphaMP);
Both of the above are not working.
Please help me in this.

Thanks in advance
rjaeger
Posts: 102
Joined: Thu Aug 31, 2006 9:57 pm
Location: UC Davis

Post by rjaeger »

Hello,

you may need to cast the numbers to doubles:

PenaltyConstraintHandler((double)1.0, (double)1.0);

or, declare two doubles in the code:
double alphasp = 1.0;
double alphamp = 1.0;
then use this in your declaration in your original post: PenaltyConstraintHandler(alphasp, alphamp);

The constructor shows that it wants two double arguments, passed by value and not by address so you shouldn't use any pointer dereferencing unless you defined pointers which point to alphasp and alphamp.

Try both of those and see if they work. I'm rusty on my C++ so the casting may not be correct. You should google it if what I said doesn't work and you still want to go that route.
mrathore
Posts: 18
Joined: Thu May 29, 2008 2:38 am
Location: Mumbai
Contact:

thanks

Post by mrathore »

Thanks Rjaeger,

Code works when we define two double variables and then use them to build the exe as follows:

Code: Select all

    double alpha1 = 1.0;
    double alpha2 = 1.0;
    ConstraintHandler *theEigenHandler = new LagrangeConstraintHandler(alpha1, alpha2);
also we can define double constant values as follows: (it also works)

Code: Select all

    ConstraintHandler *theEigenHandler = new LagrangeConstraintHandler(double(1.0), double(1.0));
Above codes can be used to successfully compile and build the opensees.exe, but when used it does not give any of the eigenvalue (not even first). I think it is because with eigenvalue analysis Lagrange or Penalty constraint handlers are not allowed. (The code works with Transformation constraint handler)

Thanks sir for your help.
Post Reply