libMesh
Public Member Functions | Protected Types | List of all members
PointTestBase< DerivedClass > Class Template Reference

#include <point_test.h>

Inheritance diagram for PointTestBase< DerivedClass >:
[legend]

Public Member Functions

virtual void setUp ()
 
virtual void tearDown ()
 
void testValue ()
 
void testZero ()
 
void testNorm ()
 
void testNormSq ()
 
void testEquality ()
 
void testInEquality ()
 
void testAssignment ()
 
void testScalarInit ()
 
void testScalarMult ()
 
void testScalarDiv ()
 
void testScalarMultAssign ()
 
void testScalarDivAssign ()
 
void testVectorAdd ()
 
void testVectorAddScaled ()
 
void testVectorSub ()
 
void testVectorMult ()
 
void testVectorAddAssign ()
 
void testVectorSubAssign ()
 
void testValueBase ()
 
void testZeroBase ()
 
void testIsZero ()
 
void testNormBase ()
 
void testNormSqBase ()
 
void testEqualityBase ()
 
void testInEqualityBase ()
 
void testAssignmentBase ()
 
void testScalarMultBase ()
 
void testScalarDivBase ()
 
void testScalarMultAssignBase ()
 
void testScalarDivAssignBase ()
 
void testVectorAddBase ()
 
void testVectorAddScaledBase ()
 
void testVectorSubBase ()
 
void testVectorMultBase ()
 
void testVectorAddAssignBase ()
 
void testVectorSubAssignBase ()
 

Protected Types

typedef DerivedClass::value_type T
 

Detailed Description

template<class DerivedClass>
class PointTestBase< DerivedClass >

Definition at line 13 of file point_test.h.

Member Typedef Documentation

◆ T

template<class DerivedClass >
typedef DerivedClass::value_type TypeVectorTestBase< DerivedClass >::T
protectedinherited

Definition at line 62 of file type_vector_test.h.

Member Function Documentation

◆ setUp()

template<class DerivedClass >
virtual void PointTestBase< DerivedClass >::setUp ( )
virtual

Reimplemented from TypeVectorTestBase< DerivedClass >.

Definition at line 15 of file point_test.h.

References TypeVectorTestBase< DerivedClass >::setUp().

◆ tearDown()

template<class DerivedClass >
virtual void PointTestBase< DerivedClass >::tearDown ( )
virtual

◆ testAssignment()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testAssignment ( )
inherited

Definition at line 151 of file type_vector_test.h.

152  {
153  DerivedClass avector = (*m_1_1_1);
154 
155  for (int i = 0; i != LIBMESH_DIM; ++i)
156  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
157  }
DerivedClass::value_type T

◆ testAssignmentBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testAssignmentBase ( )
inherited

Definition at line 324 of file type_vector_test.h.

325  {
326  TypeVector<T> avector = (*m_1_1_1);
327 
328  for (int i = 0; i != LIBMESH_DIM; ++i)
329  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
330  }
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:45
DerivedClass::value_type T

◆ testEquality()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testEquality ( )
inherited

Definition at line 135 of file type_vector_test.h.

136  {
137  CPPUNIT_ASSERT( (*m_1_1_1) == (*m_1_1_1) );
138 #if LIBMESH_DIM > 1
139  CPPUNIT_ASSERT( !((*m_1_1_1) == (*m_n1_1_n1)) );
140 #endif
141  }
DerivedClass * m_1_1_1
DerivedClass * m_n1_1_n1

◆ testEqualityBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testEqualityBase ( )
inherited

Definition at line 312 of file type_vector_test.h.

313  {
314  CPPUNIT_ASSERT( (*basem_1_1_1) == (*basem_1_1_1) );
315  CPPUNIT_ASSERT( !((*basem_1_1_1) == (*basem_n1_1_n1)) );
316  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testInEquality()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testInEquality ( )
inherited

Definition at line 143 of file type_vector_test.h.

144  {
145  CPPUNIT_ASSERT( !((*m_1_1_1) != (*m_1_1_1)) );
146 #if LIBMESH_DIM > 1
147  CPPUNIT_ASSERT( (*m_1_1_1) != (*m_n1_1_n1) );
148 #endif
149  }
DerivedClass * m_1_1_1
DerivedClass * m_n1_1_n1

◆ testInEqualityBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testInEqualityBase ( )
inherited

Definition at line 318 of file type_vector_test.h.

319  {
320  CPPUNIT_ASSERT( !((*basem_1_1_1) != (*basem_1_1_1)) );
321  CPPUNIT_ASSERT( (*basem_1_1_1) != (*basem_n1_1_n1) );
322  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testIsZero()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testIsZero ( )
inherited

Definition at line 278 of file type_vector_test.h.

279  {
280  {
281 #if LIBMESH_DIM > 2
282  DerivedClass avector(0,0,0);
283 #elif LIBMESH_DIM > 1
284  DerivedClass avector(0,0);
285 #else
286  DerivedClass avector(0);
287 #endif
288  CPPUNIT_ASSERT(avector.is_zero());
289  }
290  {
291 #if LIBMESH_DIM > 2
292  DerivedClass avector(1,1,1);
293 #elif LIBMESH_DIM > 1
294  DerivedClass avector(1,1);
295 #else
296  DerivedClass avector(1);
297 #endif
298  CPPUNIT_ASSERT(!avector.is_zero());
299  }
300  }

◆ testNorm()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testNorm ( )
inherited

Definition at line 125 of file type_vector_test.h.

References libMesh::Real, std::sqrt(), and libMesh::TOLERANCE.

126  {
127  CPPUNIT_ASSERT_DOUBLES_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , m_1_1_1->norm() , TOLERANCE*TOLERANCE );
128  }
MetaPhysicL::DualNumber< T, D > sqrt(const MetaPhysicL::DualNumber< T, D > &in)
static const Real TOLERANCE
DerivedClass * m_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testNormBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testNormBase ( )
inherited

Definition at line 302 of file type_vector_test.h.

References libMesh::TypeVector< T >::norm(), libMesh::Real, std::sqrt(), and libMesh::TOLERANCE.

303  {
304  CPPUNIT_ASSERT_DOUBLES_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , basem_1_1_1->norm() , TOLERANCE*TOLERANCE );
305  }
MetaPhysicL::DualNumber< T, D > sqrt(const MetaPhysicL::DualNumber< T, D > &in)
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testNormSq()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testNormSq ( )
inherited

Definition at line 130 of file type_vector_test.h.

References libMesh::Real, and libMesh::TOLERANCE.

131  {
132  CPPUNIT_ASSERT_DOUBLES_EQUAL( Real(LIBMESH_DIM) , m_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
133  }
static const Real TOLERANCE
DerivedClass * m_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testNormSqBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testNormSqBase ( )
inherited

Definition at line 307 of file type_vector_test.h.

References libMesh::TypeVector< T >::norm_sq(), libMesh::Real, and libMesh::TOLERANCE.

308  {
309  CPPUNIT_ASSERT_DOUBLES_EQUAL( Real(LIBMESH_DIM) , basem_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
310  }
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testScalarDiv()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarDiv ( )
inherited

Definition at line 177 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

178  {
179  for (int i = 0; i != LIBMESH_DIM; ++i)
180  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*m_1_1_1)/5.0)(i)) , TOLERANCE*TOLERANCE );
181  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1

◆ testScalarDivAssign()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarDivAssign ( )
inherited

Definition at line 192 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

193  {
194  DerivedClass avector = (*m_1_1_1);
195  avector/=5.0;
196 
197  for (int i = 0; i != LIBMESH_DIM; ++i)
198  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
199  }
T libmesh_real(T a)
static const Real TOLERANCE

◆ testScalarDivAssignBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarDivAssignBase ( )
inherited

Definition at line 353 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

354  {
355  TypeVector<T> avector(*m_1_1_1);
356  avector/=5.0;
357 
358  for (int i = 0; i != LIBMESH_DIM; ++i)
359  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
360  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:45

◆ testScalarDivBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarDivBase ( )
inherited

Definition at line 338 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

339  {
340  for (int i = 0; i != LIBMESH_DIM; ++i)
341  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*basem_1_1_1)/5.0)(i)) , TOLERANCE*TOLERANCE );
342  }
T libmesh_real(T a)
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE

◆ testScalarInit()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarInit ( )
inherited

Definition at line 159 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

