libMesh
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Attributes | Private Attributes | List of all members
NodeTest Class Reference
Inheritance diagram for NodeTest:
[legend]

Public Member Functions

 NodeTest ()
 
 CPPUNIT_TEST_SUITE (NodeTest)
 
POINTTEST DOFOBJECTTEST CPPUNIT_TEST_SUITE_END ()
 
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 testClassifiers ()
 
void testIsZero ()
 
void testSolidAngle ()
 
void testCircumcenter ()
 
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 ()
 
void testReplaceAlgebraicType ()
 
void setUp (Node *derived_instance)
 
void testSetId ()
 
void testValidId ()
 
void testInvalidateId ()
 
void testSetProcId ()
 
void testValidProcId ()
 
void testInvalidateProcId ()
 
void testSetNSystems ()
 
void testSetNVariableGroups ()
 
void testAddExtraData ()
 
void testAddSystemExtraInts ()
 
void testSetNSystemsExtraInts ()
 
void testSetNVariableGroupsExtraInts ()
 
void testManualDofCalculation ()
 
void testJensEftangBug ()
 

Protected Types

typedef DerivedClass::value_type T
 

Protected Attributes

std::string libmesh_suite_name
 
std::string libmesh_suite_name
 

Private Attributes

std::unique_ptr< Nodedof_object_instance
 
std::unique_ptr< DerivedClass > m_1_1_1
 
std::unique_ptr< DerivedClass > m_n1_1_n1
 
TypeVector< T > * basem_1_1_1
 
TypeVector< T > * basem_n1_1_n1
 
Nodeinstance
 

Detailed Description

Definition at line 10 of file node_test.C.

Member Typedef Documentation

◆ T

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

Definition at line 67 of file type_vector_test.h.

Constructor & Destructor Documentation

◆ NodeTest()

NodeTest::NodeTest ( )
inline

Member Function Documentation

◆ CPPUNIT_TEST_SUITE()

NodeTest::CPPUNIT_TEST_SUITE ( NodeTest  )

◆ CPPUNIT_TEST_SUITE_END()

POINTTEST DOFOBJECTTEST NodeTest::CPPUNIT_TEST_SUITE_END ( )

◆ setUp() [1/2]

virtual void NodeTest::setUp ( )
inlinevirtual

Reimplemented from PointTestBase< Node >.

Definition at line 31 of file node_test.C.

32 {
34
35 dof_object_instance = std::make_unique<Node>(1,1,1);
37 }
void setUp(DerivedClass *derived_instance)
std::unique_ptr< Node > dof_object_instance
Definition node_test.C:27
virtual void setUp()
Definition point_test.h:13

References dof_object_instance, PointTestBase< DerivedClass >::setUp(), and DofObjectTest< DerivedClass >::setUp().

◆ setUp() [2/2]

void DofObjectTest< Node >::setUp ( Node derived_instance)
inlineinherited

Definition at line 34 of file dof_object_test.h.

35 {
36 instance=derived_instance;
37 }

◆ tearDown()

virtual void NodeTest::tearDown ( )
inlinevirtual

Reimplemented from PointTestBase< Node >.

Definition at line 39 of file node_test.C.

40 {
42 }
virtual void tearDown()
Definition point_test.h:18

References PointTestBase< DerivedClass >::tearDown().

◆ testAddExtraData()

void DofObjectTest< Node >::testAddExtraData ( )
inlineinherited

Definition at line 147 of file dof_object_test.h.

148 {
149 LOG_UNIT_TEST;
150
151 DofObject & aobject(*instance);
152
153 aobject.add_extra_integers (9);
154
155 CPPUNIT_ASSERT(aobject.has_extra_integers());
156
157 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(9), aobject.n_extra_integers());
158
159 unsigned int ints_per_Real = (sizeof(Real)-1)/sizeof(dof_id_type) + 1;
160
161 for (unsigned int i=0; i != 9; ++i)
162 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
163
164 for (unsigned int i=0; i != 9; ++i)
165 {
166 // Try out a char at i=1
167 if (i == 1)
168 aobject.set_extra_datum<char>(i, '1');
169 // Try out an extra Real at i=2 if we'll have room
170 if (i == 2 && ints_per_Real <= 4)
171 aobject.set_extra_datum<Real>(i, pi);
172 if (i < 1 || i >= (2 + ints_per_Real))
173 {
174 aobject.set_extra_integer(i, i);
175 CPPUNIT_ASSERT_EQUAL( static_cast<dof_id_type>(i), aobject.get_extra_integer(i) );
176 }
177 }
178
179 aobject.add_extra_integers (6);
180
181 CPPUNIT_ASSERT(aobject.has_extra_integers());
182
183 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(6), aobject.n_extra_integers());
184
185 for (unsigned int i=0; i != 6; ++i)
186 {
187 if (i == 1)
188 CPPUNIT_ASSERT_EQUAL(aobject.get_extra_datum<char>(i), '1');
189 if (i == 2 && ints_per_Real <= 4)
190 CPPUNIT_ASSERT_EQUAL(aobject.get_extra_datum<Real>(i), pi);
191 if (i < 1 || i >= (2 + ints_per_Real))
192 CPPUNIT_ASSERT_EQUAL( static_cast<dof_id_type>(i), aobject.get_extra_integer(i) );
193 }
194 }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition dof_object.h:55
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition dof_object.h:473
const Real pi
.
Definition libmesh.h:292
uint8_t dof_id_type
Definition id_types.h:67
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testAddSystemExtraInts()

void DofObjectTest< Node >::testAddSystemExtraInts ( )
inlineinherited

Definition at line 196 of file dof_object_test.h.

