Skip to content

barycenter computation #46

@npaster

Description

@npaster

For the moment, there are two different functions to compute the barycenter:

  • one which compute the barycenter
  • one which compute the center of mass

There are are at least four problems:

  1. The two functions don't give the same results for a same geometry (except for simplicial). I think it is better if we rename the function which compute the center of mass like centerOfMass(). It prevents unexpected results and don't create confusion.
  2. There is no function to compute the centerOfMass in 1D and in 3D (in 1D, the two definitions are equivalent)
  3. During a same computation, the two functions are called indifferently. This is not very good, because we loose the consistency of the definition of the barycenter. (To test: add a comment in both barycenter function and run vector_reconstruction test). We have to choose carefully which function have to be used.
  4. The computation of the barycenter with the function center of mass depends on the numbering of the nodes. The barycenter is different between cartesian mesh using generic_mesh and cartesian_mesh for a same geometry. cartesian_mesh use a strange ordering of the nodes 0-1-3-2 and not 0-1-2-3. Tow possibilities: create a specific function for cartesian_mesh or change the ordering of the nodes.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions