mathLab / PINA

Physics-Informed Neural networks for Advanced modeling
https://mathlab.github.io/PINA/
MIT License
395 stars 66 forks source link

Re-implement LabelTensor class #349

Closed FilippoOlivo closed 2 months ago

FilippoOlivo commented 2 months ago

In the LabelTensor class, I made the following changes:

  1. Added the possibility to define a LabelTensor object by passing a Torch tensor and a list of DOF, which are assigned to the last dimension.
  2. Implemented the cat method, which allows concatenation of LabelTensor objects along a specified dimension.
  3. Re-implemented the extract method: now, if an integer or list is passed, only the last dimension is considered to improve backward compatibility with the current version and avoid unintentional errors.
  4. Added checks on the dimensions of the input list/dictionary and tensor to ensure consistency.