160  {
161  DerivedClass avector = 0;
162  for (int i = 0; i != LIBMESH_DIM; ++i)
163  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
164 
165  DerivedClass bvector = 2.0;
166  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(bvector(0)) , TOLERANCE*TOLERANCE );
167  for (int i = 1; i != LIBMESH_DIM; ++i)
168  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(bvector(i)) , TOLERANCE*TOLERANCE );
169  }
T libmesh_real(T a)
static const Real TOLERANCE

◆ testScalarMult()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarMult ( )
inherited

Definition at line 171 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

172  {
173  for (int i = 0; i != LIBMESH_DIM; ++i)
174  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*m_1_1_1)*5.0)(i)) , TOLERANCE*TOLERANCE );
175  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1

◆ testScalarMultAssign()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarMultAssign ( )
inherited

Definition at line 183 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

184  {
185  DerivedClass avector = (*m_1_1_1);
186  avector*=5.0;
187 
188  for (int i = 0; i != LIBMESH_DIM; ++i)
189  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
190  }
T libmesh_real(T a)
static const Real TOLERANCE

◆ testScalarMultAssignBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarMultAssignBase ( )
inherited

Definition at line 344 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

345  {
346  TypeVector<T> avector(*m_1_1_1);
347  avector*=5.0;
348 
349  for (int i = 0; i != LIBMESH_DIM; ++i)
350  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
351  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:45

◆ testScalarMultBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testScalarMultBase ( )
inherited

Definition at line 332 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

333  {
334  for (int i = 0; i != LIBMESH_DIM; ++i)
335  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*basem_1_1_1)*5.0)(i)) , TOLERANCE*TOLERANCE );
336  }
T libmesh_real(T a)
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE

◆ testValue()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testValue ( )
inherited

Definition at line 94 of file type_vector_test.h.

95  {
96  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(0));
97  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(0));
98 
99 #if LIBMESH_DIM > 1
100  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(1));
101  CPPUNIT_ASSERT_EQUAL( T(1) , (*m_n1_1_n1)(1));
102 #endif
103 
104 #if LIBMESH_DIM > 2
105  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(2));
106  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(2));
107 #endif
108  }
DerivedClass * m_1_1_1
DerivedClass * m_n1_1_n1
DerivedClass::value_type T

◆ testValueBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testValueBase ( )
inherited

Definition at line 257 of file type_vector_test.h.

258  {
259  for (int i = 0; i != LIBMESH_DIM; ++i)
260  CPPUNIT_ASSERT_EQUAL( T(1), (*basem_1_1_1)(i));
261 
262  CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(0));
263  if (LIBMESH_DIM > 1)
264  CPPUNIT_ASSERT_EQUAL( T(1 ), (*basem_n1_1_n1)(1));
265  if (LIBMESH_DIM > 2)
266  CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(2));
267  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
DerivedClass::value_type T

◆ testVectorAdd()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorAdd ( )
inherited

Definition at line 201 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

