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 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 62 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:274

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

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

◆ testAssignmentBase()

void TypeVectorTestBase< Node >::testAssignmentBase ( )
inlineinherited

Definition at line 377 of file type_vector_test.h.

378  {
379  LOG_UNIT_TEST;
380 
381  TypeVector<T> avector = (*basem_1_1_1);
382 
383  for (int i = 0; i != LIBMESH_DIM; ++i)
384  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(i) );
385  }
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 142 of file type_vector_test.h.

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

362  {
363  LOG_UNIT_TEST;
364 
365  CPPUNIT_ASSERT( (*basem_1_1_1) == (*basem_1_1_1) );
366  CPPUNIT_ASSERT( !((*basem_1_1_1) == (*basem_n1_1_n1)) );
367  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

◆ testInEquality()

void TypeVectorTestBase< Node >::testInEquality ( )
inlineinherited

Definition at line 152 of file type_vector_test.h.

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

370  {
371  LOG_UNIT_TEST;
372 
373  CPPUNIT_ASSERT( !((*basem_1_1_1) != (*basem_1_1_1)) );
374  CPPUNIT_ASSERT( (*basem_1_1_1) != (*basem_n1_1_n1) );
375  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1

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

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

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

129  {
130  LOG_UNIT_TEST;
131 
132  LIBMESH_ASSERT_FP_EQUAL(m_1_1_1->norm() , std::sqrt(Real(LIBMESH_DIM)) , TOLERANCE*TOLERANCE );
133  }
static constexpr Real TOLERANCE
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:53
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 347 of file type_vector_test.h.

348  {
349  LOG_UNIT_TEST;
350 
351  LIBMESH_ASSERT_FP_EQUAL( std::sqrt(Real(LIBMESH_DIM)) , basem_1_1_1->norm() , TOLERANCE*TOLERANCE );
352  }
static constexpr Real TOLERANCE
TypeVector< T > * basem_1_1_1
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:53
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ testNormSq()

void TypeVectorTestBase< Node >::testNormSq ( )
inlineinherited

Definition at line 135 of file type_vector_test.h.

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

355  {
356  LOG_UNIT_TEST;
357 
358  LIBMESH_ASSERT_FP_EQUAL( Real(LIBMESH_DIM) , basem_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
359  }
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 493 of file type_vector_test.h.

494  {
495 #ifdef LIBMESH_HAVE_METAPHYSICL
496  typedef typename MetaPhysicL::ReplaceAlgebraicType<
497  std::vector<TypeVector<double>>,
499  typename MetaPhysicL::ValueType<std::vector<TypeVector<double>>>::type>::type>::type
500  ReplacedType;
501  constexpr bool assertion =
502  std::is_same<ReplacedType, std::vector<TensorValue<double>>>::value;
503  CPPUNIT_ASSERT(assertion);
504 #endif
505  }
static const bool value
Definition: xdr_io.C:54

◆ testScalarDiv()

void TypeVectorTestBase< Node >::testScalarDiv ( )
inlineinherited

Definition at line 198 of file type_vector_test.h.

199  {
200  LOG_UNIT_TEST;
201 
202  for (int i = 0; i != LIBMESH_DIM; ++i)
203  LIBMESH_ASSERT_FP_EQUAL( 1/Real(5) , libmesh_real(((*m_1_1_1)/5.0)(i)) , TOLERANCE*TOLERANCE );
204  }
T libmesh_real(T a)
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 217 of file type_vector_test.h.

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

415  {
416  LOG_UNIT_TEST;
417 
418  TypeVector<T> avector(*m_1_1_1);
419  avector/=5.0;
420 
421  for (int i = 0; i != LIBMESH_DIM; ++i)
422  LIBMESH_ASSERT_FP_EQUAL( 1/Real(5) , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
423  }
T libmesh_real(T a)
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 395 of file type_vector_test.h.

396  {
397  LOG_UNIT_TEST;
398 
399  for (int i = 0; i != LIBMESH_DIM; ++i)
400  LIBMESH_ASSERT_FP_EQUAL( 1/Real(5) , libmesh_real(((*basem_1_1_1)/5.0)(i)) , TOLERANCE*TOLERANCE );
401  }
T libmesh_real(T a)
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 172 of file type_vector_test.h.

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

◆ testScalarMult()

void TypeVectorTestBase< Node >::testScalarMult ( )
inlineinherited

Definition at line 186 of file type_vector_test.h.

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

◆ testScalarMultAssign()

void TypeVectorTestBase< Node >::testScalarMultAssign ( )
inlineinherited

Definition at line 206 of file type_vector_test.h.

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

◆ testScalarMultAssignBase()

void TypeVectorTestBase< Node >::testScalarMultAssignBase ( )
inlineinherited

Definition at line 403 of file type_vector_test.h.

404  {
405  LOG_UNIT_TEST;
406 
407  TypeVector<T> avector(*m_1_1_1);
408  avector*=5.0;
409 
410  for (int i = 0; i != LIBMESH_DIM; ++i)
411  LIBMESH_ASSERT_FP_EQUAL( 5.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
412  }
T libmesh_real(T a)
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 387 of file type_vector_test.h.

388  {
389  LOG_UNIT_TEST;
390 
391  for (int i = 0; i != LIBMESH_DIM; ++i)
392  LIBMESH_ASSERT_FP_EQUAL( 5.0 , libmesh_real(((*basem_1_1_1)*5.0)(i)) , TOLERANCE*TOLERANCE );
393  }
T libmesh_real(T a)
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

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

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

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

◆ testVectorAdd()

void TypeVectorTestBase< Node >::testVectorAdd ( )
inlineinherited

Definition at line 228 of file type_vector_test.h.

229  {
230  LOG_UNIT_TEST;
231 
232  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
233  if (LIBMESH_DIM > 1)
234  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
235  if (LIBMESH_DIM > 2)
236  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
237  }
T libmesh_real(T a)
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 271 of file type_vector_test.h.

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

◆ testVectorAddAssignBase()

void TypeVectorTestBase< Node >::testVectorAddAssignBase ( )
inlineinherited

Definition at line 468 of file type_vector_test.h.

469  {
470  LOG_UNIT_TEST;
471 
472  TypeVector<T> avector(*m_1_1_1);
473  avector+=(*basem_1_1_1);
474 
475  for (int i = 0; i != LIBMESH_DIM; ++i)
476  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
477  }
T libmesh_real(T a)
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 425 of file type_vector_test.h.

426  {
427  LOG_UNIT_TEST;
428 
429  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
430  if (LIBMESH_DIM > 1)
431  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
432  if (LIBMESH_DIM > 2)
433  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
434  }
T libmesh_real(T a)
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 239 of file type_vector_test.h.

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

437  {
438  LOG_UNIT_TEST;
439 
440  TypeVector<T> avector(*m_1_1_1);
441  avector.add_scaled((*basem_1_1_1),0.5);
442 
443  for (int i = 0; i != LIBMESH_DIM; ++i)
444  LIBMESH_ASSERT_FP_EQUAL( 1.5 , libmesh_real(avector(i)) , TOLERANCE*TOLERANCE );
445  }
T libmesh_real(T a)
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 261 of file type_vector_test.h.

262  {
263  LOG_UNIT_TEST;
264 
265  if (LIBMESH_DIM == 2)
266  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real((*m_1_1_1)*(*m_n1_1_n1)) , TOLERANCE*TOLERANCE );
267  else
268  LIBMESH_ASSERT_FP_EQUAL( -1.0 , libmesh_real((*m_1_1_1)*(*m_n1_1_n1)) , TOLERANCE*TOLERANCE );
269  }
T libmesh_real(T a)
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 458 of file type_vector_test.h.

459  {
460  LOG_UNIT_TEST;
461 
462  if (LIBMESH_DIM == 2)
463  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real((*basem_1_1_1)*(*basem_n1_1_n1)) , TOLERANCE*TOLERANCE );
464  else
465  LIBMESH_ASSERT_FP_EQUAL( -1.0 , libmesh_real((*basem_1_1_1)*(*basem_n1_1_n1)) , TOLERANCE*TOLERANCE );
466  }
T libmesh_real(T a)
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 250 of file type_vector_test.h.

251  {
252  LOG_UNIT_TEST;
253 
254  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
255  if (LIBMESH_DIM > 1)
256  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
257  if (LIBMESH_DIM > 2)
258  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
259  }
T libmesh_real(T a)
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 282 of file type_vector_test.h.

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

◆ testVectorSubAssignBase()

void TypeVectorTestBase< Node >::testVectorSubAssignBase ( )
inlineinherited

Definition at line 479 of file type_vector_test.h.

480  {
481  LOG_UNIT_TEST;
482 
483  TypeVector<T> avector(*m_1_1_1);
484  avector-=(*basem_n1_1_n1);
485 
486  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
487  if (LIBMESH_DIM > 1)
488  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
489  if (LIBMESH_DIM > 2)
490  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
491  }
T libmesh_real(T a)
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 447 of file type_vector_test.h.

448  {
449  LOG_UNIT_TEST;
450 
451  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
452  if (LIBMESH_DIM > 1)
453  LIBMESH_ASSERT_FP_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
454  if (LIBMESH_DIM > 2)
455  LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
456  }
T libmesh_real(T a)
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 111 of file type_vector_test.h.

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

◆ testZeroBase()

void TypeVectorTestBase< Node >::testZeroBase ( )
inlineinherited

Definition at line 310 of file type_vector_test.h.

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


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