197 {
198 LOG_UNIT_TEST;
199
200 DofObject & aobject(*instance);
201
202 aobject.add_extra_integers (1);
203
204 aobject.add_system();
205
206 CPPUNIT_ASSERT(aobject.has_extra_integers());
207
208 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), aobject.n_extra_integers());
209 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), aobject.n_systems());
210 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), aobject.n_vars(0));
211
212 aobject.add_extra_integers (4);
213
214 aobject.add_system();
215
216 CPPUNIT_ASSERT(aobject.has_extra_integers());
217
218 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4), aobject.n_extra_integers());
219 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), aobject.n_systems());
220 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), aobject.n_vars(0));
221 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), aobject.n_vars(1));
222
223 for (unsigned int i=0; i != 4; ++i)
224 {
225 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
226 aobject.set_extra_integer(i, i);
227 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
228 }
229
230 aobject.add_extra_integers (7);
231
232 for (unsigned int i=0; i != 4; ++i)
233 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
234
235 for (unsigned int i=4; i != 7; ++i)
236 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
237
238 aobject.add_system();
239
240 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(7), aobject.n_extra_integers());
241
242 for (unsigned int i=0; i != 4; ++i)
243 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
244
245 for (unsigned int i=4; i != 7; ++i)
246 {
247 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
248 aobject.set_extra_integer(i, i);
249 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
250 }
251
252 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), aobject.n_systems());
253 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), aobject.n_vars(0));
254 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), aobject.n_vars(1));
255 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), aobject.n_vars(2));
256
257 for (unsigned int i=0; i != 7; ++i)
258 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
259 }

◆ testAssignment()

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

Definition at line 167 of file type_vector_test.h.

168 {
169 LOG_UNIT_TEST;
170
171 DerivedClass avector {*basem_1_1_1};
172
173 for (int i = 0; i != LIBMESH_DIM; ++i)
174 CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
175 }
DerivedClass::value_type T
TypeVector< T > * basem_1_1_1

References TypeVectorTestBase< DerivedClass >::basem_1_1_1.

◆ testAssignmentBase()

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

Definition at line 486 of file type_vector_test.h.

487 {
488 LOG_UNIT_TEST;
489
490 TypeVector<T> avector = (*basem_1_1_1);
491
492 for (int i = 0; i != LIBMESH_DIM; ++i)
493 CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
494 }
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition type_vector.h:63

◆ testCircumcenter()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testCircumcenter ( )
inlineinherited

Definition at line 429 of file type_vector_test.h.

430 {
431 LOG_UNIT_TEST;
432
433 const DerivedClass origin(0), e_x(1);
434 DerivedClass twoone(2); twoone(1) = 1;
435
436 auto cc1 = circumcenter(origin, e_x, twoone);
437 LIBMESH_ASSERT_COMPLEX_EQUAL(cc1(0), 0.5, TOLERANCE*TOLERANCE);
438 LIBMESH_ASSERT_COMPLEX_EQUAL(cc1(1), 1.5, TOLERANCE*TOLERANCE);
439
440#if LIBMESH_DIM > 2
441 LIBMESH_ASSERT_COMPLEX_EQUAL(cc1(2), 0, TOLERANCE*TOLERANCE);
442 const DerivedClass twozeroone(2,0,1);
443 auto cc2 = circumcenter(origin, e_x, twozeroone);
444 LIBMESH_ASSERT_COMPLEX_EQUAL(cc2(0), 0.5, TOLERANCE*TOLERANCE);
445 LIBMESH_ASSERT_COMPLEX_EQUAL(cc2(1), 0, TOLERANCE*TOLERANCE);
446 LIBMESH_ASSERT_COMPLEX_EQUAL(cc2(2), 1.5, TOLERANCE*TOLERANCE);
447 auto cc3 = circumcenter(e_x, twoone, twozeroone);
448 LIBMESH_ASSERT_COMPLEX_EQUAL(cc3(0), Real(5)/3, TOLERANCE*TOLERANCE);
449 LIBMESH_ASSERT_COMPLEX_EQUAL(cc3(1), Real(1)/3, TOLERANCE*TOLERANCE);
450 LIBMESH_ASSERT_COMPLEX_EQUAL(cc3(2), Real(1)/3, TOLERANCE*TOLERANCE);
451#endif
452 }
static constexpr Real TOLERANCE
TypeVector< T > circumcenter(const TypeVector< T > &p0, const TypeVector< T > &p1, const TypeVector< T > &p2)

References libMesh::circumcenter(), libMesh::Real, and libMesh::TOLERANCE.

◆ testClassifiers()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testClassifiers ( )
inlineinherited

Definition at line 326 of file type_vector_test.h.

327 {
328 LOG_UNIT_TEST;
329
330 {
331#if LIBMESH_DIM > 2
332 DerivedClass avector(0,0,0);
333#elif LIBMESH_DIM > 1
334 DerivedClass avector(0,0);
335#else
336 DerivedClass avector(0);
337#endif
338 CPPUNIT_ASSERT(isfinite(avector));
339 CPPUNIT_ASSERT(!isinf(avector));
340 CPPUNIT_ASSERT(!isnan(avector));
341
342 // numeric_limits isn't specialized for complex, but float
343 // values promote seamlessly to complex<double> etc.
344 avector(0) =
345 std::numeric_limits<float>::infinity();
346 CPPUNIT_ASSERT(!isfinite(avector));
347 CPPUNIT_ASSERT(isinf(avector));
348 CPPUNIT_ASSERT(!isnan(avector));
349
350 avector(0) =
351 std::numeric_limits<float>::quiet_NaN();
352 CPPUNIT_ASSERT(!isfinite(avector));
353 CPPUNIT_ASSERT(!isinf(avector));
354 CPPUNIT_ASSERT(isnan(avector));
355 }
356 }
bool isfinite(std::complex< T > a)
bool isnan(std::complex< T > a)
bool isinf(std::complex< T > a)

References libMesh::isfinite(), libMesh::isinf(), and libMesh::isnan().

◆ testEquality()

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

Definition at line 147 of file type_vector_test.h.

148 {
149 LOG_UNIT_TEST;
150
151 CPPUNIT_ASSERT( (*m_1_1_1) == (*m_1_1_1) );
152#if LIBMESH_DIM > 1
153 CPPUNIT_ASSERT( !((*m_1_1_1) == (*m_n1_1_n1)) );
154#endif
155 }
std::unique_ptr< DerivedClass > m_1_1_1
std::unique_ptr< DerivedClass > m_n1_1_n1

References TypeVectorTestBase< DerivedClass >::m_1_1_1, and TypeVectorTestBase< DerivedClass >::m_n1_1_n1.

◆ testEqualityBase()

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

Definition at line 468 of file type_vector_test.h.

469 {
470 LOG_UNIT_TEST;
471
472 CPPUNIT_ASSERT( (*basem_1_1_1) == (*basem_1_1_1) );
473 CPPUNIT_ASSERT( !((*basem_1_1_1) == (*basem_n1_1_n1)) );
474 CPPUNIT_ASSERT( relative_fuzzy_equals(*basem_1_1_1, *basem_1_1_1) );
475 }
TypeVector< T > * basem_n1_1_n1
bool relative_fuzzy_equals(const T &var1, const T2 &var2, const Real tol=TOLERANCE *TOLERANCE)
Function to check whether two variables are equal within a relative tolerance.

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, TypeVectorTestBase< DerivedClass >::basem_n1_1_n1, and libMesh::relative_fuzzy_equals().

◆ testInEquality()

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

Definition at line 157 of file type_vector_test.h.

158 {
159 LOG_UNIT_TEST;
160
161 CPPUNIT_ASSERT( !((*m_1_1_1) != (*m_1_1_1)) );
162#if LIBMESH_DIM > 1
163 CPPUNIT_ASSERT( (*m_1_1_1) != (*m_n1_1_n1) );
164#endif
165 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, and TypeVectorTestBase< DerivedClass >::m_n1_1_n1.

◆ testInEqualityBase()

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

Definition at line 477 of file type_vector_test.h.

478 {
479 LOG_UNIT_TEST;
480
481 CPPUNIT_ASSERT( !((*basem_1_1_1) != (*basem_1_1_1)) );
482 CPPUNIT_ASSERT( (*basem_1_1_1) != (*basem_n1_1_n1) );
483 CPPUNIT_ASSERT( !relative_fuzzy_equals(*basem_1_1_1, *basem_n1_1_n1) );
484 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, TypeVectorTestBase< DerivedClass >::basem_n1_1_n1, and libMesh::relative_fuzzy_equals().

◆ testInvalidateId()

void DofObjectTest< Node >::testInvalidateId ( )
inlineinherited

Definition at line 62 of file dof_object_test.h.

63 {
64 LOG_UNIT_TEST;
65
66 DofObject & aobject(*instance);
67
68 aobject.set_id(1);
69 aobject.invalidate_id();
70
71 CPPUNIT_ASSERT( !aobject.valid_id() );
72 }

◆ testInvalidateProcId()

void DofObjectTest< Node >::testInvalidateProcId ( )
inlineinherited

Definition at line 97 of file dof_object_test.h.

98 {
99 LOG_UNIT_TEST;
100
101 DofObject & aobject(*instance);
102
103 aobject.processor_id(libMesh::global_processor_id());
104 aobject.invalidate_processor_id();
105
106 CPPUNIT_ASSERT( !aobject.valid_processor_id() );
107 }
processor_id_type global_processor_id()

◆ testIsZero()

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

Definition at line 359 of file type_vector_test.h.

360 {
361 LOG_UNIT_TEST;
362
363 {
364#if LIBMESH_DIM > 2
365 DerivedClass avector(0,0,0);
366#elif LIBMESH_DIM > 1
367 DerivedClass avector(0,0);
368#else
369 DerivedClass avector(0);
370#endif
371 CPPUNIT_ASSERT(avector.is_zero());
372 }
373 {
374#if LIBMESH_DIM > 2
375 DerivedClass avector(1,1,1);
376#elif LIBMESH_DIM > 1
377 DerivedClass avector(1,1);
378#else
379 DerivedClass avector(1);
380#endif
381 CPPUNIT_ASSERT(!avector.is_zero());
382 }
383 }

◆ testJensEftangBug()

void DofObjectTest< Node >::testJensEftangBug ( )
inlineinherited

Definition at line 397 of file dof_object_test.h.

398 {
399 LOG_UNIT_TEST;
400
401 // For more information on this bug, see the following email thread:
402 // https://sourceforge.net/p/libmesh/mailman/libmesh-users/thread/50C8EE7C.8090405@gmail.com/
403 DofObject & aobject(*instance);
404 dof_id_type buf0[] = {2, 8, 257, 0, 257, 96, 257, 192, 257, 0};
405 aobject.set_buffer(std::vector<dof_id_type>(buf0, buf0+10));
406
407 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,0,0), static_cast<dof_id_type>( 0));
408 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,1,0), static_cast<dof_id_type>( 96));
409 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,2,0), static_cast<dof_id_type>(192));
410 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(1,0,0), static_cast<dof_id_type>( 0));
411
412 dof_id_type buf1[] = {2, 8, 257, 1, 257, 97, 257, 193, 257, 1};
413 aobject.set_buffer(std::vector<dof_id_type>(buf1, buf1+10));
414
415 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,0,0), static_cast<dof_id_type>( 1));
416 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,1,0), static_cast<dof_id_type>( 97));
417 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,2,0), static_cast<dof_id_type>(193));
418 CPPUNIT_ASSERT_EQUAL (aobject.dof_number(1,0,0), static_cast<dof_id_type>( 1));
419 }

◆ testManualDofCalculation()

void DofObjectTest< Node >::testManualDofCalculation ( )
inlineinherited

Definition at line 353 of file dof_object_test.h.

354 {
355 LOG_UNIT_TEST;
356
357 DofObject & aobject(*instance);
358
359 aobject.set_n_systems (2);
360
361 std::vector<unsigned int> nvpg;
362
363 nvpg.push_back(2);
364 nvpg.push_back(3);
365
366 aobject.set_n_vars_per_group (0, nvpg);
367 aobject.set_n_vars_per_group (1, nvpg);
368
369 aobject.set_n_comp_group (0, 0, 1);
370 aobject.set_n_comp_group (0, 1, 3);
371
372 aobject.set_n_comp_group (1, 0, 2);
373 aobject.set_n_comp_group (1, 1, 1);
374
375 aobject.set_vg_dof_base(0, 0, 0);
376 aobject.set_vg_dof_base(0, 1, 120);
377
378 aobject.set_vg_dof_base(1, 0, 20);
379 aobject.set_vg_dof_base(1, 1, 220);
380
381 // Make sure the first dof is sane
382 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(0), aobject.dof_number(0, 0, 0));
383
384 // Check that we can manually index dofs of variables based on the first dof in a variable group
385 // Using: id = base + var_in_vg*ncomp + comp
386 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(aobject.vg_dof_base(0, 0) + 1*1 + 0), aobject.dof_number(0, 1, 0));
387
388 // Another Check that we can manually index dofs of variables based on the first dof in a variable group
389 // Using: id = base + var_in_vg*ncomp + comp
390 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(aobject.vg_dof_base(0, 1) + 2*3 + 2), aobject.dof_number(0, 4, 2));
391
392 // One More Check that we can manually index dofs of variables based on the first dof in a variable group
393 // Using: id = base + var_in_vg*ncomp + comp
394 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(aobject.vg_dof_base(1, 1) + 0*3 + 0), aobject.dof_number(1, 2, 0));
395 }

◆ testNorm()

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

Definition at line 133 of file type_vector_test.h.

