Commit 37fa3cde authored by gsell's avatar gsell
Browse files

Merge branch '443-cleanup-remove-ippl_use_member_templates' into 'master'

Resolve "cleanup: remove IPPL_USE_MEMBER_TEMPLATES"

Closes #443

See merge request !256
parents fb8555e1 b81caaee
......@@ -109,20 +109,11 @@ public:
// Stuff for doing index mapping calculations.
bool empty() const;
NDIndex<Dim> intersect(const NDIndex<Dim>&) const;
#ifdef IPPL_USE_MEMBER_TEMPLATES
template<unsigned D>
NDIndex<Dim> plugBase(const NDIndex<D>& i)const {
return ::plugBase(*this,i);
}
#else
NDIndex<Dim> plugBase(const NDIndex<1>& i)const{ return ::plugBase(*this,i);}
NDIndex<Dim> plugBase(const NDIndex<2>& i)const{ return ::plugBase(*this,i);}
NDIndex<Dim> plugBase(const NDIndex<3>& i)const{ return ::plugBase(*this,i);}
NDIndex<Dim> plugBase(const NDIndex<4>& i)const{ return ::plugBase(*this,i);}
NDIndex<Dim> plugBase(const NDIndex<5>& i)const{ return ::plugBase(*this,i);}
NDIndex<Dim> plugBase(const NDIndex<6>& i)const{ return ::plugBase(*this,i);}
NDIndex<Dim> plugBase(const NDIndex<7>& i)const{ return ::plugBase(*this,i);}
#endif
// useful functions with DomainMap.
bool touches(const NDIndex<Dim>&) const;
......
......@@ -198,22 +198,14 @@ public:
T d[2];
d[0] = First;
d[1] = Last;
#ifdef IPPL_USE_MEMBER_TEMPLATES
m.put(d, d + 2);
#else
putMessage(m,d,d+2);
#endif
return m;
}
// get data out from a message
Message& getMessage(Message& m) {
T d[2];
#ifdef IPPL_USE_MEMBER_TEMPLATES
m.get_iter(d);
#else
getMessage_iter(m,d);
#endif
*this = PRegion<T>(d[0], d[1]);
return m;
}
......
......@@ -197,34 +197,6 @@ public:
// from continuous to integer data.
NDIndex<Dim> convert_region(const NDRegion<T,Dim>&) const;
#ifdef IPPL_USE_MEMBER_TEMPLATES
//mwerks template < unsigned D >
//mwerks NDRegion<T,Dim> convert_index(const NDIndex<D>&) const;
template < unsigned D >
NDRegion<T,Dim>
convert_index(const NDIndex<D>& ni) const {
NDRegion<T,Dim> new_pregion; // Needed in TAU_TYPE_STRING
PInsist(D==Dim,"Dimension of input NDIndex does not match RegionLayout!!");
return new_pregion;
}
//mwerks template < unsigned D >
//mwerks NDIndex<Dim> convert_region(const NDRegion<T,D>&) const;
template < unsigned D >
NDIndex<Dim>
convert_region(const NDRegion<T,D>& nr) const {
NDIndex<Dim> index;
PInsist(D==Dim,"Dimension of input NDRegion does not match RegionLayout!!");
return index;
}
#endif
// Compare RegionLayouts to see if they represent the same domain.
bool operator==(const RegionLayout<T,Dim,MeshType>& x) {
return Domain == x.Domain;
......
......@@ -598,12 +598,6 @@ RegionLayout<T,Dim,MeshType>::convert_region(const NDRegion<T,Dim>& nr) const {
return index;
}
#ifdef IPPL_USE_MEMBER_TEMPLATES
//mwerks Moved into class definition (.h file).
#endif
//////////////////////////////////////////////////////////////////////
// Scan through the internal FieldLayout and construct Rnodes based on
// the current FieldLayout and PRegion. Put them into out local
......
......@@ -28,19 +28,11 @@ public:
T& operator[](unsigned d) { return Ptr[d]; }
const T& operator[](unsigned d) const { return Ptr[d]; }
Message& putMessage(Message &m) {
#ifdef IPPL_USE_MEMBER_TEMPLATES
m.put(Ptr, Ptr + Length);
#else
putMessage(m,Ptr,Ptr+Length);
#endif
return m;
}
Message& getMessage(Message &m) {
#ifdef IPPL_USE_MEMBER_TEMPLATES
m.get_iter(Ptr);
#else
getMessage_iter(m,Ptr);
#endif
return m;
}
......
......@@ -82,192 +82,70 @@ int main(int argc, char *argv[])
// test Vektor Field operations
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = V2 + V1;
#else
V3 << V2 + V1;
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = V2 - V1;
#else
V3 << V2 - V1;
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = F1 * V1;
#else
V3 << F1 * V1;
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = V1 * F1;
#else
V3 << V1 * F1;
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
F3 = dot(V1,V2);
#else
F3 << dot(V1,V2);
#endif
testmsg << " F3 " << endl << F3 << endl;
// test Tenzor Field operations
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = T2 + T1;
#else
T3 << T2 + T1;
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = T2 - T1;
#else
T3 << T2 - T1;
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = dot(T1,T2);
#else
T3 << dot(T1,T2);
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
F3 = dotdot(T1,T2);
#else
F3 << dotdot(T1,T2);
#endif
testmsg << " F3 " << endl << F3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = dot(V1,T2);
#else
V3 << dot(V1,T2);
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = dot(T2,V1);
#else
V3 << dot(T2,V1);
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = F1 * T2;
#else
T3 << F1 * T2;
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = T2 * F1;
#else
T3 << T2 * F1;
#endif
testmsg << " T3 " << endl << T3 << endl;
// test SymTenzor Field operations
#ifdef IPPL_USE_MEMBER_TEMPLATES
S3 = S1 + S2;
#else
S3 << S1 + S2;
#endif
testmsg << " S3 " << endl << S3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
S3 = S1 - S2;
#else
S3 << S1 - S2;
#endif
testmsg << " S3 " << endl << S3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
S3 = dot(S1,S2);
#else
S3 << dot(S1,S2);
#endif
testmsg << " S3 " << endl << S3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
F3 = dotdot(S1,S2);
#else
F3 << dotdot(S1,S2);
#endif
testmsg << " F3 " << endl << F3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = dot(V1,S2);
#else
V3 << dot(V1,S2);
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
V3 = dot(S2,V1);
#else
V3 << dot(S2,V1);
#endif
testmsg << " V3 " << endl << V3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = T1 + S2;
#else
T3 << T1 + S2;
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = T1 - S2;
#else
T3 << T1 - S2;
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = dot(T1,S2);
#else
T3 << dot(T1,S2);
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
F3 = dotdot(T1,S2);
#else
F3 << dotdot(T1,S2);
#endif
testmsg << " F3 " << endl << F3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = S1 + T2;
#else
T3 << S1 + T2;
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = S2 - T1;
#else
T3 << S2 - T1;
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
T3 = dot(S1,T2);
#else
T3 << dot(S1,T2);
#endif
testmsg << " T3 " << endl << T3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
F3 = dotdot(S1,T2);
#else
F3 << dotdot(S1,T2);
#endif
testmsg << " F3 " << endl << F3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
S3 = F1 * S2;
#else
S3 << F1 * S2;
#endif
testmsg << " S3 " << endl << S3 << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
S3 = S2 * F1;
#else
S3 << S2 * F1;
#endif
testmsg << " S3 " << endl << S3 << endl;
return 0;
}
/***************************************************************************
* $RCSfile: FVecOps.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $
* IPPL_VERSION_ID: $Id: FVecOps.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $
***************************************************************************/
......@@ -68,21 +68,9 @@ int main(int argc, char *argv[] )
A[I] = I;
amin = 5.0;
C = amin;
#ifdef IPPL_USE_MEMBER_TEMPLATES
B = lt( A, amin ) ;
A = where( B, C, A ) ;
A = where( lt(A,amin), A, C ) ;
#else
assign(B , lt( A, amin ));
assign(A , where( B, C, A ));
assign(A , where( lt(A,amin), A, C ) );
#endif
return 0;
}
/***************************************************************************
* $RCSfile: bool.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $
* IPPL_VERSION_ID: $Id: bool.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $
***************************************************************************/
......@@ -39,13 +39,8 @@ int main(int argc, char *argv[])
Field<int,Dim> A1(layout1);
Field<int,Dim> A2(layout1);
#ifdef IPPL_USE_MEMBER_TEMPLATES
A1[I][J] = I + 10*J;
A2[I][J] = J + 10*I;
#else
assign(A1[I][J], I + 10*J);
assign(A2[I][J], J + 10*I);
#endif
#ifdef PRINT_DETAILS
out << "My portion of Field A1 = " << A1 << endl;
......
......@@ -47,19 +47,11 @@ int main(int argc, char *argv[])
testmsg << A << endl;
testmsg << B << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
A[I][J] = B[I-1][J+1] + B[I+1][J-1] ;
#else
assign( A[I][J] , B[I-1][J+1] + B[I+1][J-1] );
#endif
testmsg << A << endl;
B.fillGuardCells();
#ifdef IPPL_USE_MEMBER_TEMPLATES
A[I][J] = B[I-1][J+1] + B[I+1][J-1];
#else
assign( A[I][J] , B[I-1][J+1] + B[I+1][J-1] );
#endif
testmsg << A << endl;
return 0;
......
......@@ -44,26 +44,12 @@ int main(int argc, char *argv[])
int i;
A = -1.0 ;
for (p=B.begin(), i=0; p!=B.end(); ++p, ++i) *p = i+1;
#ifdef IPPL_USE_MEMBER_TEMPLATES
B= B*2.0;
#else
assign( B , B*2.0 );
#endif
B = B*2.0;
testmsg << A << endl;
testmsg << B << endl;
#ifdef IPPL_USE_MEMBER_TEMPLATES
A[I][J] = (B[I+1][J+1]+B[I+1][J-1]+B[I-1][J+1]+B[I-1][J-1])/8.0;
#else
assign(A[I][J] , (B[I+1][J+1]+B[I+1][J-1]+B[I-1][J+1]+B[I-1][J-1])/8.0);
#endif
testmsg << A << endl;
return 0;
}
/***************************************************************************
* $RCSfile: t3.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $
* IPPL_VERSION_ID: $Id: t3.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $
***************************************************************************/
......@@ -39,18 +39,8 @@ int main(int argc, char *argv[])
FieldLayout<Dim> layout(domain);
Field<double,Dim> A(layout);
#ifdef IPPL_USE_MEMBER_TEMPLATES
A[I][J]= (I-2.5)*(I-1.5) + (J-1.5)*(J-2.5) ;
#else
assign( A[I][J] , (I-2.5)*(I-1.5) + (J-1.5)*(J-2.5) );
#endif
testmsg << A << endl;
return 0;
}
/***************************************************************************
* $RCSfile: t4.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $
* IPPL_VERSION_ID: $Id: t4.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $
***************************************************************************/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment