libMesh
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 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 Node ::value_type T
 

Protected Attributes

std::string libmesh_suite_name
 
std::string libmesh_suite_name
 

Private Attributes

std::unique_ptr< Nodedof_object_instance
 

Detailed Description

Definition at line 10 of file node_test.C.

Member Typedef Documentation

◆ T

typedef Node ::value_type TypeVectorTestBase< Node >::T
protectedinherited

Definition at line 66 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.

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

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

◆ 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.

References PointTestBase< DerivedClass >::tearDown().

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

◆ testAddExtraData()

void DofObjectTest< Node >::testAddExtraData ( )
inlineinherited

Definition at line 147 of file dof_object_test.h.

References libMesh::DofObject::add_extra_integers(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::has_extra_integers(), libMesh::DofObject::invalid_id, libMesh::DofObject::n_extra_integers(), libMesh::pi, libMesh::Real, libMesh::DofObject::set_extra_datum(), and libMesh::DofObject::set_extra_integer().

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  }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54
uint8_t dof_id_type
Definition: id_types.h:67
const Real pi
.
Definition: libmesh.h:292

◆ testAddSystemExtraInts()

void DofObjectTest< Node >::testAddSystemExtraInts ( )
inlineinherited

Definition at line 196 of file dof_object_test.h.

References libMesh::DofObject::add_extra_integers(), libMesh::DofObject::add_system(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::has_extra_integers(), libMesh::DofObject::invalid_id, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::DofObject::set_extra_integer().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testAssignment()

void TypeVectorTestBase< Node >::testAssignment ( )
inlineinherited

Definition at line 166 of file type_vector_test.h.

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

◆ testAssignmentBase()

void TypeVectorTestBase< Node >::testAssignmentBase ( )
inlineinherited

Definition at line 452 of file type_vector_test.h.

453  {
454  LOG_UNIT_TEST;
455 
456  TypeVector<T> avector = (*basem_1_1_1);
457 
458  for (int i = 0; i != LIBMESH_DIM; ++i)
459  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
460  }
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34

◆ testCircumcenter()

void TypeVectorTestBase< Node >::testCircumcenter ( )
inlineinherited

Definition at line 395 of file type_vector_test.h.

396  {
397  LOG_UNIT_TEST;
398 
399  const DerivedClass origin(0), e_x(1);
400  DerivedClass twoone(2); twoone(1) = 1;
401 
402  auto cc1 = circumcenter(origin, e_x, twoone);
403  LIBMESH_ASSERT_NUMBERS_EQUAL(cc1(0), 0.5, TOLERANCE*TOLERANCE);
404  LIBMESH_ASSERT_NUMBERS_EQUAL(cc1(1), 1.5, TOLERANCE*TOLERANCE);
405 
406 #if LIBMESH_DIM > 2
407  LIBMESH_ASSERT_NUMBERS_EQUAL(cc1(2), 0, TOLERANCE*TOLERANCE);
408  const DerivedClass twozeroone(2,0,1);
409  auto cc2 = circumcenter(origin, e_x, twozeroone);
410  LIBMESH_ASSERT_NUMBERS_EQUAL(cc2(0), 0.5, TOLERANCE*TOLERANCE);
411  LIBMESH_ASSERT_NUMBERS_EQUAL(cc2(1), 0, TOLERANCE*TOLERANCE);
412  LIBMESH_ASSERT_NUMBERS_EQUAL(cc2(2), 1.5, TOLERANCE*TOLERANCE);
413  auto cc3 = circumcenter(e_x, twoone, twozeroone);
414  LIBMESH_ASSERT_NUMBERS_EQUAL(cc3(0), Real(5)/3, TOLERANCE*TOLERANCE);
415  LIBMESH_ASSERT_NUMBERS_EQUAL(cc3(1), Real(1)/3, TOLERANCE*TOLERANCE);
416  LIBMESH_ASSERT_NUMBERS_EQUAL(cc3(2), Real(1)/3, TOLERANCE*TOLERANCE);
417 #endif
418  }
static constexpr Real TOLERANCE
TypeVector< T > circumcenter(const TypeVector< T > &p0, const TypeVector< T > &p1, const TypeVector< T > &p2)
Definition: type_vector.h:1080
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testEquality()

void TypeVectorTestBase< Node >::testEquality ( )
inlineinherited

Definition at line 146 of file type_vector_test.h.

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

◆ testEqualityBase()

void TypeVectorTestBase< Node >::testEqualityBase ( )
inlineinherited

Definition at line 434 of file type_vector_test.h.

435  {
436  LOG_UNIT_TEST;
437 
438  CPPUNIT_ASSERT( (*basem_1_1_1) == (*basem_1_1_1) );
439  CPPUNIT_ASSERT( !((*basem_1_1_1) == (*basem_n1_1_n1)) );
440  CPPUNIT_ASSERT( relative_fuzzy_equals(*basem_1_1_1, *basem_1_1_1) );
441  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
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.
Definition: fuzzy_equals.h:78

◆ testInEquality()

void TypeVectorTestBase< Node >::testInEquality ( )
inlineinherited

Definition at line 156 of file type_vector_test.h.

157  {
158  LOG_UNIT_TEST;
159 
160  CPPUNIT_ASSERT( !((*m_1_1_1) != (*m_1_1_1)) );
161 #if LIBMESH_DIM > 1
162  CPPUNIT_ASSERT( (*m_1_1_1) != (*m_n1_1_n1) );
163 #endif
164  }
std::unique_ptr< Node > m_1_1_1
std::unique_ptr< Node > m_n1_1_n1

◆ testInEqualityBase()

void TypeVectorTestBase< Node >::testInEqualityBase ( )
inlineinherited

Definition at line 443 of file type_vector_test.h.

444  {
445  LOG_UNIT_TEST;
446 
447  CPPUNIT_ASSERT( !((*basem_1_1_1) != (*basem_1_1_1)) );
448  CPPUNIT_ASSERT( (*basem_1_1_1) != (*basem_n1_1_n1) );
449  CPPUNIT_ASSERT( !relative_fuzzy_equals(*basem_1_1_1, *basem_n1_1_n1) );
450  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
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.
Definition: fuzzy_equals.h:78

◆ testInvalidateId()

void DofObjectTest< Node >::testInvalidateId ( )
inlineinherited

Definition at line 62 of file dof_object_test.h.

References libMesh::DofObject::invalidate_id(), libMesh::DofObject::set_id(), and libMesh::DofObject::valid_id().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testInvalidateProcId()

void DofObjectTest< Node >::testInvalidateProcId ( )
inlineinherited

Definition at line 97 of file dof_object_test.h.

References libMesh::global_processor_id(), libMesh::DofObject::invalidate_processor_id(), libMesh::DofObject::processor_id(), and libMesh::DofObject::valid_processor_id().

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()
Definition: libmesh_base.h:98
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testIsZero()

void TypeVectorTestBase< Node >::testIsZero ( )
inlineinherited

Definition at line 325 of file type_vector_test.h.

326  {
327  LOG_UNIT_TEST;
328 
329  {
330 #if LIBMESH_DIM > 2
331  DerivedClass avector(0,0,0);
332 #elif LIBMESH_DIM > 1
333  DerivedClass avector(0,0);
334 #else
335  DerivedClass avector(0);
336 #endif
337  CPPUNIT_ASSERT(avector.is_zero());
338  }
339  {
340 #if LIBMESH_DIM > 2
341  DerivedClass avector(1,1,1);
342 #elif LIBMESH_DIM > 1
343  DerivedClass avector(1,1);
344 #else
345  DerivedClass avector(1);
346 #endif
347  CPPUNIT_ASSERT(!avector.is_zero());
348  }
349  }

◆ testJensEftangBug()

void DofObjectTest< Node >::testJensEftangBug ( )
inlineinherited

Definition at line 397 of file dof_object_test.h.

References libMesh::DofObject::dof_number(), and libMesh::DofObject::set_buffer().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54
uint8_t dof_id_type
Definition: id_types.h:67

◆ testManualDofCalculation()

void DofObjectTest< Node >::testManualDofCalculation ( )
inlineinherited

Definition at line 353 of file dof_object_test.h.

References libMesh::DofObject::dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofObject::set_vg_dof_base(), and libMesh::DofObject::vg_dof_base().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testNorm()

void TypeVectorTestBase< Node >::testNorm ( )
inlineinherited

Definition at line 132 of file type_vector_test.h.

133  {
134  LOG_UNIT_TEST;
135 
136  LIBMESH_ASSERT_FP_EQUAL(m_1_1_1->norm() , std::sqrt(Real(LIBMESH_DIM)) , TOLERANCE*TOLERANCE );
137  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testNormBase()

void TypeVectorTestBase< Node >::testNormBase ( )
inlineinherited

Definition at line 420 of file type_vector_test.h.

421  {
422  LOG_UNIT_TEST;
423 
424  LIBMESH_ASSERT_FP_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , basem_1_1_1->norm() , TOLERANCE*TOLERANCE );
425  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testNormSq()

void TypeVectorTestBase< Node >::testNormSq ( )
inlineinherited

Definition at line 139 of file type_vector_test.h.

140  {
141  LOG_UNIT_TEST;
142 
143  LIBMESH_ASSERT_FP_EQUAL(m_1_1_1->norm_sq() , Real(LIBMESH_DIM) , TOLERANCE*TOLERANCE );
144  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testNormSqBase()

void TypeVectorTestBase< Node >::testNormSqBase ( )
inlineinherited

Definition at line 427 of file type_vector_test.h.

428  {
429  LOG_UNIT_TEST;
430 
431  LIBMESH_ASSERT_FP_EQUAL( Real(LIBMESH_DIM) , basem_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
432  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testReplaceAlgebraicType()

void TypeVectorTestBase< Node >::testReplaceAlgebraicType ( )
inlineinherited

Definition at line 568 of file type_vector_test.h.

569  {
570 #ifdef LIBMESH_HAVE_METAPHYSICL
571  typedef typename MetaPhysicL::ReplaceAlgebraicType<
572  std::vector<TypeVector<double>>,
574  typename MetaPhysicL::ValueType<std::vector<TypeVector<double>>>::type>::type>::type
575  ReplacedType;
576  constexpr bool assertion =
577  std::is_same<ReplacedType, std::vector<TensorValue<double>>>::value;
578  CPPUNIT_ASSERT(assertion);
579 #endif
580  }
static const bool value
Definition: xdr_io.C:55

◆ testScalarDiv()

void TypeVectorTestBase< Node >::testScalarDiv ( )
inlineinherited

Definition at line 202 of file type_vector_test.h.

203  {
204  LOG_UNIT_TEST;
205 
206  for (int i = 0; i != LIBMESH_DIM; ++i)
207  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , ((*m_1_1_1)/5.0)(i) , TOLERANCE*TOLERANCE );
208  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testScalarDivAssign()

void TypeVectorTestBase< Node >::testScalarDivAssign ( )
inlineinherited

Definition at line 221 of file type_vector_test.h.

222  {
223  LOG_UNIT_TEST;
224 
225  DerivedClass avector {*basem_1_1_1};
226  avector/=5.0;
227 
228  for (int i = 0; i != LIBMESH_DIM; ++i)
229  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , avector(i) , TOLERANCE*TOLERANCE );
230  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testScalarDivAssignBase()

void TypeVectorTestBase< Node >::testScalarDivAssignBase ( )
inlineinherited

Definition at line 489 of file type_vector_test.h.

490  {
491  LOG_UNIT_TEST;
492 
493  TypeVector<T> avector(*m_1_1_1);
494  avector/=5.0;
495 
496  for (int i = 0; i != LIBMESH_DIM; ++i)
497  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , avector(i) , TOLERANCE*TOLERANCE );
498  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testScalarDivBase()

void TypeVectorTestBase< Node >::testScalarDivBase ( )
inlineinherited

Definition at line 470 of file type_vector_test.h.

471  {
472  LOG_UNIT_TEST;
473 
474  for (int i = 0; i != LIBMESH_DIM; ++i)
475  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , ((*basem_1_1_1)/5.0)(i) , TOLERANCE*TOLERANCE );
476  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testScalarInit()

void TypeVectorTestBase< Node >::testScalarInit ( )
inlineinherited

Definition at line 176 of file type_vector_test.h.

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

◆ testScalarMult()

void TypeVectorTestBase< Node >::testScalarMult ( )
inlineinherited

Definition at line 190 of file type_vector_test.h.

191  {
192  LOG_UNIT_TEST;
193 
194  for (int i = 0; i != LIBMESH_DIM; ++i)
195  {
196  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , ((*m_1_1_1)*5.0)(i) , TOLERANCE*TOLERANCE );
197  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , outer_product(*m_1_1_1,5.0)(i) , TOLERANCE*TOLERANCE );
198  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , outer_product(5.0,*m_1_1_1)(i) , TOLERANCE*TOLERANCE );
199  }
200  }
TypeTensor< typename CompareTypes< T, T2 >::supertype > outer_product(const TypeVector< T > &a, const TypeVector< T2 > &b)
Definition: type_tensor.h:1441
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1

◆ testScalarMultAssign()

void TypeVectorTestBase< Node >::testScalarMultAssign ( )
inlineinherited

Definition at line 210 of file type_vector_test.h.

211  {
212  LOG_UNIT_TEST;
213 
214  DerivedClass avector {*basem_1_1_1};
215  avector*=5.0;
216 
217  for (int i = 0; i != LIBMESH_DIM; ++i)
218  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , avector(i) , TOLERANCE*TOLERANCE );
219  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1

◆ testScalarMultAssignBase()

void TypeVectorTestBase< Node >::testScalarMultAssignBase ( )
inlineinherited

Definition at line 478 of file type_vector_test.h.

479  {
480  LOG_UNIT_TEST;
481 
482  TypeVector<T> avector(*m_1_1_1);
483  avector*=5.0;
484 
485  for (int i = 0; i != LIBMESH_DIM; ++i)
486  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , avector(i) , TOLERANCE*TOLERANCE );
487  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34

◆ testScalarMultBase()

void TypeVectorTestBase< Node >::testScalarMultBase ( )
inlineinherited

Definition at line 462 of file type_vector_test.h.

463  {
464  LOG_UNIT_TEST;
465 
466  for (int i = 0; i != LIBMESH_DIM; ++i)
467  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , ((*basem_1_1_1)*5.0)(i) , TOLERANCE*TOLERANCE );
468  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1

◆ testSetId()

void DofObjectTest< Node >::testSetId ( )
inlineinherited

Definition at line 39 of file dof_object_test.h.

References libMesh::DofObject::id(), and libMesh::DofObject::set_id().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testSetNSystems()

void DofObjectTest< Node >::testSetNSystems ( )
inlineinherited

Definition at line 109 of file dof_object_test.h.

References libMesh::DofObject::n_systems(), and libMesh::DofObject::set_n_systems().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testSetNSystemsExtraInts()

void DofObjectTest< Node >::testSetNSystemsExtraInts ( )
inlineinherited

Definition at line 261 of file dof_object_test.h.

References libMesh::DofObject::add_extra_integers(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::has_extra_integers(), libMesh::DofObject::invalid_id, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::set_extra_integer(), and libMesh::DofObject::set_n_systems().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testSetNVariableGroups()

void DofObjectTest< Node >::testSetNVariableGroups ( )
inlineinherited

Definition at line 120 of file dof_object_test.h.

References libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofObject::set_n_systems(), and libMesh::DofObject::set_n_vars_per_group().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testSetNVariableGroupsExtraInts()

void DofObjectTest< Node >::testSetNVariableGroupsExtraInts ( )
inlineinherited

Definition at line 311 of file dof_object_test.h.

References libMesh::DofObject::add_extra_integers(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::invalid_id, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), and libMesh::DofObject::set_n_vars_per_group().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testSetProcId()

void DofObjectTest< Node >::testSetProcId ( )
inlineinherited

Definition at line 74 of file dof_object_test.h.

References libMesh::global_processor_id(), and libMesh::DofObject::processor_id().

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  }
processor_id_type global_processor_id()
Definition: libmesh_base.h:98
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testSolidAngle()

void TypeVectorTestBase< Node >::testSolidAngle ( )
inlineinherited

Definition at line 351 of file type_vector_test.h.

352  {
353  LOG_UNIT_TEST;
354 
355  const DerivedClass xvec(1.3);
356  LIBMESH_ASSERT_NUMBERS_EQUAL( solid_angle(xvec, xvec, xvec), 0, TOLERANCE*TOLERANCE );
357 
358 #if LIBMESH_DIM > 1
359  // This is ambiguous with --enable-complex builds? We really need
360  // to make the vector-from-scalar constructor explicit.
361  // const DerivedClass yvec(0.,2.7),
362  // xydiag(3.1,3.1),
363  // xypdiag(.8,-.8);
364 
365  DerivedClass yvec, xydiag, xypdiag;
366  yvec(1) = 2.7;
367  xydiag(0) = 3.1; xydiag(1) = 3.1;
368  xypdiag(0) = 0.8; xypdiag(1) = -.8;
369 
370  // Yeah, nothing subtends a non-zero solid angle in 2D either.
371  LIBMESH_ASSERT_NUMBERS_EQUAL( solid_angle(xvec, xvec, yvec), 0, TOLERANCE*TOLERANCE );
372  LIBMESH_ASSERT_NUMBERS_EQUAL( solid_angle(xvec, yvec, xydiag), 0, TOLERANCE*TOLERANCE );
373 #endif
374 
375 #if LIBMESH_DIM > 2
376  const DerivedClass zvec(0.,0.,1.1),
377  xzdiag(0.,.7,.7);
378  LIBMESH_ASSERT_NUMBERS_EQUAL(solid_angle(xydiag, yvec, zvec),
380  LIBMESH_ASSERT_NUMBERS_EQUAL(solid_angle(xvec, yvec, xzdiag),
382  LIBMESH_ASSERT_NUMBERS_EQUAL(solid_angle(xypdiag, xydiag, zvec),
384 
385  // Icosahedron coordinates are a nice analytic test
386  const Real golden = (1 + std::sqrt(Real(5)))/2;
387  const DerivedClass icosa1(1., golden, 0.),
388  icosa2(-1., golden, 0.),
389  icosa3(0., 1., golden);
390  LIBMESH_ASSERT_NUMBERS_EQUAL(solid_angle(icosa1, icosa2, icosa3),
392 #endif
393  }
T solid_angle(const TypeVector< T > &v01, const TypeVector< T > &v02, const TypeVector< T > &v03)
Definition: type_vector.h:1054
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real pi
.
Definition: libmesh.h:292

◆ testValidId()

void DofObjectTest< Node >::testValidId ( )
inlineinherited

Definition at line 49 of file dof_object_test.h.

References libMesh::DofObject::invalid_id, libMesh::DofObject::set_id(), and libMesh::DofObject::valid_id().

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  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testValidProcId()

void DofObjectTest< Node >::testValidProcId ( )
inlineinherited

Definition at line 84 of file dof_object_test.h.

References libMesh::global_processor_id(), libMesh::DofObject::invalid_processor_id, libMesh::DofObject::processor_id(), and libMesh::DofObject::valid_processor_id().

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  }
processor_id_type global_processor_id()
Definition: libmesh_base.h:98
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:54

◆ testValue()

void TypeVectorTestBase< Node >::testValue ( )
inlineinherited

Definition at line 97 of file type_vector_test.h.

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

◆ testValueBase()

void TypeVectorTestBase< Node >::testValueBase ( )
inlineinherited

Definition at line 300 of file type_vector_test.h.

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

◆ testVectorAdd()

void TypeVectorTestBase< Node >::testVectorAdd ( )
inlineinherited

Definition at line 232 of file type_vector_test.h.

233  {
234  LOG_UNIT_TEST;
235 
236  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*m_1_1_1)+(*m_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
237  if (LIBMESH_DIM > 1)
238  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*m_1_1_1)+(*m_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
239  if (LIBMESH_DIM > 2)
240  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*m_1_1_1)+(*m_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
241  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
std::unique_ptr< Node > m_n1_1_n1

◆ testVectorAddAssign()

void TypeVectorTestBase< Node >::testVectorAddAssign ( )
inlineinherited

Definition at line 275 of file type_vector_test.h.

276  {
277  LOG_UNIT_TEST;
278 
279  DerivedClass avector {*basem_1_1_1};
280  avector+=(*m_1_1_1);
281 
282  for (int i = 0; i != LIBMESH_DIM; ++i)
283  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(i) , TOLERANCE*TOLERANCE );
284  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1

◆ testVectorAddAssignBase()

void TypeVectorTestBase< Node >::testVectorAddAssignBase ( )
inlineinherited

Definition at line 543 of file type_vector_test.h.

544  {
545  LOG_UNIT_TEST;
546 
547  TypeVector<T> avector(*m_1_1_1);
548  avector+=(*basem_1_1_1);
549 
550  for (int i = 0; i != LIBMESH_DIM; ++i)
551  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(i) , TOLERANCE*TOLERANCE );
552  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34

◆ testVectorAddBase()

void TypeVectorTestBase< Node >::testVectorAddBase ( )
inlineinherited

Definition at line 500 of file type_vector_test.h.

501  {
502  LOG_UNIT_TEST;
503 
504  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
505  if (LIBMESH_DIM > 1)
506  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
507  if (LIBMESH_DIM > 2)
508  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
509  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testVectorAddScaled()

void TypeVectorTestBase< Node >::testVectorAddScaled ( )
inlineinherited

Definition at line 243 of file type_vector_test.h.

244  {
245  LOG_UNIT_TEST;
246 
247  DerivedClass avector {*basem_1_1_1};
248  avector.add_scaled((*m_1_1_1),0.5);
249 
250  for (int i = 0; i != LIBMESH_DIM; ++i)
251  LIBMESH_ASSERT_NUMBERS_EQUAL( 1.5 , avector(i) , TOLERANCE*TOLERANCE );
252  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1
std::unique_ptr< Node > m_1_1_1

◆ testVectorAddScaledBase()

void TypeVectorTestBase< Node >::testVectorAddScaledBase ( )
inlineinherited

Definition at line 511 of file type_vector_test.h.

512  {
513  LOG_UNIT_TEST;
514 
515  TypeVector<T> avector(*m_1_1_1);
516  avector.add_scaled((*basem_1_1_1),0.5);
517 
518  for (int i = 0; i != LIBMESH_DIM; ++i)
519  LIBMESH_ASSERT_NUMBERS_EQUAL( 1.5 , avector(i) , TOLERANCE*TOLERANCE );
520  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1
std::unique_ptr< Node > m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34

◆ testVectorMult()

void TypeVectorTestBase< Node >::testVectorMult ( )
inlineinherited

Definition at line 265 of file type_vector_test.h.

266  {
267  LOG_UNIT_TEST;
268 
269  if (LIBMESH_DIM == 2)
270  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , (*m_1_1_1)*(*m_n1_1_n1) , TOLERANCE*TOLERANCE );
271  else
272  LIBMESH_ASSERT_NUMBERS_EQUAL( -1.0 , (*m_1_1_1)*(*m_n1_1_n1) , TOLERANCE*TOLERANCE );
273  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
std::unique_ptr< Node > m_n1_1_n1

◆ testVectorMultBase()

void TypeVectorTestBase< Node >::testVectorMultBase ( )
inlineinherited

Definition at line 533 of file type_vector_test.h.

534  {
535  LOG_UNIT_TEST;
536 
537  if (LIBMESH_DIM == 2)
538  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , (*basem_1_1_1)*(*basem_n1_1_n1) , TOLERANCE*TOLERANCE );
539  else
540  LIBMESH_ASSERT_NUMBERS_EQUAL( -1.0 , (*basem_1_1_1)*(*basem_n1_1_n1) , TOLERANCE*TOLERANCE );
541  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testVectorSub()

void TypeVectorTestBase< Node >::testVectorSub ( )
inlineinherited

Definition at line 254 of file type_vector_test.h.

255  {
256  LOG_UNIT_TEST;
257 
258  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*m_1_1_1)-(*m_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
259  if (LIBMESH_DIM > 1)
260  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*m_1_1_1)-(*m_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
261  if (LIBMESH_DIM > 2)
262  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*m_1_1_1)-(*m_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
263  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
std::unique_ptr< Node > m_n1_1_n1

◆ testVectorSubAssign()

void TypeVectorTestBase< Node >::testVectorSubAssign ( )
inlineinherited

Definition at line 286 of file type_vector_test.h.

287  {
288  LOG_UNIT_TEST;
289 
290  DerivedClass avector {*basem_1_1_1};
291  avector-=(*m_n1_1_n1);
292 
293  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(0) , TOLERANCE*TOLERANCE );
294  if (LIBMESH_DIM > 1)
295  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , avector(1) , TOLERANCE*TOLERANCE );
296  if (LIBMESH_DIM > 2)
297  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(2) , TOLERANCE*TOLERANCE );
298  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1

◆ testVectorSubAssignBase()

void TypeVectorTestBase< Node >::testVectorSubAssignBase ( )
inlineinherited

Definition at line 554 of file type_vector_test.h.

555  {
556  LOG_UNIT_TEST;
557 
558  TypeVector<T> avector(*m_1_1_1);
559  avector-=(*basem_n1_1_n1);
560 
561  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(0) , TOLERANCE*TOLERANCE );
562  if (LIBMESH_DIM > 1)
563  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , avector(1) , TOLERANCE*TOLERANCE );
564  if (LIBMESH_DIM > 2)
565  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(2) , TOLERANCE*TOLERANCE );
566  }
static constexpr Real TOLERANCE
std::unique_ptr< Node > m_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34

◆ testVectorSubBase()

void TypeVectorTestBase< Node >::testVectorSubBase ( )
inlineinherited

Definition at line 522 of file type_vector_test.h.

523  {
524  LOG_UNIT_TEST;
525 
526  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
527  if (LIBMESH_DIM > 1)
528  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
529  if (LIBMESH_DIM > 2)
530  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
531  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testZero()

void TypeVectorTestBase< Node >::testZero ( )
inlineinherited

Definition at line 115 of file type_vector_test.h.

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

◆ testZeroBase()

void TypeVectorTestBase< Node >::testZeroBase ( )
inlineinherited

Definition at line 314 of file type_vector_test.h.

315  {
316  LOG_UNIT_TEST;
317 
318  TypeVector<T> avector((*basem_1_1_1));
319  avector.zero();
320 
321  for (int i = 0; i != LIBMESH_DIM; ++i)
322  CPPUNIT_ASSERT_EQUAL( T(0), avector(i));
323  }
TypeVector< T > * basem_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34

Member Data Documentation

◆ dof_object_instance

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

Definition at line 27 of file node_test.C.

◆ 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]

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

Definition at line 68 of file type_vector_test.h.


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