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 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 64 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:299

◆ 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 164 of file type_vector_test.h.

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

◆ testAssignmentBase()

void TypeVectorTestBase< Node >::testAssignmentBase ( )
inlineinherited

Definition at line 425 of file type_vector_test.h.

426  {
427  LOG_UNIT_TEST;
428 
429  TypeVector<T> avector = (*basem_1_1_1);
430 
431  for (int i = 0; i != LIBMESH_DIM; ++i)
432  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
433  }
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:34

◆ testEquality()

void TypeVectorTestBase< Node >::testEquality ( )
inlineinherited

Definition at line 144 of file type_vector_test.h.

145  {
146  LOG_UNIT_TEST;
147 
148  CPPUNIT_ASSERT( (*m_1_1_1) == (*m_1_1_1) );
149 #if LIBMESH_DIM > 1
150  CPPUNIT_ASSERT( !((*m_1_1_1) == (*m_n1_1_n1)) );
151 #endif
152  }
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 407 of file type_vector_test.h.

408  {
409  LOG_UNIT_TEST;
410 
411  CPPUNIT_ASSERT( (*basem_1_1_1) == (*basem_1_1_1) );
412  CPPUNIT_ASSERT( !((*basem_1_1_1) == (*basem_n1_1_n1)) );
413  CPPUNIT_ASSERT( relative_fuzzy_equals(*basem_1_1_1, *basem_1_1_1) );
414  }
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 154 of file type_vector_test.h.

155  {
156  LOG_UNIT_TEST;
157 
158  CPPUNIT_ASSERT( !((*m_1_1_1) != (*m_1_1_1)) );
159 #if LIBMESH_DIM > 1
160  CPPUNIT_ASSERT( (*m_1_1_1) != (*m_n1_1_n1) );
161 #endif
162  }
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 416 of file type_vector_test.h.

417  {
418  LOG_UNIT_TEST;
419 
420  CPPUNIT_ASSERT( !((*basem_1_1_1) != (*basem_1_1_1)) );
421  CPPUNIT_ASSERT( (*basem_1_1_1) != (*basem_n1_1_n1) );
422  CPPUNIT_ASSERT( !relative_fuzzy_equals(*basem_1_1_1, *basem_n1_1_n1) );
423  }
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:85
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 323 of file type_vector_test.h.

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

◆ 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/[email protected]/
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 130 of file type_vector_test.h.

131  {
132  LOG_UNIT_TEST;
133 
134  LIBMESH_ASSERT_FP_EQUAL(m_1_1_1->norm() , std::sqrt(Real(LIBMESH_DIM)) , TOLERANCE*TOLERANCE );
135  }
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 393 of file type_vector_test.h.

394  {
395  LOG_UNIT_TEST;
396 
397  LIBMESH_ASSERT_FP_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , basem_1_1_1->norm() , TOLERANCE*TOLERANCE );
398  }
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 137 of file type_vector_test.h.

138  {
139  LOG_UNIT_TEST;
140 
141  LIBMESH_ASSERT_FP_EQUAL(m_1_1_1->norm_sq() , Real(LIBMESH_DIM) , TOLERANCE*TOLERANCE );
142  }
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 400 of file type_vector_test.h.

401  {
402  LOG_UNIT_TEST;
403 
404  LIBMESH_ASSERT_FP_EQUAL( Real(LIBMESH_DIM) , basem_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
405  }
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 541 of file type_vector_test.h.

542  {
543 #ifdef LIBMESH_HAVE_METAPHYSICL
544  typedef typename MetaPhysicL::ReplaceAlgebraicType<
545  std::vector<TypeVector<double>>,
547  typename MetaPhysicL::ValueType<std::vector<TypeVector<double>>>::type>::type>::type
548  ReplacedType;
549  constexpr bool assertion =
550  std::is_same<ReplacedType, std::vector<TensorValue<double>>>::value;
551  CPPUNIT_ASSERT(assertion);
552 #endif
553  }
static const bool value
Definition: xdr_io.C:54

◆ testScalarDiv()

void TypeVectorTestBase< Node >::testScalarDiv ( )
inlineinherited

Definition at line 200 of file type_vector_test.h.

201  {
202  LOG_UNIT_TEST;
203 
204  for (int i = 0; i != LIBMESH_DIM; ++i)
205  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , ((*m_1_1_1)/5.0)(i) , TOLERANCE*TOLERANCE );
206  }
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 219 of file type_vector_test.h.

220  {
221  LOG_UNIT_TEST;
222 
223  DerivedClass avector {*basem_1_1_1};
224  avector/=5.0;
225 
226  for (int i = 0; i != LIBMESH_DIM; ++i)
227  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , avector(i) , TOLERANCE*TOLERANCE );
228  }
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 462 of file type_vector_test.h.

463  {
464  LOG_UNIT_TEST;
465 
466  TypeVector<T> avector(*m_1_1_1);
467  avector/=5.0;
468 
469  for (int i = 0; i != LIBMESH_DIM; ++i)
470  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , avector(i) , TOLERANCE*TOLERANCE );
471  }
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 443 of file type_vector_test.h.

444  {
445  LOG_UNIT_TEST;
446 
447  for (int i = 0; i != LIBMESH_DIM; ++i)
448  LIBMESH_ASSERT_NUMBERS_EQUAL( 1/Real(5) , ((*basem_1_1_1)/5.0)(i) , TOLERANCE*TOLERANCE );
449  }
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 174 of file type_vector_test.h.

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

◆ testScalarMult()

void TypeVectorTestBase< Node >::testScalarMult ( )
inlineinherited

Definition at line 188 of file type_vector_test.h.

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

◆ testScalarMultAssign()

void TypeVectorTestBase< Node >::testScalarMultAssign ( )
inlineinherited

Definition at line 208 of file type_vector_test.h.

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

◆ testScalarMultAssignBase()

void TypeVectorTestBase< Node >::testScalarMultAssignBase ( )
inlineinherited

Definition at line 451 of file type_vector_test.h.

452  {
453  LOG_UNIT_TEST;
454 
455  TypeVector<T> avector(*m_1_1_1);
456  avector*=5.0;
457 
458  for (int i = 0; i != LIBMESH_DIM; ++i)
459  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , avector(i) , TOLERANCE*TOLERANCE );
460  }
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 435 of file type_vector_test.h.

436  {
437  LOG_UNIT_TEST;
438 
439  for (int i = 0; i != LIBMESH_DIM; ++i)
440  LIBMESH_ASSERT_NUMBERS_EQUAL( 5.0 , ((*basem_1_1_1)*5.0)(i) , TOLERANCE*TOLERANCE );
441  }
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:85
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 349 of file type_vector_test.h.

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

◆ 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:85
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 95 of file type_vector_test.h.

96  {
97  LOG_UNIT_TEST;
98 
99  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(0));
100  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(0));
101 
102 #if LIBMESH_DIM > 1
103  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(1));
104  CPPUNIT_ASSERT_EQUAL( T(1) , (*m_n1_1_n1)(1));
105 #endif
106 
107 #if LIBMESH_DIM > 2
108  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(2));
109  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(2));
110 #endif
111  }
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 298 of file type_vector_test.h.

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

◆ testVectorAdd()

void TypeVectorTestBase< Node >::testVectorAdd ( )
inlineinherited

Definition at line 230 of file type_vector_test.h.

231  {
232  LOG_UNIT_TEST;
233 
234  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*m_1_1_1)+(*m_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
235  if (LIBMESH_DIM > 1)
236  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*m_1_1_1)+(*m_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
237  if (LIBMESH_DIM > 2)
238  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*m_1_1_1)+(*m_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
239  }
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 273 of file type_vector_test.h.

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

◆ testVectorAddAssignBase()

void TypeVectorTestBase< Node >::testVectorAddAssignBase ( )
inlineinherited

Definition at line 516 of file type_vector_test.h.

517  {
518  LOG_UNIT_TEST;
519 
520  TypeVector<T> avector(*m_1_1_1);
521  avector+=(*basem_1_1_1);
522 
523  for (int i = 0; i != LIBMESH_DIM; ++i)
524  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(i) , TOLERANCE*TOLERANCE );
525  }
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 473 of file type_vector_test.h.

