1
/*=============================================================================
3
??******************************************************************************
4
??*������������� ���������������� *
5
??*������ COPYRIGHT� ???????� -� All Rights Reserved�������������������������� *
6
??*�������������� ������������������������������������������������������������ *
7
??* This software is the property of ??????????????.� No part of this code�� *
8
??* may be copied in any form or by any means without the expressed written� *
9
??* consent of ???????????.� Copying, use or modification of this software *
10
??* by any unauthorised person is illegal unless that���������������������� *
11
??* person has a software license agreement with ?????????????.���� *
12
??*������������������ *
13
??******************************************************************************
15
*********************************************************************************/
17
#include "Model/BodyForceGroup.h"
23
BodyForceIGP::BodyForceIGP() : AIGParam(), m_acceleration()
27
BodyForceIGP::BodyForceIGP(const std::string &name, const Vec3 &acceleration)
29
m_acceleration(acceleration)
33
BodyForceIGP::~BodyForceIGP()
37
const Vec3 &BodyForceIGP::getAcceleration() const
39
return m_acceleration;
42
const std::string &BodyForceIGP::getName() const
47
void BodyForceIGP::packInto(CVarMPIBuffer *pBuffer) const
49
pBuffer->append(getName().c_str());
50
pBuffer->append(m_acceleration.X());
51
pBuffer->append(m_acceleration.Y());
52
pBuffer->append(m_acceleration.Z());
55
BodyForceIGP BodyForceIGP::extract(CVarMPIBuffer *pBuffer)
57
const std::string name = std::auto_ptr<char>(pBuffer->pop_string()).get();
59
const double x = pBuffer->pop_double();
60
const double y = pBuffer->pop_double();
61
const double z = pBuffer->pop_double();
63
return BodyForceIGP(name, Vec3(x, y, z));