Skip to content

Commit 8854305

Browse files
committed
Fix composite assembly with FreeFem++-mpi
Reported-by: Chris Douglas @cmdoug
1 parent e21a086 commit 8854305

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

src/fflib/compositeFESpace.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ using namespace std;
7373
#pragma GCC diagnostic pop
7474
#endif
7575

76+
static inline bool isBemFormBilinearType(const aType r) {
77+
static const aType bemFormBilinearType = atype0<const BemFormBilinear *>();
78+
return (bemFormBilinearType != nullptr) && (r == bemFormBilinearType);
79+
}
80+
7681
#endif
7782
#endif
7883

@@ -318,7 +323,7 @@ list<C_F0> creationLargsForCompositeFESpace( const list<C_F0> & largs, const in
318323
// ******************************************
319324
// Case BemKFormBilinear (KERNEL FORM ONLY)
320325
// ******************************************
321-
else if (r==atype<const BemFormBilinear *>() ){
326+
else if (isBemFormBilinearType(r)){
322327
BemFormBilinear * bbtmp= dynamic_cast< BemFormBilinear *>(e);
323328
ffassert(bbtmp);
324329
int VVFBEM = bbtmp->type;
@@ -480,7 +485,7 @@ KNM< list<C_F0> > computeBlockLargs( const list<C_F0> & largs, const int &NpUh,
480485
// ******************************************
481486
// Case BemKFormBilinear (KERNEL FORM ONLY)
482487
// ******************************************
483-
else if (r==atype<const BemFormBilinear *>() ){
488+
else if (isBemFormBilinearType(r)){
484489
BemFormBilinear * bbtmp= dynamic_cast< BemFormBilinear *>(e);
485490
int VVFBEM = bbtmp->type;
486491

@@ -715,7 +720,7 @@ void changeComponentFormCompositeFESpace( const KN<int> &localIndexInTheBlockUh,
715720
// ******************************************
716721
// Case BemKFormBilinear (KERNEL FORM ONLY)
717722
// ******************************************
718-
else if (r==atype<const BemFormBilinear *>() ){
723+
else if (isBemFormBilinearType(r)){
719724
BemFormBilinear * bbtmp= dynamic_cast< BemFormBilinear *>(e);
720725
int VVFBEM = bbtmp->type;
721726

@@ -871,7 +876,7 @@ void reverseChangeComponentFormCompositeFESpace(const KN<int> &beginBlockUh, co
871876
// ******************************************
872877
// Case BemKFormBilinear (KERNEL FORM ONLY)
873878
// ******************************************
874-
else if (r==atype<const BemFormBilinear *>() ){
879+
else if (isBemFormBilinearType(r)){
875880
BemFormBilinear * bbtmp= dynamic_cast< BemFormBilinear *>(e);
876881
int VVFBEM = bbtmp->type;
877882

@@ -1080,7 +1085,7 @@ void listOfComponentBilinearForm(const list<C_F0> & largs){
10801085
// ******************************************
10811086
// Case BemKFormBilinear (KERNEL FORM ONLY)
10821087
// ******************************************
1083-
else if (r==atype<const BemFormBilinear *>() ){
1088+
else if (isBemFormBilinearType(r)){
10841089
BemFormBilinear * bbtmp= dynamic_cast< BemFormBilinear *>(e);
10851090
int VVFBEM = bbtmp->type;
10861091
cout << " read index term = "<< count_integral << " VVFBEM=" << VVFBEM << endl;
@@ -1170,7 +1175,7 @@ int haveBemSubMatrixBlock(const list<C_F0> & largs, int Uh_NbItem, int Vh_NbItem
11701175
// ******************************************
11711176
// Case BemKFormBilinear (KERNEL FORM ONLY)
11721177
// ******************************************
1173-
if (r==atype<const BemFormBilinear *>() ){
1178+
if (isBemFormBilinearType(r)){
11741179
haveBemFormBilinear = true;
11751180
nbBEM++;
11761181
}
@@ -1279,7 +1284,7 @@ void separateFEMpartBemPart(const list<C_F0> & largs, list<C_F0> &largs_FEM, lis
12791284
// ******************************************
12801285
// Case BemKFormBilinear (KERNEL FORM ONLY)
12811286
// ******************************************
1282-
if (r==atype<const BemFormBilinear *>() ){
1287+
if (isBemFormBilinearType(r)){
12831288
BemFormBilinear * bbtmp= dynamic_cast< BemFormBilinear *>(e);
12841289
ffassert(bbtmp);
12851290
int VVFBEM = bbtmp->type;
@@ -1468,7 +1473,7 @@ void deleteNewLargs(list<C_F0> &newlargs){
14681473
// ******************************************
14691474
// Case BemKFormBilinear (KERNEL FORM ONLY)
14701475
// ******************************************
1471-
else if (r==atype<const BemFormBilinear *>() ){
1476+
else if (isBemFormBilinearType(r)){
14721477
BemFormBilinear * bbtmp= dynamic_cast< BemFormBilinear *>(e);
14731478
ffassert(bbtmp);
14741479
int VVFBEM = bbtmp->type;

0 commit comments

Comments
 (0)