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 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 60 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 149 of file type_vector_test.h.

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

◆ testAssignmentBase()

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

Definition at line 298 of file type_vector_test.h.

299  {
300  TypeVector<T> avector = (*m_1_1_1);
301 
302  for (int i = 0; i != LIBMESH_DIM; ++i)
303  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
304  }
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 133 of file type_vector_test.h.

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

◆ testEqualityBase()

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

Definition at line 286 of file type_vector_test.h.

287  {
288  CPPUNIT_ASSERT( (*basem_1_1_1) == (*basem_1_1_1) );
289  CPPUNIT_ASSERT( !((*basem_1_1_1) == (*basem_n1_1_n1)) );
290  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testInEquality()

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

Definition at line 141 of file type_vector_test.h.

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

◆ testInEqualityBase()

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

Definition at line 292 of file type_vector_test.h.

293  {
294  CPPUNIT_ASSERT( !((*basem_1_1_1) != (*basem_1_1_1)) );
295  CPPUNIT_ASSERT( (*basem_1_1_1) != (*basem_n1_1_n1) );
296  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testNorm()

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

Definition at line 123 of file type_vector_test.h.

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

124  {
125  CPPUNIT_ASSERT_DOUBLES_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , m_1_1_1->norm() , TOLERANCE*TOLERANCE );
126  }
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 276 of file type_vector_test.h.

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

277  {
278  CPPUNIT_ASSERT_DOUBLES_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , basem_1_1_1->norm() , TOLERANCE*TOLERANCE );
279  }
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 128 of file type_vector_test.h.

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

129  {
130  CPPUNIT_ASSERT_DOUBLES_EQUAL( Real(LIBMESH_DIM) , m_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
131  }
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 281 of file type_vector_test.h.

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

282  {
283  CPPUNIT_ASSERT_DOUBLES_EQUAL( Real(LIBMESH_DIM) , basem_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
284  }
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 175 of file type_vector_test.h.

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

176  {
177  for (int i = 0; i != LIBMESH_DIM; ++i)
178  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*m_1_1_1)/5.0)(i)) , TOLERANCE*TOLERANCE );
179  }
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 190 of file type_vector_test.h.

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

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

◆ testScalarDivAssignBase()

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

Definition at line 327 of file type_vector_test.h.

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

328  {
329  TypeVector<T> avector(*m_1_1_1);
330  avector/=5.0;
331 
332  for (int i = 0; i != LIBMESH_DIM; ++i)
333  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
334  }
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 312 of file type_vector_test.h.

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

313  {
314  for (int i = 0; i != LIBMESH_DIM; ++i)
315  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*basem_1_1_1)/5.0)(i)) , TOLERANCE*TOLERANCE );
316  }
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 157 of file type_vector_test.h.

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

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

◆ testScalarMult()

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

Definition at line 169 of file type_vector_test.h.

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

170  {
171  for (int i = 0; i != LIBMESH_DIM; ++i)
172  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*m_1_1_1)*5.0)(i)) , TOLERANCE*TOLERANCE );
173  }
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 181 of file type_vector_test.h.

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

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

◆ testScalarMultAssignBase()

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

Definition at line 318 of file type_vector_test.h.

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

319  {
320  TypeVector<T> avector(*m_1_1_1);
321  avector*=5.0;
322 
323  for (int i = 0; i != LIBMESH_DIM; ++i)
324  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
325  }
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 306 of file type_vector_test.h.

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

307  {
308  for (int i = 0; i != LIBMESH_DIM; ++i)
309  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*basem_1_1_1)*5.0)(i)) , TOLERANCE*TOLERANCE );
310  }
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 92 of file type_vector_test.h.

93  {
94  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(0));
95  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(0));
96 
97 #if LIBMESH_DIM > 1
98  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(1));
99  CPPUNIT_ASSERT_EQUAL( T(1) , (*m_n1_1_n1)(1));
100 #endif
101 
102 #if LIBMESH_DIM > 2
103  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(2));
104  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(2));
105 #endif
106  }
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 255 of file type_vector_test.h.

