Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[All] issofa_bugfix: cleans and fixes #218

Merged
merged 48 commits into from
Sep 11, 2020
Merged

[All] issofa_bugfix: cleans and fixes #218

merged 48 commits into from
Sep 11, 2020

Conversation

guparan
Copy link
Contributor

@guparan guparan commented Mar 23, 2017

This PR will be further discussed during STC#3.

issofa_bugfix

Cleans

  • BaseObject: Output message in serr for required datas. Error word should be reserved for messages that will make the application fail.
  • RayTriangleVisitor and SceneLoaderFactory: clean warnings
  • ParticlesRepulsionForceField: Add empty implementation of addKToMatrix to get rid of console warnings.

Bugfixes

  • AttachConstraint: fix crash when indices are resized
  • BTDLinearSolver: fix constant log + operator new [] vs operator delete mismatch
  • CatmullRomSplineMapping: fix applyJ compilation
  • ConstantForceField: fix avoid crashes in draw when trying to apply a constantforcefield to a non existing point
  • DistanceGrid: fix incorrect use of serr
  • GeneralConstraintSolver: fix incorrect parent class in SOFA_CLASS macro
  • IndicesFromValues: fix use getTemplateName to avoid problems of links with other data
  • EulerImplicitSolver: fix Disable calls to solveConstraint from EulerImplicitSolver by default as it is not needed unless an very specific solver is added and it currently crashes in other cases + wrong argument order in calls to AdvancedTimer::stepNext()
  • FixedConstraint and PartialFixedConstraint: fix "fixed FixedConstraint & PartialFixedConstraint for size-varying mechanical objects".
  • MechanicalObject: fix crash in debug with null pointer
  • Mass: fix remove error logging in Mass method that are inherited from Forcefield API and that are not relevant for Mass
  • MechanicalMatrixVisitor and MechanicalOperations: fix if using a Linear Solver, projective constraints were wrongly applied when a force field is in a child node
  • Mesh2PointMechanicalMapping: fix constraints ApplyJT
  • Metis(gk_arch.h): fix compilation with Visual Studio 2015
  • ParticlesRepulsionForceField and RepulsiveSpringForceField: fix avoid division by 0 on repulsion force fields
  • PersistentContactBarycentricMapping: fix init variables in constructor
  • RestShapeSpringsForceField: fix Runtime stiffness tunning was not working + optimisation and cleaning
  • SkinningMapping: fix compilation of SofaRigid
  • SofaViewer: fix crashes when current camera of pick-handler is NULL
  • SurfacePressureForceField: fix volume computation formula
  • TaitSurfacePressureForceField: fix contribution to the stiffness matrix for the second component df = P+dN in TaitSurfacePressureForceField
  • TopologicalMapping: fix display error messages when a TopologicalMapping failed to be created
  • TriangularFEMForceFieldOptim: fix principal values ordering with input matrix is diagonal + uninitialized value warning
  • VisualModelImpl: fix wrong object (triangles) called when adding quads in handleTopologyChange()
  • VoxelGridLoader: std::unique result was not used

This PR:

  • builds with SUCCESS for all platforms on the CI.
  • does not generate new warnings nor unit test failures.
  • does not break existing scenes.
  • does not break API compatibility.
  • has been reviewed and agreed to be transitional.
  • is more than 1 week old.

Reviewers will merge only if all these checks are true.

thomasjundinsimo and others added 30 commits October 12, 2016 16:26
ADD : Optimizations & cleaning.
This reverts commit 7507f05d07b5932974a68b121d64101f0f92a678.

Conflicts:
	framework/sofa/core/ObjectFactory.cpp

NB FJ: worth investigating later, but right now it just generates tons of
warnings and does not seem to comply to the promises the initial commit
made
…be reserved for messages that will make the application fail.
…as it is not needed unless an very specific solver is added and it currently crashes in other cases

git-svn-id: https://code.insimo.fr/svn/IS/ISSofa/branches/ISSofa@10544 f8a8aa39-ebdb-4476-bae3-08f188f1b544
…andle multiple points generation according to only one source primitive
…ying mechanical objects".

