Biomechanical Joint Model
 Author: Anderson Maciel

comesubspaceelement.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2002 by Anderson Maciel                                 *
00003  *   andi.maciel@gmail.com                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  **************************************************************************/
00020 
00034 
00035 #include <algebra/comesubspaceelement.h>
00036 #include <bio/comebiostructure.h>
00037 
00041 
00042 void
00043 COME_SubSpaceElement::setMass( double massN ){
00044 
00045         mass = massN;
00046 }
00047 
00048 void
00049 COME_SubSpaceElement::setVolume( double volumeN ){
00050 
00051         volume = volumeN;
00052 }
00053 
00054 void
00055 COME_SubSpaceElement::setPosition( COME_Point3D &positionN ){
00056 
00057         position_minus_one = position;
00058         position = COME_Point3D( positionN );
00059 }
00060 
00061 void
00062 COME_SubSpaceElement::setPositionMinusOne( COME_Point3D positionN ){
00063 
00064         position_minus_one = positionN;
00065 }
00066 
00067 void
00068 COME_SubSpaceElement::setVelocity( COME_Vector3D &velocityN ){
00069 
00070         velocity = COME_Vector3D( velocityN );
00071 }
00072 
00073 void
00074 COME_SubSpaceElement::setAcceleration( COME_Vector3D &accelerationN ){
00075 
00076         acceleration = COME_Vector3D( accelerationN );
00077 }
00078 
00079 void
00080 COME_SubSpaceElement::setMaterial( COME_Material *materialN ){
00081 
00082         material = materialN;
00083 }
00084 
00085 void
00086 COME_SubSpaceElement::setIndex( int indexN ){
00087 
00088         index = indexN;
00089 }
00090 
00091 void
00092 COME_SubSpaceElement::setStress( double stressN ){
00093 
00094         stress = stressN;
00095 }
00096 
00097 void
00098 COME_SubSpaceElement::setStrain( double strainN ){
00099 
00100         strain = strainN;
00101 }
00102 
00103 void
00104 COME_SubSpaceElement::setFixed( bool flag ){
00105 
00106         fixed = flag;
00107 }
00108 
00112 
00113 
00114 bool
00115 COME_SubSpaceElement::isFixed() const{
00116 
00117         return fixed;
00118 }
00119 
00120 double
00121 COME_SubSpaceElement::getMass() const {
00122 
00123         return mass;
00124 }
00125 
00126 double
00127 COME_SubSpaceElement::getVolume() const {
00128 
00129         return volume;
00130 }
00131 
00132 COME_Point3D
00133 COME_SubSpaceElement::getPosition() const {
00134 
00135         return position;
00136 }
00137 
00138 COME_Point3D
00139 COME_SubSpaceElement::getPositionMinusOne() const {
00140 
00141         return position_minus_one;
00142 }
00143 
00144 COME_Point3D
00145 COME_SubSpaceElement::getLastDisp() const {
00146 
00147         return ( position - position_minus_one );
00148 }
00149 
00150 COME_Point3D
00151 COME_SubSpaceElement::getGlobalPosition() const {
00152 
00153         COME_Matrix localGIM = ((COME_BioStructure*)parent)->getGIM();
00154         if( description == "origin" )
00155                 localGIM = COME_Matrix();
00156         //printf( "CHECK: Line commented because of getGIM() link error on discretizer \n" );
00157         if( !isFixed() )
00158                 return position;
00159         return localGIM * position;
00160 }
00161 
00162 COME_Vector3D
00163 COME_SubSpaceElement::getVelocity() const {
00164 
00165         return velocity;
00166 }
00167 
00168 COME_Vector3D
00169 COME_SubSpaceElement::getAcceleration() const {
00170 
00171         return acceleration;
00172 }
00173 
00174 COME_Material*
00175 COME_SubSpaceElement::getMaterial() const {
00176 
00177         return material;
00178 }
00179 
00180 int
00181 COME_SubSpaceElement::getIndex() const {
00182 
00183         return index;
00184 }
00185 
00186 double
00187 COME_SubSpaceElement::getStress() const {
00188 
00189         return stress;
00190 }
00191 
00192 double
00193 COME_SubSpaceElement::getStrain() const {
00194 
00195         return strain;
00196 }

Generated on Thu Dec 1 10:13:36 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5