Added: Internal forces debug print

This commit is contained in:
Knut Morten Okstad 2022-04-02 14:59:05 +02:00
parent 3ce4b7f369
commit 5d7270e612
2 changed files with 11 additions and 1 deletions

View File

@ -1149,7 +1149,7 @@ bool SIMbase::extractLoadVec (Vector& loadVec, size_t idx, const char* hd) const
return false;
#if SP_DEBUG > 1
std::cout <<"\nLoad vector:"<< loadVec;
mySam->printVector(std::cout,loadVec,"\nLoad vector");
#endif
if (hd)
{

View File

@ -69,11 +69,21 @@ Vector SIMgeneric::getInterfaceForces (const Vector& sf,
IntVec glbNodes;
this->getBoundaryNodes(code,glbNodes);
#if SP_DEBUG > 1
std::cout <<"\nInternal nodal forces at interface "<< code
<<" with "<< glbNodes.size() <<" nodes"<< std::endl;
#endif
for (int inod : glbNodes)
{
double w = inod <= (int)weights.size() ? weights[inod-1] : 1.0;
std::pair<int,int> dof = mySam->getNodeDOFs(inod);
#if SP_DEBUG > 1
std::cout <<"Node "<< inod <<":";
for (int j = dof.first; j <= dof.second; j++)
std::cout <<" "<< sf(j);
std::cout << std::endl;
#endif
for (unsigned char i = 0; i < nsd; i++, dof.first++)
if (dof.first <= dof.second && dof.first < (int)sf.size())
force[i] += w*sf(dof.first);