474  {
475  LOG_UNIT_TEST;
476 
477  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
478  if (LIBMESH_DIM > 1)
479  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
480  if (LIBMESH_DIM > 2)
481  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*basem_1_1_1)+(*basem_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
482  }
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 241 of file type_vector_test.h.

242  {
243  LOG_UNIT_TEST;
244 
245  DerivedClass avector {*basem_1_1_1};
246  avector.add_scaled((*m_1_1_1),0.5);
247 
248  for (int i = 0; i != LIBMESH_DIM; ++i)
249  LIBMESH_ASSERT_NUMBERS_EQUAL( 1.5 , avector(i) , TOLERANCE*TOLERANCE );
250  }
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 484 of file type_vector_test.h.

485  {
486  LOG_UNIT_TEST;
487 
488  TypeVector<T> avector(*m_1_1_1);
489  avector.add_scaled((*basem_1_1_1),0.5);
490 
491  for (int i = 0; i != LIBMESH_DIM; ++i)
492  LIBMESH_ASSERT_NUMBERS_EQUAL( 1.5 , avector(i) , TOLERANCE*TOLERANCE );
493  }
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 263 of file type_vector_test.h.

264  {
265  LOG_UNIT_TEST;
266 
267  if (LIBMESH_DIM == 2)
268  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , (*m_1_1_1)*(*m_n1_1_n1) , TOLERANCE*TOLERANCE );
269  else
270  LIBMESH_ASSERT_NUMBERS_EQUAL( -1.0 , (*m_1_1_1)*(*m_n1_1_n1) , TOLERANCE*TOLERANCE );
271  }
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 506 of file type_vector_test.h.

507  {
508  LOG_UNIT_TEST;
509 
510  if (LIBMESH_DIM == 2)
511  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , (*basem_1_1_1)*(*basem_n1_1_n1) , TOLERANCE*TOLERANCE );
512  else
513  LIBMESH_ASSERT_NUMBERS_EQUAL( -1.0 , (*basem_1_1_1)*(*basem_n1_1_n1) , TOLERANCE*TOLERANCE );
514  }
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 252 of file type_vector_test.h.

253  {
254  LOG_UNIT_TEST;
255 
256  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*m_1_1_1)-(*m_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
257  if (LIBMESH_DIM > 1)
258  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*m_1_1_1)-(*m_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
259  if (LIBMESH_DIM > 2)
260  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*m_1_1_1)-(*m_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
261  }
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 284 of file type_vector_test.h.

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

◆ testVectorSubAssignBase()

void TypeVectorTestBase< Node >::testVectorSubAssignBase ( )
inlineinherited

Definition at line 527 of file type_vector_test.h.

528  {
529  LOG_UNIT_TEST;
530 
531  TypeVector<T> avector(*m_1_1_1);
532  avector-=(*basem_n1_1_n1);
533 
534  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(0) , TOLERANCE*TOLERANCE );
535  if (LIBMESH_DIM > 1)
536  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , avector(1) , TOLERANCE*TOLERANCE );
537  if (LIBMESH_DIM > 2)
538  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , avector(2) , TOLERANCE*TOLERANCE );
539  }
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 495 of file type_vector_test.h.

496  {
497  LOG_UNIT_TEST;
498 
499  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(0) , TOLERANCE*TOLERANCE );
500  if (LIBMESH_DIM > 1)
501  LIBMESH_ASSERT_NUMBERS_EQUAL( 0.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(1) , TOLERANCE*TOLERANCE );
502  if (LIBMESH_DIM > 2)
503  LIBMESH_ASSERT_NUMBERS_EQUAL( 2.0 , ((*basem_1_1_1)-(*basem_n1_1_n1))(2) , TOLERANCE*TOLERANCE );
504  }
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 113 of file type_vector_test.h.

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

◆ testZeroBase()

void TypeVectorTestBase< Node >::testZeroBase ( )
inlineinherited

Definition at line 312 of file type_vector_test.h.

313  {
314  LOG_UNIT_TEST;
315 
316  TypeVector<T> avector((*basem_1_1_1));
317  avector.zero();
318 
319  for (int i = 0; i != LIBMESH_DIM; ++i)
320  CPPUNIT_ASSERT_EQUAL( T(0), avector(i));
321  }
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 66 of file type_vector_test.h.


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