Not the best way to handle this, probably bugged, and in all cases it broke projectJacobianMatrix in FixedConstraint, at least
with the implementation of constraint Jacobians using sofa::defaulttype::MapMapSparseMatrix.
In this implementation row.size() is not equal to the size of the mechanicalObject, but to the number of dofs that are affected by a given constraint equation.

This partially reverts commit c4aa645fd431369db795e317cd05df6f86460515
… = P+dN in TaitSurfacePressureForceField (Ref T1019, T1010)
@hugtalbot hugtalbot added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Jan 13, 2019
@hugtalbot hugtalbot dismissed matthieu-nesme’s stale review January 21, 2019 13:48

review taken into account

@hugtalbot
Copy link
Contributor

@fjourdes and @ChristianDuriez I think this comes from the collaboration between you guys.
Last moment for a feedback before merge, thx

@@ -223,17 +223,6 @@ class SOFA_SIMULATION_CORE_API MechanicalAddMBK_ToMatrixVisitor : public Mechani
return RESULT_CONTINUE;
}

//Masses are now added in the addMBKToMatrix call for all ForceFields

virtual Result fwdProjectiveConstraintSet(simulation::Node* /*node*/, core::behavior::BaseProjectiveConstraintSet* c)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this has been removed ?
Is it replaced by MechanicalApplyProjectiveConstraint_ToMatrixVisitor ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's related to

MechanicalMatrixVisitor and MechanicalOperations: fix if using a Linear Solver, projective constraints were wrongly applied when a force field is in a child node

When you have a MechanicalObject and a projective constraint in a (parent) node and a ForceField in a child node, which you have to do if for instance you want to apply it to the DOFs but with a different topology for the elements (a subset, or converting hexas to tetras for example), then the matrix was projected before the forcefield would add its contributions.
In order to fix it in all cases (allowing for both forcefield and projective constraints in child nodes) the solution is now to do it with two visitors.

void solve (Matrix& M, Vector& x, Vector& b) override ;
void invert(Matrix& M) override;
bool addJMInvJtLocal(TMatrix * M, ResMatrixType * result,const JMatrixType * J, double fact) override;
virtual void solve (Matrix& M, Vector& x, Vector& b) override;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtual not needed.

@@ -178,7 +178,7 @@ void CatmullRomSplineMapping<TIn, TOut>::apply( const sofa::core::MechanicalPara


template <class TIn, class TOut>
void CatmullRomSplineMapping<TIn, TOut>::applyJ( const sofa::core::MechanicalParams* mparams, OutDataVecDeriv& outData, const InDataVecDeriv& inData)
void CatmullRomSplineMapping<TIn, TOut>::applyJ( const sofa::core::MechanicalParams* mparams /* PARAMS FIRST */, OutDataVecDeriv& outData, const InDataVecDeriv& inData)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PARAMS_FIRST is to removed.

@ChristianDuriez
Copy link
Contributor

For me, it's ok.
I just had a question about the applyconstraint that has been removed in the visitor..

@guparan guparan added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Jan 30, 2019
@epernod epernod added the STC#8 Simple tasks for STC#8 coding sprint label Nov 15, 2019
@hugtalbot hugtalbot added STC#9 Simple tasks for STC#5 coding sprint and removed STC#5 STC#8 Simple tasks for STC#8 coding sprint labels Feb 27, 2020
@fredroy fredroy added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Aug 14, 2020
@hugtalbot
Copy link
Contributor

Looks fine to me now

@hugtalbot
Copy link
Contributor

CentOS: 15 scenes time out
MacOS: 87 crashes (time out as well) ..

Let's :

[ci-build][with-all-tests][force-full-build]

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Sep 9, 2020
@epernod epernod merged commit 114cd81 into master Sep 11, 2020
@guparan guparan deleted the issofa_bugfix branch September 18, 2020 12:18
@guparan guparan added this to the v20.12 milestone Nov 17, 2020
@guparan guparan changed the title [all] issofa_bugfix: cleans and fixes [All] issofa_bugfix: cleans and fixes Jan 18, 2021
bakpaul pushed a commit to bakpaul/sofa that referenced this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix Fix a bug pr: status ready Approved a pull-request, ready to be squashed STC#9 Simple tasks for STC#5 coding sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.