202  {
203  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
204  if (LIBMESH_DIM > 1)
205  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
206  if (LIBMESH_DIM > 2)
207  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
208  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1
DerivedClass * m_n1_1_n1

◆ testVectorAddAssign()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorAddAssign ( )
inherited

Definition at line 236 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

237  {
238  DerivedClass avector = (*m_1_1_1);
239  avector+=(*m_1_1_1);
240 
241  for (int i = 0; i != LIBMESH_DIM; ++i)
242  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
243  }
T libmesh_real(T a)
static const Real TOLERANCE

◆ testVectorAddAssignBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorAddAssignBase ( )
inherited

Definition at line 397 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

398  {
399  TypeVector<T> avector(*m_1_1_1);
400  avector+=(*basem_1_1_1);
401 
402  for (int i = 0; i != LIBMESH_DIM; ++i)
403  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
404  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:45

◆ testVectorAddBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorAddBase ( )
inherited

Definition at line 362 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

363  {
364  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
365  if (LIBMESH_DIM > 1)
366  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
367  if (LIBMESH_DIM > 2)
368  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
369  }
T libmesh_real(T a)
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE

◆ testVectorAddScaled()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorAddScaled ( )
inherited

Definition at line 210 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

211  {
212  DerivedClass avector = (*m_1_1_1);
213  avector.add_scaled((*m_1_1_1),0.5);
214 
215  for (int i = 0; i != LIBMESH_DIM; ++i)
216  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
217  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1

◆ testVectorAddScaledBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorAddScaledBase ( )
inherited

Definition at line 371 of file type_vector_test.h.

References libMesh::TypeVector< T >::add_scaled(), libMesh::libmesh_real(), and libMesh::TOLERANCE.

372  {
373  TypeVector<T> avector(*m_1_1_1);
374  avector.add_scaled((*basem_1_1_1),0.5);
375 
376  for (int i = 0; i != LIBMESH_DIM; ++i)
377  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
378  }
T libmesh_real(T a)
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
DerivedClass * m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:45

◆ testVectorMult()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorMult ( )
inherited

Definition at line 228 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

229  {
230  if (LIBMESH_DIM == 2)
231  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real((*m_1_1_1)*(*m_n1_1_n1)) , TOLERANCE*TOLERANCE );
232  else
233  CPPUNIT_ASSERT_DOUBLES_EQUAL( -1.0 , libmesh_real((*m_1_1_1)*(*m_n1_1_n1)) , TOLERANCE*TOLERANCE );
234  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1
DerivedClass * m_n1_1_n1

◆ testVectorMultBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorMultBase ( )
inherited

Definition at line 389 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

390  {
391  if (LIBMESH_DIM == 2)
392  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real((*basem_1_1_1)*(*basem_n1_1_n1)) , TOLERANCE*TOLERANCE );
393  else
394  CPPUNIT_ASSERT_DOUBLES_EQUAL( -1.0 , libmesh_real((*basem_1_1_1)*(*basem_n1_1_n1)) , TOLERANCE*TOLERANCE );
395  }
T libmesh_real(T a)
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE

◆ testVectorSub()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorSub ( )
inherited

Definition at line 219 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

220  {
221  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
222  if (LIBMESH_DIM > 1)
223  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
224  if (LIBMESH_DIM > 2)
225  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
226  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1
DerivedClass * m_n1_1_n1

◆ testVectorSubAssign()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorSubAssign ( )
inherited

Definition at line 245 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

246  {
247  DerivedClass avector = (*m_1_1_1);
248  avector-=(*m_n1_1_n1);
249 
250  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
251  if (LIBMESH_DIM > 1)
252  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
253  if (LIBMESH_DIM > 2)
254  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
255  }
T libmesh_real(T a)
static const Real TOLERANCE

◆ testVectorSubAssignBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorSubAssignBase ( )
inherited

Definition at line 406 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

407  {
408  TypeVector<T> avector(*m_1_1_1);
409  avector-=(*basem_n1_1_n1);
410 
411  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
412  if (LIBMESH_DIM > 1)
413  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
414  if (LIBMESH_DIM > 2)
415  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
416  }
T libmesh_real(T a)
static const Real TOLERANCE
DerivedClass * m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:45

◆ testVectorSubBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testVectorSubBase ( )
inherited

Definition at line 380 of file type_vector_test.h.

References libMesh::libmesh_real(), and libMesh::TOLERANCE.

381  {
382  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
383  if (LIBMESH_DIM > 1)
384  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
385  if (LIBMESH_DIM > 2)
386  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
387  }
T libmesh_real(T a)
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE

◆ testZero()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testZero ( )
inherited

Definition at line 110 of file type_vector_test.h.

111  {
112 #if LIBMESH_DIM > 2
113  DerivedClass avector(1,1,1);
114 #elif LIBMESH_DIM > 1
115  DerivedClass avector(1,1);
116 #else
117  DerivedClass avector(1);
118 #endif
119  avector.zero();
120 
121  for (int i = 0; i != LIBMESH_DIM; ++i)
122  CPPUNIT_ASSERT_EQUAL( T(0), avector(i));
123  }
DerivedClass::value_type T

◆ testZeroBase()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testZeroBase ( )
inherited

Definition at line 269 of file type_vector_test.h.

References libMesh::TypeVector< T >::zero().

270  {
271  TypeVector<T> avector((*basem_1_1_1));
272  avector.zero();
273 
274  for (int i = 0; i != LIBMESH_DIM; ++i)
275  CPPUNIT_ASSERT_EQUAL( T(0), avector(i));
276  }
TypeVector< T > * basem_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:45
DerivedClass::value_type T

The documentation for this class was generated from the following file: