44#include < cudaReduce.cuH>
55
66#include < Component.H>
7- #include " UserSat .H"
7+ #include " UserBar .H"
88
99// Global device symbols for CUDA kernel
1010//
@@ -55,13 +55,13 @@ userBarForceKernel(dArray<cudaParticle> P, dArray<int> I,
5555 cuFP_t pp = (xx*xx - yy*yy)*cos2p + 2.0 *xx*yy*sin2p;
5656
5757 if (userBarSoft) {
58- fac = 1.0 + rr/b5 ;
58+ fac = 1.0 + rr/userBarB5 ;
5959 ffac = -userBarAmp / pow (fac, 6.0 );
60- nn = pp / (b5 *rr);
60+ nn = pp / (userBarB5 *rr);
6161 } else {
62- fac = 1.0 + pow (rr/b5 , 5.0 );
62+ fac = 1.0 + pow (rr/userBarB5 , 5.0 );
6363 ffac = -userBarAmp / (fac*fac);
64- nn = pp * pow (rr/b5 , 3.0 )/ (b5*b5 );
64+ nn = pp * pow (rr/userBarB5 , 3.0 )/ (userBarB5*userBarB5 );
6565 }
6666
6767 // Add acceleration
@@ -80,14 +80,13 @@ userBarForceKernel(dArray<cudaParticle> P, dArray<int> I,
8080
8181
8282__global__
83- void testConstantsUserSat (cuFP_t tnow)
83+ void testConstantsUserBar (cuFP_t tnow)
8484{
8585 printf (" -------------------------\n " );
86- printf (" ---UserSat constants-----\n " );
86+ printf (" ---UserBar constants-----\n " );
8787 printf (" -------------------------\n " );
8888 printf (" Time = %e\n " , tnow );
8989 printf (" Amp = %e\n " , userBarAmp );
90- printf (" Amp = %e\n " , userBarNumFac );
9190 printf (" b5 = %e\n " , userBarB5 );
9291 printf (" Center = %e, %e, %e\n " ,
9392 userBarCen[0 ], userBarCen[1 ], userBarCen[2 ] );
@@ -96,26 +95,17 @@ void testConstantsUserSat(cuFP_t tnow)
9695 printf (" -------------------------\n " );
9796}
9897
99- void UserBar::determine_acceration_and_potential_cuda ()
98+ void UserBar::determine_acceleration_and_potential_cuda ()
10099{
101100 // Sanity check
102101 //
103102 int nbodies = cC->Number ();
104103 if (nbodies != static_cast <int >(cC->Particles ().size ())) {
105- std::cerr << " UserSat : ooops! number=" << nbodies
104+ std::cerr << " UserBar : ooops! number=" << nbodies
106105 << " but particle size=" << cC->Particles ().size () << endl;
107106 nbodies = static_cast <int >(cC->Particles ().size ());
108107 }
109108
110- if (nbodies==0 ) { // Return if there are no particles
111- if (verbose) {
112- cout << " Process " << myid << " : in UserBar, nbodies=0"
113- << " for Component <" << cC->name << " > at T=" << tnow
114- << endl;
115- }
116- return ;
117- }
118-
119109 double amp = afac * numfac * amplitude/fabs (amplitude)
120110 * 0.5 *(1.0 + erf ( (tnow - Ton )/DeltaT ))
121111 * 0.5 *(1.0 - erf ( (tnow - Toff)/DeltaT )) ;
@@ -134,8 +124,6 @@ void UserBar::determine_acceration_and_potential_cuda()
134124 cuFP_t ctr[3 ], dtmp;
135125 for (int k=0 ; k<3 ; k++) ctr[k] = cn[k];
136126
137- cuFP_t dtmp;
138-
139127 cuda_safe_call (cudaMemcpyToSymbol (userBarAmp, &(dtmp=amp), sizeof (cuFP_t),
140128 size_t (0 ), cudaMemcpyHostToDevice),
141129 __FILE__, __LINE__, " Error copying userBarAmp" );
0 commit comments