134 {
135 LOG_UNIT_TEST;
136
137 LIBMESH_ASSERT_FP_EQUAL(m_1_1_1->norm() , std::sqrt(Real(LIBMESH_DIM)) , TOLERANCE*TOLERANCE );
138 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testNormBase()

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

Definition at line 454 of file type_vector_test.h.

455 {
456 LOG_UNIT_TEST;
457
458 LIBMESH_ASSERT_FP_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , basem_1_1_1->norm() , TOLERANCE*TOLERANCE );
459 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testNormSq()

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

Definition at line 140 of file type_vector_test.h.

141 {
142 LOG_UNIT_TEST;
143
144 LIBMESH_ASSERT_FP_EQUAL(m_1_1_1->norm_sq() , Real(LIBMESH_DIM) , TOLERANCE*TOLERANCE );
145 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testNormSqBase()

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

Definition at line 461 of file type_vector_test.h.

462 {
463 LOG_UNIT_TEST;
464
465 LIBMESH_ASSERT_FP_EQUAL( Real(LIBMESH_DIM) , basem_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
466 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testReplaceAlgebraicType()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testReplaceAlgebraicType ( )
inlineinherited

Definition at line 602 of file type_vector_test.h.

603 {
604#ifdef LIBMESH_HAVE_METAPHYSICL
605 typedef typename MetaPhysicL::ReplaceAlgebraicType<
606 std::vector<TypeVector<double>>,
608 typename MetaPhysicL::ValueType<std::vector<TypeVector<double>>>::type>::type>::type
609 ReplacedType;
610 constexpr bool assertion =
611 std::is_same<ReplacedType, std::vector<TensorValue<double>>>::value;
612 CPPUNIT_ASSERT(assertion);
613#endif
614 }
static const bool value
Definition xdr_io.C:55

References value.

◆ testScalarDiv()

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

Definition at line 203 of file type_vector_test.h.

204 {
205 LOG_UNIT_TEST;
206
207 for (int i = 0; i != LIBMESH_DIM; ++i)
208 LIBMESH_ASSERT_COMPLEX_EQUAL( 1/Real(5) , ((*m_1_1_1)/5.0)(i) , TOLERANCE*TOLERANCE );
209 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testScalarDivAssign()

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

Definition at line 222 of file type_vector_test.h.

223 {
224 LOG_UNIT_TEST;
225
226 DerivedClass avector {*basem_1_1_1};
227 avector/=5.0;
228
229 for (int i = 0; i != LIBMESH_DIM; ++i)
230 LIBMESH_ASSERT_COMPLEX_EQUAL( 1/Real(5) , avector(i) , TOLERANCE*TOLERANCE );
231 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testScalarDivAssignBase()

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

Definition at line 523 of file type_vector_test.h.

524 {
525 LOG_UNIT_TEST;
526
527 TypeVector<T> avector(*m_1_1_1);
528 avector/=5.0;
529
530 for (int i = 0; i != LIBMESH_DIM; ++i)
531 LIBMESH_ASSERT_COMPLEX_EQUAL( 1/Real(5) , avector(i) , TOLERANCE*TOLERANCE );
532 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testScalarDivBase()

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

Definition at line 504 of file type_vector_test.h.

505 {
506 LOG_UNIT_TEST;
507
508 for (int i = 0; i != LIBMESH_DIM; ++i)
509 LIBMESH_ASSERT_COMPLEX_EQUAL( 1/Real(5) , ((*basem_1_1_1)/5.0)(i) , TOLERANCE*TOLERANCE );
510 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, libMesh::Real, and libMesh::TOLERANCE.

◆ testScalarInit()

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

Definition at line 177 of file type_vector_test.h.

178 {
179 LOG_UNIT_TEST;
180
181 DerivedClass avector = 0;
182 for (int i = 0; i != LIBMESH_DIM; ++i)
183 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , avector(i) , TOLERANCE*TOLERANCE );
184
185 DerivedClass bvector = 2.0;
186 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , bvector(0) , TOLERANCE*TOLERANCE );
187 for (int i = 1; i != LIBMESH_DIM; ++i)
188 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , bvector(i) , TOLERANCE*TOLERANCE );
189 }

References libMesh::TOLERANCE.

◆ testScalarMult()

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

Definition at line 191 of file type_vector_test.h.

192 {
193 LOG_UNIT_TEST;
194
195 for (int i = 0; i != LIBMESH_DIM; ++i)
196 {
197 LIBMESH_ASSERT_COMPLEX_EQUAL( 5.0 , ((*m_1_1_1)*5.0)(i) , TOLERANCE*TOLERANCE );
198 LIBMESH_ASSERT_COMPLEX_EQUAL( 5.0 , outer_product(*m_1_1_1,5.0)(i) , TOLERANCE*TOLERANCE );
199 LIBMESH_ASSERT_COMPLEX_EQUAL( 5.0 , outer_product(5.0,*m_1_1_1)(i) , TOLERANCE*TOLERANCE );
200 }
201 }
TypeTensor< typename CompareTypes< T, T2 >::supertype > outer_product(const TypeVector< T > &a, const TypeVector< T2 > &b)

References TypeVectorTestBase< DerivedClass >::m_1_1_1, libMesh::outer_product(), and libMesh::TOLERANCE.

◆ testScalarMultAssign()

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

Definition at line 211 of file type_vector_test.h.

212 {
213 LOG_UNIT_TEST;
214
215 DerivedClass avector {*basem_1_1_1};
216 avector*=5.0;
217
218 for (int i = 0; i != LIBMESH_DIM; ++i)
219 LIBMESH_ASSERT_COMPLEX_EQUAL( 5.0 , avector(i) , TOLERANCE*TOLERANCE );
220 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, and libMesh::TOLERANCE.

◆ testScalarMultAssignBase()

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

Definition at line 512 of file type_vector_test.h.

513 {
514 LOG_UNIT_TEST;
515
516 TypeVector<T> avector(*m_1_1_1);
517 avector*=5.0;
518
519 for (int i = 0; i != LIBMESH_DIM; ++i)
520 LIBMESH_ASSERT_COMPLEX_EQUAL( 5.0 , avector(i) , TOLERANCE*TOLERANCE );
521 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, and libMesh::TOLERANCE.

◆ testScalarMultBase()

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

Definition at line 496 of file type_vector_test.h.

497 {
498 LOG_UNIT_TEST;
499
500 for (int i = 0; i != LIBMESH_DIM; ++i)
501 LIBMESH_ASSERT_COMPLEX_EQUAL( 5.0 , ((*basem_1_1_1)*5.0)(i) , TOLERANCE*TOLERANCE );
502 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, and libMesh::TOLERANCE.

◆ testSetId()

void DofObjectTest< Node >::testSetId ( )
inlineinherited

Definition at line 39 of file dof_object_test.h.

40 {
41 LOG_UNIT_TEST;
42
43 DofObject & aobject(*instance);
44
45 aobject.set_id(1);
46 CPPUNIT_ASSERT_EQUAL( static_cast<dof_id_type>(1) , aobject.id() );
47 }

◆ testSetNSystems()

void DofObjectTest< Node >::testSetNSystems ( )
inlineinherited

Definition at line 109 of file dof_object_test.h.

110 {
111 LOG_UNIT_TEST;
112
113 DofObject & aobject(*instance);
114
115 aobject.set_n_systems (10);
116
117 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(10), aobject.n_systems());
118 }

◆ testSetNSystemsExtraInts()

void DofObjectTest< Node >::testSetNSystemsExtraInts ( )
inlineinherited

Definition at line 261 of file dof_object_test.h.

262 {
263 LOG_UNIT_TEST;
264
265 DofObject & aobject(*instance);
266
267 aobject.add_extra_integers (5);
268
269 aobject.set_n_systems (10);
270
271 CPPUNIT_ASSERT(aobject.has_extra_integers());
272
273 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(5), aobject.n_extra_integers());
274 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(10), aobject.n_systems());
275
276 for (unsigned int i=0; i != 5; ++i)
277 {
278 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
279 aobject.set_extra_integer(i, i);
280 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
281 }
282
283 aobject.add_extra_integers (9);
284
285 for (unsigned int i=0; i != 5; ++i)
286 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
287
288 for (unsigned int i=5; i != 9; ++i)
289 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
290
291 aobject.set_n_systems (6);
292
293 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(9), aobject.n_extra_integers());
294
295 for (unsigned int i=0; i != 5; ++i)
296 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
297
298 for (unsigned int i=5; i != 9; ++i)
299 {
300 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
301 aobject.set_extra_integer(i, i);
302 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
303 }
304
305 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(6), aobject.n_systems());
306
307 for (unsigned int i=0; i != 9; ++i)
308 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
309 }

◆ testSetNVariableGroups()

void DofObjectTest< Node >::testSetNVariableGroups ( )
inlineinherited

Definition at line 120 of file dof_object_test.h.

121 {
122 LOG_UNIT_TEST;
123
124 DofObject & aobject(*instance);
125
126 aobject.set_n_systems (2);
127
128 std::vector<unsigned int> nvpg;
129
130 nvpg.push_back(10);
131 nvpg.push_back(20);
132 nvpg.push_back(30);
133
134 aobject.set_n_vars_per_group (0, nvpg);
135 aobject.set_n_vars_per_group (1, nvpg);
136
137 for (unsigned int s=0; s<2; s++)
138 {
139 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(60), aobject.n_vars(s));
140 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), aobject.n_var_groups(s));
141
142 for (unsigned int vg=0; vg<3; vg++)
143 CPPUNIT_ASSERT_EQUAL( nvpg[vg], aobject.n_vars(s,vg) );
144 }
145 }

