Added: Extract internal forces from ReactionsOnly integral
This commit is contained in:
parent
a5fd95b0ed
commit
d984430fca
@ -18,8 +18,9 @@
|
||||
#include "ProcessAdm.h"
|
||||
|
||||
|
||||
ReactionsOnly::ReactionsOnly (Vector& rf, const SAM* sam, const ProcessAdm& adm)
|
||||
: mySam(sam), myAdm(adm), R(rf)
|
||||
ReactionsOnly::ReactionsOnly (Vector& rf, const SAM* sam,
|
||||
const ProcessAdm& adm, Vector* sf)
|
||||
: mySam(sam), myAdm(adm), R(rf), S(sf)
|
||||
{
|
||||
mySam->initForAssembly(b,&R);
|
||||
}
|
||||
@ -41,6 +42,14 @@ bool ReactionsOnly::finalize (bool)
|
||||
#if SP_DEBUG > 2
|
||||
std::cout <<"\nReaction forces:"<< R;
|
||||
#endif
|
||||
|
||||
if (!S)
|
||||
return true;
|
||||
else if (!b.beginAssembly() || !b.endAssembly())
|
||||
return false;
|
||||
else if (!mySam->expandSolution(b,*S,0.0))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,9 @@ public:
|
||||
//! \param[in] rf The reaction force vector to be assembled
|
||||
//! \param[in] sam Data for FE assembly management
|
||||
//! \param[in] adm Parallell processing administrator
|
||||
ReactionsOnly(Vector& rf, const SAM* sam, const ProcessAdm& adm);
|
||||
//! \param[in] sf Internal force vector to be assembled
|
||||
ReactionsOnly(Vector& rf, const SAM* sam, const ProcessAdm& adm,
|
||||
Vector* sf = nullptr);
|
||||
//! \brief Empty destructor.
|
||||
virtual ~ReactionsOnly() {}
|
||||
|
||||
@ -62,6 +64,7 @@ private:
|
||||
|
||||
Vector& R; //!< Nodal reaction forces
|
||||
StdVector b; //!< Dummy right-hand-side vector
|
||||
Vector* S; //!< Internal force vector
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -289,7 +289,7 @@ public:
|
||||
//! \param[in] idx Index to the system vector to extract
|
||||
//! \param[in] hd Header for outprint of resultant
|
||||
bool extractLoadVec(Vector& loadVec, size_t idx = 0,
|
||||
const char* hd = NULL) const;
|
||||
const char* hd = nullptr) const;
|
||||
//! \brief Extracts an assembled global scalar quantity.
|
||||
double extractScalar(size_t idx = 0) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user