-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Port adapter to CCX v2.21 #115
base: master
Are you sure you want to change the base?
Port adapter to CCX v2.21 #115
Conversation
Compiles with preCICE version 2.5.0. PastiX solver not tested. |
Thanks for the important contribution @numericalfreedom 🚀 Did you run any of the preCICE tutorials as tests or how did you check whether the adapter works correctly? |
Dear Benjamin, thank You for Your kind comments. The preCICE version of ccx_2.21 compiles and works fine with all native CalculiX tests (standalone ccx_preCICE works fine). Between the versions ccx_2.20 and ccx_2.21 there were only some cosmetic changes as far as it is concering the preCICE connection. I assume, that the version ccx_2.21 with preCICE works also fine but this remains to be thoroughly tested. I am too much a newbee to have several codes available to couple CalculiX with and also to have the detailed knowledge to do so. Maybe, I can use Your expertise on this. Thank You very much for Your kind attention and best wishes, Nandor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update!
The Makefile needs some attention, but I managed to build the adapter using the same Makefile as in ccx2.20 (with only the version changed).
Besides that, I have the impression that the files ccx_2.21.c
and CalculiX.h
are the unmodified CalculiX files, not the adapted ones. I noticed that by trying to run a tutorial, in which case the CalculiX participant just started iterating without waiting for the other participant.
Let me know if you need any help applying my suggestions! :-)
CCX_VERSION = 2.20 | ||
CCX = $(HOME)/CalculiX/ccx_$(CCX_VERSION)/src | ||
CCX_VERSION = 2.21 | ||
CCX_HOME = /opt/src | ||
CCX = $(CCX_HOME)/CalculiX/ccx_$(CCX_VERSION)/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CCX_VERSION
should indeed be updated, but the CCX
should remain as-is.
I don't think we need a separate CCX_HOME
variable, it makes copy-pasting paths more complicated. If it helps further parts or CalculiX-internal workflows, let's keep it.
SPOOLES_INCLUDE = -I/usr/include/spooles/ | ||
# SPOOLES library flags (e.g. $(HOME)/SPOOLES.2.2/spooles.a) | ||
SPOOLES_LIBS = -lspooles | ||
# SPOOLES_INCLUDE = -I$(CCX_HOME)/SPOOLES.2.2 | ||
SPOOLES_INCLUDE = -I/usr/include/spooles | ||
# SPOOLES library flags (e.g. -L$(HOME)/SPOOLES.2.2/spooles.a) | ||
# SPOOLES_LIBS = -L$(CCX_HOME)/SPOOLES.2.2 -l:spooles -L$(CCX_HOME)/SPOOLES.2.2/MT/src/spoolesMT -l:spoolesMT | ||
# SPOOLES_LIBS = $(CCX_HOME)/SPOOLES.2.2/MT/src/spoolesMT.a $(CCX_HOME)/SPOOLES.2.2/spooles.a | ||
SPOOLES_LIBS = -lspooles | ||
# | ||
# ARPACK include flags (e.g. -I$(HOME)/ARPACK) | ||
ARPACK_INCLUDE = | ||
ARPACK_INCLUDE = -I/usr/include/arpack | ||
# ARPACK_INCLUDE = -I$(CCX_HOME)/ARPACK/SRC | ||
# ARPACK library flags (e.g. $(HOME)/ARPACK/libarpack_INTEL.a) | ||
ARPACK_LIBS = -larpack -llapack -lblas | ||
# ARPACK_LIBS = -L$(CCX_HOME)/ARPACK -l:arpack_INTEL -llapack -lblas | ||
# ARPACK_LIBS = $(CCX_HOME)/ARPACK/libarpack_INTEL.a -llapack -lblas | ||
ARPACK_LIBS = -larpack -llapack -lblas | ||
# | ||
# yaml-cpp include flags (e.g. -I$(HOME)/yaml-cpp/include) | ||
YAML_INCLUDE = -I/usr/include/ | ||
# YAML_INCLUDE = -I/usr/share/yaml-cpp/head/include | ||
YAML_INCLUDE = -I/usr/include/ | ||
# yaml-cpp library flags (e.g. -L$(HOME)/yaml-cpp/build -lyaml-cpp) | ||
YAML_LIBS = -lyaml-cpp | ||
# YAML_LIBS = -L/usr/share/yaml-cpp/head/lib -lyaml-cpp | ||
YAML_LIBS = -lyaml-cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these changes intended?
Let's keep the same format (number of spaces).
$(PKGCONF_LIBS) \ | ||
$(PKGCONF_LIBS) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -53,6 +62,7 @@ LIBS = \ | |||
#FFLAGS = -g -Wall -O0 -fopenmp $(INCLUDES) | |||
|
|||
CFLAGS = -Wall -O3 -fopenmp $(INCLUDES) -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT | |||
CFLAGS = -w -O3 -fopenmp $(INCLUDES) -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing from -Wall
to -w
?
If it was intended to add the -Wextra
, then let's just add it explicitly.
Or is this a change that comes from the CalculiX v2.21 Makefile?
Same below.
g++ -std=c++11 $(YAML_INCLUDE) -c $< -o $@ $(LIBS) | ||
#$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ $(LIBS) | ||
$(CC) -std=c++11 $(INCLUDES) -c $< -o $@ $(LIBS) | ||
# g++ -std=c++11 $(YAML_INCLUDE) -c $< -o $@ $(LIBS) | ||
# $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ $(LIBS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should change g++
to $(CC)
. I also like the additional space. Then maybe just remove the commented-out line 101.
$(FC) -fopenmp -Wall -O3 -o $@ $(OCCXMAIN) $(OBJDIR)/ccx_$(CCX_VERSION).a $(LIBS) | ||
# $(FC) -fopenmp -Wall -O3 $(OCCXMAIN) $(OBJDIR)/ccx_$(CCX_VERSION).a $(LIBS) -o $@ | ||
|
||
# $(LIBS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this reordering and formatting?
CCX = $(HOME)/CalculiX/ccx_2.20/src | ||
CCX_HOME = /opt/src | ||
CCX = $(CCX_HOME)/CalculiX/ccx_2.21/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to the normal Makefile (reminder, independent of the decision to keep or frop the CCX_HOME
.
@@ -0,0 +1,1923 @@ | |||
/* CalculiX - A 3-dimensional finite element program */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing this file with ccx_2.20.c
, it looks like this file does not contain the preCICE-specific changes. Did you maybe accidentally replace the complete file with the unmodified Calculix?
ITG *irow, ITG *jq, ITG *neq, double *adfreq, double *aubfreq, | ||
ITG *irowfreq, ITG *iaux, ITG *jqfreq, ITG *icolfreq, ITG *neqfreq, | ||
ITG *nzsfreq, double *om, ITG *symmetryflag, ITG *inputformat, | ||
double *b, double *bfreq) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to the ccx_2.21.c
, it looks like the preCICE-specific changes are missing.
Update to CalculiX version 2.21 (July 2023)