◆ testSetNVariableGroupsExtraInts()

void DofObjectTest< Node >::testSetNVariableGroupsExtraInts ( )
inlineinherited

Definition at line 311 of file dof_object_test.h.

312 {
313 LOG_UNIT_TEST;
314
315 DofObject & aobject(*instance);
316
317 aobject.set_n_systems (2);
318
319 aobject.add_extra_integers (5);
320
321 for (unsigned int i=0; i != 5; ++i)
322 {
323 CPPUNIT_ASSERT_EQUAL( DofObject::invalid_id, aobject.get_extra_integer(i) );
324 aobject.set_extra_integer(i, i);
325 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
326 }
327
328 std::vector<unsigned int> nvpg;
329
330 nvpg.push_back(10);
331 nvpg.push_back(20);
332 nvpg.push_back(30);
333
334 aobject.set_n_vars_per_group (0, nvpg);
335 aobject.set_n_vars_per_group (1, nvpg);
336
337 for (unsigned int s=0; s<2; s++)
338 {
339 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(60), aobject.n_vars(s));
340 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), aobject.n_var_groups(s));
341
342 for (unsigned int vg=0; vg<3; vg++)
343 CPPUNIT_ASSERT_EQUAL( nvpg[vg], aobject.n_vars(s,vg) );
344 }
345
346 CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(5), aobject.n_extra_integers());
347
348 for (unsigned int i=0; i != 5; ++i)
349 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(i), aobject.get_extra_integer(i));
350 }

◆ testSetProcId()

void DofObjectTest< Node >::testSetProcId ( )
inlineinherited

Definition at line 74 of file dof_object_test.h.

75 {
76 LOG_UNIT_TEST;
77
78 DofObject & aobject(*instance);
79
80 aobject.processor_id(libMesh::global_processor_id());
81 CPPUNIT_ASSERT_EQUAL(static_cast<processor_id_type>(libMesh::global_processor_id()), aobject.processor_id());
82 }
uint8_t processor_id_type
Definition id_types.h:104

◆ testSolidAngle()

template<class DerivedClass >
void TypeVectorTestBase< DerivedClass >::testSolidAngle ( )
inlineinherited

Definition at line 385 of file type_vector_test.h.

386 {
387 LOG_UNIT_TEST;
388
389 const DerivedClass xvec(1.3);
390 LIBMESH_ASSERT_COMPLEX_EQUAL( solid_angle(xvec, xvec, xvec), 0, TOLERANCE*TOLERANCE );
391
392#if LIBMESH_DIM > 1
393 // This is ambiguous with --enable-complex builds? We really need
394 // to make the vector-from-scalar constructor explicit.
395 // const DerivedClass yvec(0.,2.7),
396 // xydiag(3.1,3.1),
397 // xypdiag(.8,-.8);
398
399 DerivedClass yvec, xydiag, xypdiag;
400 yvec(1) = 2.7;
401 xydiag(0) = 3.1; xydiag(1) = 3.1;
402 xypdiag(0) = 0.8; xypdiag(1) = -.8;
403
404 // Yeah, nothing subtends a non-zero solid angle in 2D either.
405 LIBMESH_ASSERT_COMPLEX_EQUAL( solid_angle(xvec, xvec, yvec), 0, TOLERANCE*TOLERANCE );
406 LIBMESH_ASSERT_COMPLEX_EQUAL( solid_angle(xvec, yvec, xydiag), 0, TOLERANCE*TOLERANCE );
407#endif
408
409#if LIBMESH_DIM > 2
410 const DerivedClass zvec(0.,0.,1.1),
411 xzdiag(0.,.7,.7);
412 LIBMESH_ASSERT_COMPLEX_EQUAL(solid_angle(xydiag, yvec, zvec),
414 LIBMESH_ASSERT_COMPLEX_EQUAL(solid_angle(xvec, yvec, xzdiag),
416 LIBMESH_ASSERT_COMPLEX_EQUAL(solid_angle(xypdiag, xydiag, zvec),
418
419 // Icosahedron coordinates are a nice analytic test
420 const Real golden = (1 + std::sqrt(Real(5)))/2;
421 const DerivedClass icosa1(1., golden, 0.),
422 icosa2(-1., golden, 0.),
423 icosa3(0., 1., golden);
424 LIBMESH_ASSERT_COMPLEX_EQUAL(solid_angle(icosa1, icosa2, icosa3),
426#endif
427 }
T solid_angle(const TypeVector< T > &v01, const TypeVector< T > &v02, const TypeVector< T > &v03)

References libMesh::pi, libMesh::Real, libMesh::solid_angle(), and libMesh::TOLERANCE.

◆ testValidId()

void DofObjectTest< Node >::testValidId ( )
inlineinherited

Definition at line 49 of file dof_object_test.h.

50 {
51 LOG_UNIT_TEST;
52
53 DofObject & aobject(*instance);
54
55 aobject.set_id(1);
56 CPPUNIT_ASSERT( aobject.valid_id() );
57
58 aobject.set_id(DofObject::invalid_id);
59 CPPUNIT_ASSERT( !aobject.valid_id() );
60 }

◆ testValidProcId()

void DofObjectTest< Node >::testValidProcId ( )
inlineinherited

Definition at line 84 of file dof_object_test.h.

85 {
86 LOG_UNIT_TEST;
87
88 DofObject & aobject(*instance);
89
90 aobject.processor_id(libMesh::global_processor_id());
91 CPPUNIT_ASSERT(aobject.valid_processor_id());
92
93 aobject.processor_id(DofObject::invalid_processor_id);
94 CPPUNIT_ASSERT(!aobject.valid_processor_id());
95 }
static constexpr processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition dof_object.h:484

◆ testValue()

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

Definition at line 98 of file type_vector_test.h.

99 {
100 LOG_UNIT_TEST;
101
102 CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(0));
103 CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(0));
104
105#if LIBMESH_DIM > 1
106 CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(1));
107 CPPUNIT_ASSERT_EQUAL( T(1) , (*m_n1_1_n1)(1));
108#endif
109
110#if LIBMESH_DIM > 2
111 CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(2));
112 CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(2));
113#endif
114 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, and TypeVectorTestBase< DerivedClass >::m_n1_1_n1.

