Hi Dario,
Thank you for fast response!
I'm sorry that I did give any details on the problem. I thought that it was some stupid mistake of a newbie and a common solution is ready )
Since my first post I've done some experiments and got more understanding of the problem.
First of all you are right "Panel" object has mistakes in its implementation which I still do not know how to fix yet.
I followed these three tutorials:
https://github.com/projectchrono/chrono/blob/main/src/demos/modal/demo_MOD_assembly.cpphttps://github.com/projectchrono/chrono/blob/main/src/demos/fea/demo_FEA_modal_assembly.cpphttps://github.com/projectchrono/chrono/blob/main/src/demos/fea/demo_FEA_contacts_NSC.cppFrom the last I've taken the loading of Tetgen mesh from my CAD model. The other two - for assembly and modal reduction.
Now to the core of my situation...
I need to put several "Panels" together to model their vibration. A single panel contains up to 15k DoFs that is already too much for Spectra and requires significant memory usage (that I've grasped experimentally but not yet sure about it).
In order to put the panels together interface points (boundary points) are needed. As described in the first link above the two types of mesh are needed in the ChModalAssembly, so I did like this:
mesh_internal = chrono_types::make_shared<ChMesh>();
AddInternal(mesh_internal); // NOTE: MESH FOR INTERNAL NODES: USE assembly->AddInternal()
mesh_boundary = chrono_types::make_shared<ChMesh>();
Add(mesh_boundary); // NOTE: MESH FOR BOUNDARY NODES: USE assembly->Add()
But then I loaded the positions and indices of vertices into the model and found out that I can't easily connect
ChNodeFEAxyz to ... anything else (like bodies).
After removing all interface points the reduction goes smooth but my panel is useless(
So I guess that the problem is in the constrains equations that are set by ChLinkXXXXXXs. And I don't know yet how to add ChLinks correctly
I put my code for adding interface points below, may be you could give me a hint where I'm wrong?
```
if(!interfaceNodesIds.empty())
{
for(int i=0;i<interfaceNodesIds.size();++i)
{
if(interfaceNodesIds[i]<0) // the point is being created not selected from the mesh
{
std::vector<std::shared_ptr<ChNodeFEAxyz>> aggregatedNodes(aggregatedNodesIds[i].size());
ChVector<double> newNodePos(0,0,0); // set it to the average of the aggregatedNodes
for(int j=0;j<aggregatedNodesIds[i].size();++j)
{
aggregatedNodes[i] = (std::dynamic_pointer_cast<ChNodeFEAxyz>(mesh_internal->GetNode(aggregatedNodesIds[i][j])));
newNodePos += std::dynamic_pointer_cast<ChNodeFEAxyz>(mesh_internal->GetNode(aggregatedNodesIds[i][j]))->GetX0();
}
newNodePos /= aggregatedNodesIds[i].size(); //
// std::shared_ptr<ChNodeFEAxyz> interfNode = chrono_types::make_shared<ChNodeFEAxyz>(newNodePos);
std::shared_ptr<ChBody> interfNodeBody = chrono_types::make_shared<ChBody>();
interfNodeBody->SetMass(0.0001);
interfNodeBody->SetInertia(ChMatrix33<double>::Identity()*0.00000001);
interfNodeBody->SetPos(newNodePos);
interfNodeBody->SetName(interfaceNames[i].c_str());
Add(interfNodeBody);
//add body to the list of interface points for external links attachment
interfacePoints.push_back(interfNodeBody);
//attach all the aggregated nodes to the interface body (point)
for(int j=0;j<aggregatedNodes.size();++j)
{
mesh_boundary->AddNode(aggregatedNodes[i]);
auto my_root = chrono_types::make_shared<ChLinkPointFrame>();
my_root->Initialize(aggregatedNodes[i], interfNodeBody);
// AddInternalLink(my_root);
AddLink(my_root);
}
}
else if(interfaceNodesIds[i]>=0){
std::shared_ptr<ChNodeFEAxyz> interfNode = std::dynamic_pointer_cast<ChNodeFEAxyz>(mesh_internal->GetNode(interfaceNodesIds[i]));
std::shared_ptr<ChBody> interfNodeBody = chrono_types::make_shared<ChBody>();
interfNodeBody->SetMass(0.001);
interfNodeBody->SetInertia(ChMatrix33<double>::Identity()*0.001);
interfNodeBody->SetPos(interfNode->GetX0());
interfNodeBody->SetName(interfaceNames[i].c_str());
Add(interfNodeBody);
//add body to the list of interface points for external links attachment
interfacePoints.push_back(interfNodeBody);
std::vector<std::shared_ptr<ChNodeFEAxyz>> aggregatedNodes(aggregatedNodesIds[i].size());
for(int j=0;j<aggregatedNodesIds[i].size();++j)
{
aggregatedNodes[i] = (std::dynamic_pointer_cast<ChNodeFEAxyz>(mesh_internal->GetNode(aggregatedNodesIds[i][j])));
}
// new interface point to be added to the system
//attach the interface node to the interface body (point)
// mesh_boundary->AddNode(interfNode);
{
auto my_root = chrono_types::make_shared<ChLinkPointFrame>();
my_root->Initialize(interfNode, interfNodeBody);
// AddLink(my_root);
AddInternalLink(my_root);
}
//attach all the aggregated nodes to the interface body (point)
for(int j=0;j<aggregatedNodes.size();++j)
{
// mesh_boundary->AddNode(aggregatedNodes[i]);
auto my_root = chrono_types::make_shared<ChLinkPointFrame>();
my_root->Initialize(aggregatedNodes[i], interfNodeBody);
AddInternalLink(my_root);
// AddLink(my_root);
}
}
}
}
```