dmitryikh / nla3d

2D/3D finite element programming framework
MIT License
30 stars 11 forks source link

refactoring of procedures for DoF registering #3

Closed dmitryikh closed 7 years ago

dmitryikh commented 9 years ago

For now, elements and other entities have an ability to register DoF etheir in nodes or in elements. That means that the element are going to use this DoF in its stiffness matrix. Here is two steps to register DoF:

  1. Element in its constructor should register DoF type, for example:
ElementTRUSS3::ElementTRUSS3 () {

  ...

  Node::registerDofType(Dof::UX);
  Node::registerDofType(Dof::UY);
  Node::registerDofType(Dof::UZ);
}
  1. Then in Element::pre() functions it's needed to register particular DoFs for particular nodes (elements in case of element DoF). For example:
void ElementTRUSS3::pre () {
  for (uint16 i = 0; i < Element::n_nodes(); i++) {
    storage->registerNodeDof(getNodeNumber(i), Dof::UX);
    storage->registerNodeDof(getNodeNumber(i), Dof::UY);
    storage->registerNodeDof(getNodeNumber(i), Dof::UZ);
  }
}

I think that it is excess. And we can live only with second step (without registering DoF types in step 1). For this we need to slightly rework internal registering mechanisms and data structures in FEStorage class. I believe that it could be done without any drawback in performance..

dmitryikh commented 7 years ago

Done. Currently DofCollection in FEStorage used to store Dof objects.