256  {
257  for (int i = 0; i != LIBMESH_DIM; ++i)
258  CPPUNIT_ASSERT_EQUAL( T(1), (*basem_1_1_1)(i));
259 
260  CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(0));
261  if (LIBMESH_DIM > 1)
262  CPPUNIT_ASSERT_EQUAL( T(1 ), (*basem_n1_1_n1)(1));
263  if (LIBMESH_DIM > 2)
264  CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(2));
265  }
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 199 of file type_vector_test.h.

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

200  {
201  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
202  if (LIBMESH_DIM > 1)
203  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
204  if (LIBMESH_DIM > 2)
205  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
206  }
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 234 of file type_vector_test.h.

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

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

◆ testVectorAddAssignBase()

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

Definition at line 371 of file type_vector_test.h.

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

372  {
373  TypeVector<T> avector(*m_1_1_1);
374  avector+=(*basem_1_1_1);
375 
376  for (int i = 0; i != LIBMESH_DIM; ++i)
377  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
378  }
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 336 of file type_vector_test.h.

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

337  {
338  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
339  if (LIBMESH_DIM > 1)
340  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
341  if (LIBMESH_DIM > 2)
342  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
343  }
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 208 of file type_vector_test.h.

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

209  {
210  DerivedClass avector = (*m_1_1_1);
211  avector.add_scaled((*m_1_1_1),0.5);
212 
213  for (int i = 0; i != LIBMESH_DIM; ++i)
214  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
215  }
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 345 of file type_vector_test.h.

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

346  {
347  TypeVector<T> avector(*m_1_1_1);
348  avector.add_scaled((*basem_1_1_1),0.5);
349 
350  for (int i = 0; i != LIBMESH_DIM; ++i)
351  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
352  }
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 226 of file type_vector_test.h.

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

227  {
228  if (LIBMESH_DIM == 2)
229  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real((*m_1_1_1)*(*m_n1_1_n1)) , TOLERANCE*TOLERANCE );
230  else
231  CPPUNIT_ASSERT_DOUBLES_EQUAL( -1.0 , libmesh_real((*m_1_1_1)*(*m_n1_1_n1)) , TOLERANCE*TOLERANCE );
232  }
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 363 of file type_vector_test.h.

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

364  {
365  if (LIBMESH_DIM == 2)
366  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real((*basem_1_1_1)*(*basem_n1_1_n1)) , TOLERANCE*TOLERANCE );
367  else
368  CPPUNIT_ASSERT_DOUBLES_EQUAL( -1.0 , libmesh_real((*basem_1_1_1)*(*basem_n1_1_n1)) , TOLERANCE*TOLERANCE );
369  }
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 217 of file type_vector_test.h.

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

218  {
219  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
220  if (LIBMESH_DIM > 1)
221  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
222  if (LIBMESH_DIM > 2)
223  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
224  }
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 243 of file type_vector_test.h.

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

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

◆ testVectorSubAssignBase()

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

Definition at line 380 of file type_vector_test.h.

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

381  {
382  TypeVector<T> avector(*m_1_1_1);
383  avector-=(*basem_n1_1_n1);
384 
385  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
386  if (LIBMESH_DIM > 1)
387  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
388  if (LIBMESH_DIM > 2)
389  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
390  }
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 354 of file type_vector_test.h.

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

355  {
356  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
357  if (LIBMESH_DIM > 1)
358  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
359  if (LIBMESH_DIM > 2)
360  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
361  }
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 108 of file type_vector_test.h.

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

◆ testZeroBase()

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

Definition at line 267 of file type_vector_test.h.

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

268  {
269  TypeVector<T> avector((*basem_1_1_1));
270  avector.zero();
271 
272  for (int i = 0; i != LIBMESH_DIM; ++i)
273  CPPUNIT_ASSERT_EQUAL( T(0), avector(i));
274  }
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: