precice / calculix-adapter

preCICE-adapter for the CSM code CalculiX
GNU General Public License v3.0
52 stars 20 forks source link

V2.16 #33

Closed KyleDavisSA closed 4 years ago

KyleDavisSA commented 4 years ago

This PR updates the master branch to be compatible with the latest CalculiX v2.16.

KyleDavisSA commented 4 years ago

@MakisH The tutorial works for me. It doesn't look like a Calculix issue there. Did you try other mapping? Is it only that tutorial that does not work?

MakisH commented 4 years ago

@KyleDavisSA I tried again, I still get errors, only with RBF (NN and NP work as expected). I am using preCICE v2.0.2, OpenFOAM v1912, and PETSc 3.9.1. I also reproduced this in the 3DTube tutorial (switching to rbf-thin-plate-splines). On the Fluid side (which does both mappings), I get a similar error:

Click to reveal...

``` ---[preciceAdapter] [DEBUG] Writing coupling data... ---[preciceAdapter] [DEBUG] Advancing preCICE... ---[precice] Mapping Forces0 conservative from Fluid-Mesh-Faces (ID 1) to Calculix_Mesh (ID 2) for dimension 0) with polynomial set to separate ---[precice] Mapping Forces0 conservative from Fluid-Mesh-Faces (ID 1) to Calculix_Mesh (ID 2) for dimension 1) with polynomial set to separate ---[precice] Mapping Forces0 conservative from Fluid-Mesh-Faces (ID 1) to Calculix_Mesh (ID 2) for dimension 2) with polynomial set to separate ---[precice] Compute read mapping from mesh "Calculix_Mesh" to mesh "Fluid-Mesh-Nodes". ---[precice] Using tree-based preallocation for matrix C ---[precice] Using tree-based preallocation for matrix A ---[precice] Mapping DisplacementDeltas0 consistent from Calculix_Mesh (ID 2) to Fluid-Mesh-Nodes (ID 0) for dimension 0) with polynomial set to separate KSP Object: Coefficient Solver (solverC_) 1 MPI processes type: gmres restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement happy breakdown tolerance 1e-30 maximum iterations=10000, nonzero initial guess tolerances: relative=1e-09, absolute=1e-50, divergence=10000. left preconditioning using PRECONDITIONED norm type for convergence test PC Object: (solverC_) 1 MPI processes type: icc out-of-place factorization 0 levels of fill tolerance for zero pivot 2.22045e-14 using Manteuffel shift [POSITIVE_DEFINITE] matrix ordering: natural factor fill ratio given 1., needed 1. Factored matrix follows: Mat Object: 1 MPI processes type: seqsbaij rows=2588, cols=2588 package used to perform factorization: petsc total: nonzeros=3350166, allocated nonzeros=3350166 total number of mallocs used during MatSetValues calls =0 block size is 1 linear system matrix = precond matrix: Mat Object: C 1 MPI processes type: seqsbaij rows=2588, cols=2588 total: nonzeros=3350166, allocated nonzeros=3350166 total number of mallocs used during MatSetValues calls =0 block size is 1 ---[precice] ERROR: RBF linear system has not converged. Try to fix axis-aligned mapping setups by marking perpendicular axis as dead. ```

The preCICE tests pass. My runs are in serial.

I attach here the log files (with traces) for the flap_perp tutorial: Fluid.log Solid.log

I could imagine that something changed in the definition of the mesh or the writing of data in the adapter.

MakisH commented 4 years ago

I can also use RBF mapping in the OpenFOAM-OpenFOAM flow-over-plate tutorial without any problems.

I don't have any issues with the current master (73a9a062e3cd3a0c8d01d480950fc7f3172037a4) or develop (8e954db79e68feb47792de2bd8e0aec610a428af) - CalculiX 2.15.

precice-bot commented 4 years ago

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/can-precice-be-used-for-one-way-coupling/28/8

MakisH commented 4 years ago

@KyleDavisSA I tried again and I am still getting the same error, also in a different system. This time I tried on a clean install on Ubuntu 20.04, preCICE 2.0.1 from master built in Debug mode, PETSc 3.12 from APT (3.12.4+dfsg1-1), CalculiX 2.16 and the adapter from the v2.16 branch.

Running the tutorials/FSI/flap_perp/OpenFOAM-CalculiX tutorial without any changes, with OpenFOAM v1912, returns on the Fluid side:

---[preciceAdapter] [DEBUG] Writing coupling data...
---[preciceAdapter] [DEBUG] Advancing preCICE...
---[precice]  Mapping Forces0 conservative from Fluid-Mesh-Faces (ID 0) to Solid (ID 2) for dimension 0) with polynomial set to separate
---[precice]  Mapping Forces0 conservative from Fluid-Mesh-Faces (ID 0) to Solid (ID 2) for dimension 1) with polynomial set to separate
---[precice]  Mapping Forces0 conservative from Fluid-Mesh-Faces (ID 0) to Solid (ID 2) for dimension 2) with polynomial set to separate
---[precice]  Compute read mapping from mesh "Solid" to mesh "Fluid-Mesh-Nodes".
---[precice]  Using tree-based preallocation for matrix C
---[precice]  Using tree-based preallocation for matrix A
---[precice]  Mapping Displacements0 consistent from Solid (ID 2) to Fluid-Mesh-Nodes (ID 1) for dimension 0) with polynomial set to separate
KSP Object: QR Solver 1 MPI processes
  type: lsqr
    standard error not computed
    using inexact matrix norm
  maximum iterations=10000, initial guess is zero
  tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.
  left preconditioning
  using UNPRECONDITIONED norm type for convergence test
PC Object: 1 MPI processes
  type: none
  linear system matrix = precond matrix:
  Mat Object: Q 1 MPI processes
    type: seqdense
    rows=86, cols=4
    total: nonzeros=344, allocated nonzeros=344
    total number of mallocs used during MatSetValues calls=0
---[precice] ERROR:  Polynomial QR linear system has not converged. Try to fix axis-aligned mapping setups by marking perpendicular axis as dead.

Again, running the same exact tutorial on the v2.15 is perfectly fine.

Note that, for whatever reason, Travis did not check this case. @Eder-K any clue why?

Eder-K commented 4 years ago

Good catch, I think this happens because we do not list the test in the trigger_systemtests script. I will open a PR and check if these run on Travis.