calculix / ccx-containerd

Calculix CrunchiX Container for portable usage.
GNU General Public License v2.0
1 stars 0 forks source link

How tom use CalculiX with TAUCS #1

Open munkapas opened 4 years ago

munkapas commented 4 years ago

Hello, I am trying to compile CalculiX with TAUCS solver. Is there a step-by-step guide that explains how this can be done? Regards, Nimrod

TEFEdotCC commented 4 years ago

There is a step by step guide in the original README.INSTALL in the sources of ccx. https://github.com/calculix/ccx/blob/master/src/README.INSTALL

If you would like to experiment with TAUCS, or if you have access to the SGI scientific library, or if you would like to use PARDISO, continue reading. Else, go to item 4.

If you like to use TAUCS as solver, install TAUCS in /usr/local/taucs (and lapack, blas and metis in /usr/local/taucs/external/lib/linux) and change the Makefile in /usr/local/CalculiX/ccx_2.16/src as follows: a) add "-I ../../../taucs/src -I ../../../taucs/build/linux -DTAUCS" to the CFLAGS (without double quotes) b) add "../../../taucs/lib/linux/libtaucs.a \ ../../../taucs/external/lib/linux/liblapack.a \ ../../../taucs/external/lib/linux/libblas.a \ ../../../taucs/external/lib/linux/libmetis.a \" to LIBS Notice that you only need lapack, blas and metis if you want to install TAUCS.

TEFEdotCC commented 4 years ago

Please let my know if you know all build steps to add support for TAUCS

I had figured out to add to buildah.sh

# taucs
if [ "$TAUCS_ENABLED" -eq 1 ] ; then
  #
  [ -d "taucs" ] && rm -rf taucs
  mkdir taucs
  tar -xzvf 3rdpart/taucs/taucs_full_2.2_with_ext_libs.tgz -C taucs
  buildah copy $newc taucs "/usr/local/taucs/"
  rm -rf taucs
  #
  buildah run $newc /bin/bash -c "                                                 \
       cd /usr/local/CalculiX/ccx_${VERSION}/src                                   \
    && sed -i 's|^CFLAGS = .*|& -I ../../../taucs/src -I ../../../taucs/build/linux -DTAUCS|'  Makefile_MT \
    && sed -i 's|^LIBS = \.*|&./../../taucs/lib/linux/libtaucs.a ../../../taucs/external/lib/linux/liblapack.a ../../../taucs/external/lib/linux/libblas.a ../../../taucs/external/lib/linux/libmetis.a |'  Makefile_MT \
    "
  #
fi
TEFEdotCC commented 4 years ago

I had add an additional flag to support TAUCS compilation of ccx to the master branch. Actually it is a temporary feature.

Use the script to create an image with TAUCS support.

> ./buildah.sh --TAUCS

Please check it out and report bugs, please.

Is there a major reson to use TAUCS as matrix solver?

munkapas commented 4 years ago

Thank you for looking into this. I am slowly learning how I could use the buildah.sh file. After experimenting with Ubuntu Linux and Fedora, I found that I will need to first setup Fedora Atomic host. I will proceed with using Fedora Atomic and will post my findings later.

munkapas commented 4 years ago

Yes, I can now confirm the buildah script successfully built a container with SPOOLES and TAUCS solvers. The reason I would like to evaluate TAUCS solver is because I previously ran a frequency analysis of an automotive brake rotor model with SPOOLES solver and the results were significantly different than the data obtained with Abaqus, although the mesh and material properties were all the same in both CalculiX and Abaqus. So I am wondering what results the TAUCS solver can provide. However, I have an issue. After building the CalculiX container, all models in the provided example folder ran successfully with the SPOOLES solver, but all models exited with the TAUCS solver with the below error: Segmentation fault (core dumped) Can this issue be remedied?

TEFEdotCC commented 4 years ago

Thank you for the reply.

Can you build an simple test case for your problem? I will check it in the next day's.

munkapas commented 4 years ago

The issue that I observed can be reproduced in the following way:

In this repository, under examples/modal/static_beam_01/case.inp https://github.com/calculix/ccx-containerd/blob/master/examples/modal/static_beam_01/case.inp

Change line 20 from FREQUENCY to FREQUENCY, SOLVER=TAUCS

Then run this modified model with the container that was created with TAUCS enabled. The simulation runs for about one minute, then exits. The original example without the SOLVER=TAUCS option completes successfully. The other examples provided in this repository can be changed the same way by adding the option SOLVER=TAUCS and the same issue will be reproduced. Let me know if more details are needed. Thank you for looking into this.