quickmain modification

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

Moderators: silvia, selimgunay, Moderators

Post Reply
pankotso
Posts: 20
Joined: Tue Oct 13, 2009 9:46 am
Location: Edinburgh

quickmain modification

Post by pankotso »

Hi all, I tried to modify the example 1 given in quickmain in opensees source with a basic example (like example 2) with elastic beam elements. My problem is that when i try to build the solution, the compliler says that ''Cannot open include file: 'ElasticBeam2d.h': No such file or directory''. I would like to ask you if you know why this happens.

Thanks in advance,
Panagiotis, University of Edinburgh
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

the ElatsicBeam2d.h is in the directory OpenSees/SRC/element/elasticBeamColumn .. what are you using to compile the code with?
pankotso
Posts: 20
Joined: Tue Oct 13, 2009 9:46 am
Location: Edinburgh

Post by pankotso »

Dear fmk, i use vs2005. I know about the location of the elastic beam element. When i use an #include "C:\Documents and Settings\... there is no problem with the header file but when i use #include <ElasticBeam2d.h> it seems that it cannot find it which is weird as there is no problem with the truss.h. I am thinking maybe this is because of main.cpp is located in EXAMPLES\Example1 and not in SRC as the element does?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

in the project settings, c++ additional include directories, look to see if the elasticBeamColumn dircetory is included.
pankotso
Posts: 20
Joined: Tue Oct 13, 2009 9:46 am
Location: Edinburgh

Post by pankotso »

Dear fmk thank you very much for your suggestion, elasticbeam was actually not included.

I would like also to ask you something else. I want to dynamically construct an ElementalLoad object as you do with the NodalLoad object in example 1 however the way you do it cannot be done with elementalload because it is an abstract class and it cannot be instantiated. Do you have any suggestion on how to do that? Thank you in advance.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

ElementalLoad is an abstract class, you cannot create any objects of that specific type. You can only create objects of types that subclass off it, e.g. Beam2dPointLoad .. see OpenSees/SRC/domain/load directory for others.
fluozhen
Posts: 23
Joined: Thu May 07, 2009 7:33 pm
Location: nuaa

Re: quickmain modification

Post by fluozhen »

[quote="pankotso"]Hi all, I tried to modify the example 1 given in quickmain in opensees source with a basic example (like example 2) with elastic beam elements. My problem is that when i try to build the solution, the compliler says that ''Cannot open include file: 'ElasticBeam2d.h': No such file or directory''. I would like to ask you if you know why this happens.

Thanks in advance,
Panagiotis, University of Edinburgh[/quote]

I tried to modify the given example,too. But I don't know how can I recode the information of nodes or elements, can you give me an example.
Thank you very much.
fluozhen, University of NUAA,Nanjing,China
pankotso
Posts: 20
Joined: Tue Oct 13, 2009 9:46 am
Location: Edinburgh

Post by pankotso »

Thank you fmk. I can create an instance from the derived class. What i used is ElementalLoad *theEleLoad = new Beam2dUniformLoad(1,-1000,0,1); //udl=-1000N/m . Is this correct?

I also encounter some problems in the element construction with the intergration and the fibers. I use the following code to construct it:
DispBeamColumn2d *DispBeamColumn2d1 = new DispBeamColumn2d(1, 1, 2, 1,&theSection, *Lobatto, *CrdTransf2d1);

For the integration I can create an integration object by BeamIntegration *Lobatto = new LobattoBeamIntegration();
but it does not have any parameter for the nIP.

For the fiber section:

SectionForceDeformation *theSection = new FiberSection2d(1, 1, theFibers)

Then I construct the fibers like below but i do not have succeded in combining them to an array like theFibers(4) to use it for theSection. What should i do?

Fiber *fiber1 = new UniaxialFiber2d(1, *theMaterial, 0.00165, -0.147);
Fiber *fiber2 = new UniaxialFiber2d(2, *theMaterial, 0.000852, -0.147);
Fiber *fiber3 = new UniaxialFiber2d(3, *theMaterial, 0.000852, -0.147);
Fiber *fiber4 = new UniaxialFiber2d(4, *theMaterial, 0.00165, -0.147);

Thank you very much for all your help.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

it is not a section property, but an element property .. num integration points is the 4'th arg to the constructor (numSections)

[code]
DispBeamColumn2d(int tag, int nd1, int nd2,
int numSections, SectionForceDeformation **s,
BeamIntegration &bi, CrdTransf2d &coordTransf,
double rho = 0.0);
[/code]
pankotso
Posts: 20
Joined: Tue Oct 13, 2009 9:46 am
Location: Edinburgh

Post by pankotso »

Thank you fmk for your help! but what about the fibersection2d, how to construct the 3rd argument (Fiber **fibers)? Is it a vector of the invidual uniaxial fibers?
fluozhen
Posts: 23
Joined: Thu May 07, 2009 7:33 pm
Location: nuaa

Re: quickmain modification

Post by fluozhen »

[quote="fluozhen"][quote="pankotso"]Hi all, I tried to modify the example 1 given in quickmain in opensees source with a basic example (like example 2) with elastic beam elements. My problem is that when i try to build the solution, the compliler says that ''Cannot open include file: 'ElasticBeam2d.h': No such file or directory''. I would like to ask you if you know why this happens.

Thanks in advance,
Panagiotis, University of Edinburgh[/quote]

I tried to modify the given example,too. But I don't know how can I recode the information of nodes or elements, can you give me an example.
Thank you very much.
fluozhen, University of NUAA,Nanjing,China[/quote]


I got it.
Post Reply