◆ testValueBase()

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

Definition at line 301 of file type_vector_test.h.

302 {
303 LOG_UNIT_TEST;
304
305 for (int i = 0; i != LIBMESH_DIM; ++i)
306 CPPUNIT_ASSERT_EQUAL( T(1), (*basem_1_1_1)(i));
307
308 CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(0));
309 if (LIBMESH_DIM > 1)
310 CPPUNIT_ASSERT_EQUAL( T(1 ), (*basem_n1_1_n1)(1));
311 if (LIBMESH_DIM > 2)
312 CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(2));
313 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, and TypeVectorTestBase< DerivedClass >::basem_n1_1_n1.

◆ testVectorAdd()

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

Definition at line 233 of file type_vector_test.h.

234 {
235 LOG_UNIT_TEST;
236
237 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , ((*m_1_1_1)+(*m_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
238 if (LIBMESH_DIM > 1)
239 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , ((*m_1_1_1)+(*m_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
240 if (LIBMESH_DIM > 2)
241 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , ((*m_1_1_1)+(*m_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
242 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, TypeVectorTestBase< DerivedClass >::m_n1_1_n1, and libMesh::TOLERANCE.

◆ testVectorAddAssign()

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

Definition at line 276 of file type_vector_test.h.

277 {
278 LOG_UNIT_TEST;
279
280 DerivedClass avector {*basem_1_1_1};
281 avector+=(*m_1_1_1);
282
283 for (int i = 0; i != LIBMESH_DIM; ++i)
284 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , avector(i) , TOLERANCE*TOLERANCE );
285 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, and libMesh::TOLERANCE.

◆ testVectorAddAssignBase()

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

Definition at line 577 of file type_vector_test.h.

578 {
579 LOG_UNIT_TEST;
580
581 TypeVector<T> avector(*m_1_1_1);
582 avector+=(*basem_1_1_1);
583
584 for (int i = 0; i != LIBMESH_DIM; ++i)
585 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , avector(i) , TOLERANCE*TOLERANCE );
586 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, and libMesh::TOLERANCE.

◆ testVectorAddBase()

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

Definition at line 534 of file type_vector_test.h.

535 {
536 LOG_UNIT_TEST;
537
538 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
539 if (LIBMESH_DIM > 1)
540 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
541 if (LIBMESH_DIM > 2)
542 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
543 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, TypeVectorTestBase< DerivedClass >::basem_n1_1_n1, and libMesh::TOLERANCE.

◆ testVectorAddScaled()

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

Definition at line 244 of file type_vector_test.h.

245 {
246 LOG_UNIT_TEST;
247
248 DerivedClass avector {*basem_1_1_1};
249 avector.add_scaled((*m_1_1_1),0.5);
250
251 for (int i = 0; i != LIBMESH_DIM; ++i)
252 LIBMESH_ASSERT_COMPLEX_EQUAL( 1.5 , avector(i) , TOLERANCE*TOLERANCE );
253 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, TypeVectorTestBase< DerivedClass >::m_1_1_1, and libMesh::TOLERANCE.

◆ testVectorAddScaledBase()

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

Definition at line 545 of file type_vector_test.h.

546 {
547 LOG_UNIT_TEST;
548
549 TypeVector<T> avector(*m_1_1_1);
550 avector.add_scaled((*basem_1_1_1),0.5);
551
552 for (int i = 0; i != LIBMESH_DIM; ++i)
553 LIBMESH_ASSERT_COMPLEX_EQUAL( 1.5 , avector(i) , TOLERANCE*TOLERANCE );
554 }

References libMesh::TypeVector< T >::add_scaled(), TypeVectorTestBase< DerivedClass >::basem_1_1_1, TypeVectorTestBase< DerivedClass >::m_1_1_1, and libMesh::TOLERANCE.

◆ testVectorMult()

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

Definition at line 266 of file type_vector_test.h.

267 {
268 LOG_UNIT_TEST;
269
270 if (LIBMESH_DIM == 2)
271 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , (*m_1_1_1)*(*m_n1_1_n1) , TOLERANCE*TOLERANCE );
272 else
273 LIBMESH_ASSERT_COMPLEX_EQUAL( -1.0 , (*m_1_1_1)*(*m_n1_1_n1) , TOLERANCE*TOLERANCE );
274 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, TypeVectorTestBase< DerivedClass >::m_n1_1_n1, and libMesh::TOLERANCE.

◆ testVectorMultBase()

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

Definition at line 567 of file type_vector_test.h.

568 {
569 LOG_UNIT_TEST;
570
571 if (LIBMESH_DIM == 2)
572 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , (*basem_1_1_1)*(*basem_n1_1_n1) , TOLERANCE*TOLERANCE );
573 else
574 LIBMESH_ASSERT_COMPLEX_EQUAL( -1.0 , (*basem_1_1_1)*(*basem_n1_1_n1) , TOLERANCE*TOLERANCE );
575 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, TypeVectorTestBase< DerivedClass >::basem_n1_1_n1, and libMesh::TOLERANCE.

◆ testVectorSub()

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

Definition at line 255 of file type_vector_test.h.

256 {
257 LOG_UNIT_TEST;
258
259 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , ((*m_1_1_1)-(*m_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
260 if (LIBMESH_DIM > 1)
261 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , ((*m_1_1_1)-(*m_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
262 if (LIBMESH_DIM > 2)
263 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , ((*m_1_1_1)-(*m_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
264 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, TypeVectorTestBase< DerivedClass >::m_n1_1_n1, and libMesh::TOLERANCE.

◆ testVectorSubAssign()

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

Definition at line 287 of file type_vector_test.h.

288 {
289 LOG_UNIT_TEST;
290
291 DerivedClass avector {*basem_1_1_1};
292 avector-=(*m_n1_1_n1);
293
294 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , avector(0) , TOLERANCE*TOLERANCE );
295 if (LIBMESH_DIM > 1)
296 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , avector(1) , TOLERANCE*TOLERANCE );
297 if (LIBMESH_DIM > 2)
298 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , avector(2) , TOLERANCE*TOLERANCE );
299 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, and libMesh::TOLERANCE.

◆ testVectorSubAssignBase()

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

Definition at line 588 of file type_vector_test.h.

589 {
590 LOG_UNIT_TEST;
591
592 TypeVector<T> avector(*m_1_1_1);
593 avector-=(*basem_n1_1_n1);
594
595 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , avector(0) , TOLERANCE*TOLERANCE );
596 if (LIBMESH_DIM > 1)
597 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , avector(1) , TOLERANCE*TOLERANCE );
598 if (LIBMESH_DIM > 2)
599 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , avector(2) , TOLERANCE*TOLERANCE );
600 }

References TypeVectorTestBase< DerivedClass >::m_1_1_1, and libMesh::TOLERANCE.

◆ testVectorSubBase()

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

Definition at line 556 of file type_vector_test.h.

557 {
558 LOG_UNIT_TEST;
559
560 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
561 if (LIBMESH_DIM > 1)
562 LIBMESH_ASSERT_COMPLEX_EQUAL( 0.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
563 if (LIBMESH_DIM > 2)
564 LIBMESH_ASSERT_COMPLEX_EQUAL( 2.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
565 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, TypeVectorTestBase< DerivedClass >::basem_n1_1_n1, and libMesh::TOLERANCE.

◆ testZero()

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

Definition at line 116 of file type_vector_test.h.

117 {
118 LOG_UNIT_TEST;
119
120#if LIBMESH_DIM > 2
121 DerivedClass avector(1,1,1);
122#elif LIBMESH_DIM > 1
123 DerivedClass avector(1,1);
124#else
125 DerivedClass avector(1);
126#endif
127 avector.zero();
128
129 for (int i = 0; i != LIBMESH_DIM; ++i)
130 CPPUNIT_ASSERT_EQUAL( T(0), avector(i));
131 }

◆ testZeroBase()

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

Definition at line 315 of file type_vector_test.h.

316 {
317 LOG_UNIT_TEST;
318
319 TypeVector<T> avector((*basem_1_1_1));
320 avector.zero();
321
322 for (int i = 0; i != LIBMESH_DIM; ++i)
323 CPPUNIT_ASSERT_EQUAL( T(0), avector(i));
324 }

References TypeVectorTestBase< DerivedClass >::basem_1_1_1, and libMesh::TypeVector< T >::zero().

Member Data Documentation

◆ basem_1_1_1

template<class DerivedClass >
TypeVector<T>* TypeVectorTestBase< DerivedClass >::basem_1_1_1
privateinherited

◆ basem_n1_1_n1

template<class DerivedClass >
TypeVector<T> * TypeVectorTestBase< DerivedClass >::basem_n1_1_n1
privateinherited

◆ dof_object_instance

std::unique_ptr<Node> NodeTest::dof_object_instance
private

Definition at line 27 of file node_test.C.

Referenced by setUp().

◆ instance

Node * DofObjectTest< Node >::instance
privateinherited

Definition at line 28 of file dof_object_test.h.

◆ libmesh_suite_name [1/2]

std::string DofObjectTest< Node >::libmesh_suite_name
protectedinherited

Definition at line 31 of file dof_object_test.h.

◆ libmesh_suite_name [2/2]

template<class DerivedClass >
std::string TypeVectorTestBase< DerivedClass >::libmesh_suite_name
protectedinherited

Definition at line 69 of file type_vector_test.h.

Referenced by PointTest::PointTest().

◆ m_1_1_1

template<class DerivedClass >
std::unique_ptr<DerivedClass> TypeVectorTestBase< DerivedClass >::m_1_1_1
privateinherited

◆ m_n1_1_n1

template<class DerivedClass >
std::unique_ptr<DerivedClass> TypeVectorTestBase< DerivedClass >::m_n1_1_n1
privateinherited

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