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

Public Member Functions

 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 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 setUp (Node *derived_instance)
 
void testSetId ()
 
void testValidId ()
 
void testInvalidateId ()
 
void testSetProcId ()
 
void testValidProcId ()
 
void testInvalidateProcId ()
 
void testSetNSystems ()
 
void testSetNVariableGroups ()
 
void testManualDofCalculation ()
 
void testJensEftangBug ()
 

Protected Types

typedef Node::value_type T
 

Private Attributes

Nodedof_object_instance
 

Detailed Description

Definition at line 24 of file node_test.C.

Member Typedef Documentation

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

Definition at line 60 of file type_vector_test.h.

Member Function Documentation

NodeTest::CPPUNIT_TEST_SUITE ( NodeTest  )
POINTTEST DOFOBJECTTEST NodeTest::CPPUNIT_TEST_SUITE_END ( )
void DofObjectTest< Node >::setUp ( Node derived_instance)
inherited

Definition at line 28 of file dof_object_test.h.

29  {
30  instance=derived_instance;
31  }
virtual void NodeTest::setUp ( )
virtual

Reimplemented from PointTestBase< Node >.

Definition at line 40 of file node_test.C.

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

41  {
43 
44  dof_object_instance = new Node(1,1,1);
46  }
A Node is like a Point, but with more information.
Definition: node.h:52
Node * dof_object_instance
Definition: node_test.C:36
virtual void setUp()
Definition: point_test.h:15
void setUp(DerivedClass *derived_instance)
virtual void NodeTest::tearDown ( )
virtual

Reimplemented from PointTestBase< Node >.

Definition at line 48 of file node_test.C.

References CPPUNIT_TEST_SUITE_REGISTRATION(), and PointTestBase< DerivedClass >::tearDown().

49  {
51 
52  delete dof_object_instance;
53  }
Node * dof_object_instance
Definition: node_test.C:36
virtual void tearDown()
Definition: point_test.h:20
void TypeVectorTestBase< Node >::testAssignment ( )
inherited

Definition at line 125 of file type_vector_test.h.

126  {
127  DerivedClass avector = (*m_1_1_1);
128 
129  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(0) );
130  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(1) );
131  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(2) );
132  }
void TypeVectorTestBase< Node >::testAssignmentBase ( )
inherited

Definition at line 273 of file type_vector_test.h.

274  {
275  TypeVector<T> avector = (*m_1_1_1);
276 
277  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(0) );
278  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(1) );
279  CPPUNIT_ASSERT_EQUAL( T(1), (avector)(2) );
280  }
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:30
void TypeVectorTestBase< Node >::testEquality ( )
inherited

Definition at line 113 of file type_vector_test.h.

114  {
115  CPPUNIT_ASSERT( (*m_1_1_1) == (*m_1_1_1) );
116  CPPUNIT_ASSERT( !((*m_1_1_1) == (*m_n1_1_n1)) );
117  }
void TypeVectorTestBase< Node >::testEqualityBase ( )
inherited

Definition at line 261 of file type_vector_test.h.

262  {
263  CPPUNIT_ASSERT( (*basem_1_1_1) == (*basem_1_1_1) );
264  CPPUNIT_ASSERT( !((*basem_1_1_1) == (*basem_n1_1_n1)) );
265  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
void TypeVectorTestBase< Node >::testInEquality ( )
inherited

Definition at line 119 of file type_vector_test.h.

120  {
121  CPPUNIT_ASSERT( !((*m_1_1_1) != (*m_1_1_1)) );
122  CPPUNIT_ASSERT( (*m_1_1_1) != (*m_n1_1_n1) );
123  }
void TypeVectorTestBase< Node >::testInEqualityBase ( )
inherited

Definition at line 267 of file type_vector_test.h.

268  {
269  CPPUNIT_ASSERT( !((*basem_1_1_1) != (*basem_1_1_1)) );
270  CPPUNIT_ASSERT( (*basem_1_1_1) != (*basem_n1_1_n1) );
271  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
void DofObjectTest< Node >::testInvalidateId ( )
inherited

Definition at line 52 of file dof_object_test.h.

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

53  {
54  DofObject aobject(*instance);
55 
56  aobject.set_id(1);
57  aobject.invalidate_id();
58 
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:51
void DofObjectTest< Node >::testInvalidateProcId ( )
inherited

Definition at line 81 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().

82  {
83  DofObject aobject(*instance);
84 
85  aobject.processor_id(libMesh::global_processor_id());
86  aobject.invalidate_processor_id();
87 
88  CPPUNIT_ASSERT( !aobject.valid_processor_id() );
89  }
processor_id_type global_processor_id()
Definition: libmesh_base.h:114
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void DofObjectTest< Node >::testJensEftangBug ( )
inherited

Definition at line 167 of file dof_object_test.h.

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

168  {
169  // For more information on this bug, see the following email thread:
170  // https://sourceforge.net/p/libmesh/mailman/libmesh-users/thread/50C8EE7C.8090405@gmail.com/
171  DofObject aobject(*instance);
172  dof_id_type buf0[] = {2, 8, 257, 0, 257, 96, 257, 192, 257, 0};
173  aobject.set_buffer(std::vector<dof_id_type>(buf0, buf0+10));
174 
175  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,0,0), static_cast<dof_id_type>( 0));
176  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,1,0), static_cast<dof_id_type>( 96));
177  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,2,0), static_cast<dof_id_type>(192));
178  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(1,0,0), static_cast<dof_id_type>( 0));
179 
180  dof_id_type buf1[] = {2, 8, 257, 1, 257, 97, 257, 193, 257, 1};
181  aobject.set_buffer(std::vector<dof_id_type>(buf1, buf1+10));
182 
183  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,0,0), static_cast<dof_id_type>( 1));
184  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,1,0), static_cast<dof_id_type>( 97));
185  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(0,2,0), static_cast<dof_id_type>(193));
186  CPPUNIT_ASSERT_EQUAL (aobject.dof_number(1,0,0), static_cast<dof_id_type>( 1));
187  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
uint8_t dof_id_type
Definition: id_types.h:64
void DofObjectTest< Node >::testManualDofCalculation ( )
inherited

Definition at line 125 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().

126  {
127  DofObject aobject(*instance);
128 
129  aobject.set_n_systems (2);
130 
131  std::vector<unsigned int> nvpg;
132 
133  nvpg.push_back(2);
134  nvpg.push_back(3);
135 
136  aobject.set_n_vars_per_group (0, nvpg);
137  aobject.set_n_vars_per_group (1, nvpg);
138 
139  aobject.set_n_comp_group (0, 0, 1);
140  aobject.set_n_comp_group (0, 1, 3);
141 
142  aobject.set_n_comp_group (1, 0, 2);
143  aobject.set_n_comp_group (1, 1, 1);
144 
145  aobject.set_vg_dof_base(0, 0, 0);
146  aobject.set_vg_dof_base(0, 1, 120);
147 
148  aobject.set_vg_dof_base(1, 0, 20);
149  aobject.set_vg_dof_base(1, 1, 220);
150 
151  // Make sure the first dof is sane
152  CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(0), aobject.dof_number(0, 0, 0));
153 
154  // Check that we can manually index dofs of variables based on the first dof in a variable group
155  // Using: id = base + var_in_vg*ncomp + comp
156  CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(aobject.vg_dof_base(0, 0) + 1*1 + 0), aobject.dof_number(0, 1, 0));
157 
158  // Another Check that we can manually index dofs of variables based on the first dof in a variable group
159  // Using: id = base + var_in_vg*ncomp + comp
160  CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(aobject.vg_dof_base(0, 1) + 2*3 + 2), aobject.dof_number(0, 4, 2));
161 
162  // One More Check that we can manually index dofs of variables based on the first dof in a variable group
163  // Using: id = base + var_in_vg*ncomp + comp
164  CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(aobject.vg_dof_base(1, 1) + 0*3 + 0), aobject.dof_number(1, 2, 0));
165  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void TypeVectorTestBase< Node >::testNorm ( )
inherited

Definition at line 103 of file type_vector_test.h.

104  {
105  CPPUNIT_ASSERT_DOUBLES_EQUAL( std::sqrt(3.0) , m_1_1_1->norm() , TOLERANCE*TOLERANCE );
106  }
Real norm() const
Definition: type_vector.h:909
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testNormBase ( )
inherited

Definition at line 251 of file type_vector_test.h.

252  {
253  CPPUNIT_ASSERT_DOUBLES_EQUAL( std::sqrt(3.0) , basem_1_1_1->norm() , TOLERANCE*TOLERANCE );
254  }
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testNormSq ( )
inherited

Definition at line 108 of file type_vector_test.h.

109  {
110  CPPUNIT_ASSERT_DOUBLES_EQUAL( 3.0 , m_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
111  }
static const Real TOLERANCE
Real norm_sq() const
Definition: type_vector.h:940
void TypeVectorTestBase< Node >::testNormSqBase ( )
inherited

Definition at line 256 of file type_vector_test.h.

257  {
258  CPPUNIT_ASSERT_DOUBLES_EQUAL( 3.0 , basem_1_1_1->norm_sq() , TOLERANCE*TOLERANCE );
259  }
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testScalarDiv ( )
inherited

Definition at line 154 of file type_vector_test.h.

155  {
156  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*m_1_1_1)/5.0)(0)) , TOLERANCE*TOLERANCE );
157  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*m_1_1_1)/5.0)(1)) , TOLERANCE*TOLERANCE );
158  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*m_1_1_1)/5.0)(2)) , TOLERANCE*TOLERANCE );
159  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testScalarDivAssign ( )
inherited

Definition at line 171 of file type_vector_test.h.

172  {
173  DerivedClass avector(1.0,1.0,1.0);
174  avector/=5.0;
175 
176  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
177  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
178  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
179  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testScalarDivAssignBase ( )
inherited

Definition at line 306 of file type_vector_test.h.

307  {
308  TypeVector<T> avector(*m_1_1_1);
309  avector/=5.0;
310 
311  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
312  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
313  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
314  }
T libmesh_real(T a)
static const Real TOLERANCE
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:30
void TypeVectorTestBase< Node >::testScalarDivBase ( )
inherited

Definition at line 289 of file type_vector_test.h.

290  {
291  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*basem_1_1_1)/5.0)(0)) , TOLERANCE*TOLERANCE );
292  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*basem_1_1_1)/5.0)(1)) , TOLERANCE*TOLERANCE );
293  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0/5.0 , libmesh_real(((*basem_1_1_1)/5.0)(2)) , TOLERANCE*TOLERANCE );
294  }
T libmesh_real(T a)
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testScalarInit ( )
inherited

Definition at line 134 of file type_vector_test.h.

135  {
136  DerivedClass avector = 0;
137  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
138  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
139  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
140 
141  DerivedClass bvector = 2.0;
142  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(bvector(0)) , TOLERANCE*TOLERANCE );
143  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(bvector(1)) , TOLERANCE*TOLERANCE );
144  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(bvector(2)) , TOLERANCE*TOLERANCE );
145  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testScalarMult ( )
inherited

Definition at line 147 of file type_vector_test.h.

148  {
149  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*m_1_1_1)*5.0)(0)) , TOLERANCE*TOLERANCE );
150  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*m_1_1_1)*5.0)(1)) , TOLERANCE*TOLERANCE );
151  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*m_1_1_1)*5.0)(2)) , TOLERANCE*TOLERANCE );
152  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testScalarMultAssign ( )
inherited

Definition at line 161 of file type_vector_test.h.

162  {
163  DerivedClass avector(1,1,1);
164  avector*=5.0;
165 
166  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
167  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
168  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
169  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testScalarMultAssignBase ( )
inherited

Definition at line 296 of file type_vector_test.h.

297  {
298  TypeVector<T> avector(*m_1_1_1);
299  avector*=5.0;
300 
301  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
302  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
303  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
304  }
T libmesh_real(T a)
static const Real TOLERANCE
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:30
void TypeVectorTestBase< Node >::testScalarMultBase ( )
inherited

Definition at line 282 of file type_vector_test.h.

283  {
284  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*basem_1_1_1)*5.0)(0)) , TOLERANCE*TOLERANCE );
285  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*basem_1_1_1)*5.0)(1)) , TOLERANCE*TOLERANCE );
286  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0 , libmesh_real(((*basem_1_1_1)*5.0)(2)) , TOLERANCE*TOLERANCE );
287  }
T libmesh_real(T a)
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
void DofObjectTest< Node >::testSetId ( )
inherited

Definition at line 33 of file dof_object_test.h.

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

34  {
35  DofObject aobject(*instance);
36 
37  aobject.set_id(1);
38  CPPUNIT_ASSERT_EQUAL( static_cast<dof_id_type>(1) , aobject.id() );
39  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void DofObjectTest< Node >::testSetNSystems ( )
inherited

Definition at line 91 of file dof_object_test.h.

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

92  {
93  DofObject aobject(*instance);
94 
95  aobject.set_n_systems (10);
96 
97  CPPUNIT_ASSERT_EQUAL( (unsigned int) 10, aobject.n_systems() );
98  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void DofObjectTest< Node >::testSetNVariableGroups ( )
inherited

Definition at line 100 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().

101  {
102  DofObject aobject(*instance);
103 
104  aobject.set_n_systems (2);
105 
106  std::vector<unsigned int> nvpg;
107 
108  nvpg.push_back(10);
109  nvpg.push_back(20);
110  nvpg.push_back(30);
111 
112  aobject.set_n_vars_per_group (0, nvpg);
113  aobject.set_n_vars_per_group (1, nvpg);
114 
115  for (unsigned int s=0; s<2; s++)
116  {
117  CPPUNIT_ASSERT_EQUAL( (unsigned int) 60, aobject.n_vars(s) );
118  CPPUNIT_ASSERT_EQUAL( (unsigned int) 3, aobject.n_var_groups(s) );
119 
120  for (unsigned int vg=0; vg<3; vg++)
121  CPPUNIT_ASSERT_EQUAL( nvpg[vg], aobject.n_vars(s,vg) );
122  }
123  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void DofObjectTest< Node >::testSetProcId ( )
inherited

Definition at line 62 of file dof_object_test.h.

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

63  {
64  DofObject aobject(*instance);
65 
66  aobject.processor_id(libMesh::global_processor_id());
67  CPPUNIT_ASSERT_EQUAL( (processor_id_type)libMesh::global_processor_id() , aobject.processor_id() );
68  }
uint8_t processor_id_type
Definition: id_types.h:99
processor_id_type global_processor_id()
Definition: libmesh_base.h:114
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void DofObjectTest< Node >::testValidId ( )
inherited

Definition at line 41 of file dof_object_test.h.

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

42  {
43  DofObject aobject(*instance);
44 
45  aobject.set_id(1);
46  CPPUNIT_ASSERT( aobject.valid_id() );
47 
48  aobject.set_id(DofObject::invalid_id);
49  CPPUNIT_ASSERT( !aobject.valid_id() );
50  }
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void DofObjectTest< Node >::testValidProcId ( )
inherited

Definition at line 70 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().

71  {
72  DofObject aobject(*instance);
73 
74  aobject.processor_id(libMesh::global_processor_id());
75  CPPUNIT_ASSERT(aobject.valid_processor_id());
76 
77  aobject.processor_id(DofObject::invalid_processor_id);
78  CPPUNIT_ASSERT(!aobject.valid_processor_id());
79  }
processor_id_type global_processor_id()
Definition: libmesh_base.h:114
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:51
void TypeVectorTestBase< Node >::testValue ( )
inherited

Definition at line 82 of file type_vector_test.h.

83  {
84  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(0));
85  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(1));
86  CPPUNIT_ASSERT_EQUAL( T(1), (*m_1_1_1)(2));
87 
88  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(0));
89  CPPUNIT_ASSERT_EQUAL( T(1) , (*m_n1_1_n1)(1));
90  CPPUNIT_ASSERT_EQUAL( T(-1), (*m_n1_1_n1)(2));
91  }
void TypeVectorTestBase< Node >::testValueBase ( )
inherited

Definition at line 230 of file type_vector_test.h.

231  {
232  CPPUNIT_ASSERT_EQUAL( T(1), (*basem_1_1_1)(0));
233  CPPUNIT_ASSERT_EQUAL( T(1), (*basem_1_1_1)(1));
234  CPPUNIT_ASSERT_EQUAL( T(1), (*basem_1_1_1)(2));
235 
236  CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(0));
237  CPPUNIT_ASSERT_EQUAL( T(1 ), (*basem_n1_1_n1)(1));
238  CPPUNIT_ASSERT_EQUAL( T(-1), (*basem_n1_1_n1)(2));
239  }
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
void TypeVectorTestBase< Node >::testVectorAdd ( )
inherited

Definition at line 181 of file type_vector_test.h.

182  {
183  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
184  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
185  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)+(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
186  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorAddAssign ( )
inherited

Definition at line 210 of file type_vector_test.h.

211  {
212  DerivedClass avector(1,1,1);
213  avector+=(*m_1_1_1);
214 
215  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
216  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
217  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
218  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorAddAssignBase ( )
inherited

Definition at line 345 of file type_vector_test.h.

346  {
347  TypeVector<T> avector(*m_1_1_1);
348  avector+=(*basem_1_1_1);
349 
350  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
351  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
352  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
353  }
T libmesh_real(T a)
static const Real TOLERANCE
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:30
void TypeVectorTestBase< Node >::testVectorAddBase ( )
inherited

Definition at line 316 of file type_vector_test.h.

317  {
318  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
319  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
320  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)+(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
321  }
T libmesh_real(T a)
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorAddScaled ( )
inherited

Definition at line 188 of file type_vector_test.h.

189  {
190  DerivedClass avector(1,1,1);
191  avector.add_scaled((*m_1_1_1),0.5);
192 
193  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
194  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
195  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
196  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorAddScaledBase ( )
inherited

Definition at line 323 of file type_vector_test.h.

324  {
325  TypeVector<T> avector(*m_1_1_1);
326  avector.add_scaled((*basem_1_1_1),0.5);
327 
328  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
329  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
330  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
331  }
T libmesh_real(T a)
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:30
void TypeVectorTestBase< Node >::testVectorMult ( )
inherited

Definition at line 205 of file type_vector_test.h.

206  {
207  CPPUNIT_ASSERT_DOUBLES_EQUAL( -1.0 , libmesh_real((*m_1_1_1)*(*m_n1_1_n1)) , TOLERANCE*TOLERANCE );
208  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorMultBase ( )
inherited

Definition at line 340 of file type_vector_test.h.

341  {
342  CPPUNIT_ASSERT_DOUBLES_EQUAL( -1.0 , libmesh_real((*basem_1_1_1)*(*basem_n1_1_n1)) , TOLERANCE*TOLERANCE );
343  }
T libmesh_real(T a)
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorSub ( )
inherited

Definition at line 198 of file type_vector_test.h.

199  {
200  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
201  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
202  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*m_1_1_1)-(*m_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
203  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorSubAssign ( )
inherited

Definition at line 220 of file type_vector_test.h.

221  {
222  DerivedClass avector(1,1,1);
223  avector-=(*m_n1_1_n1);
224 
225  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
226  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
227  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
228  }
T libmesh_real(T a)
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testVectorSubAssignBase ( )
inherited

Definition at line 355 of file type_vector_test.h.

356  {
357  TypeVector<T> avector(*m_1_1_1);
358  avector-=(*basem_n1_1_n1);
359 
360  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(0)) , TOLERANCE*TOLERANCE );
361  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(avector(1)) , TOLERANCE*TOLERANCE );
362  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
363  }
T libmesh_real(T a)
static const Real TOLERANCE
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:30
void TypeVectorTestBase< Node >::testVectorSubBase ( )
inherited

Definition at line 333 of file type_vector_test.h.

334  {
335  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(0)) , TOLERANCE*TOLERANCE );
336  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(1)) , TOLERANCE*TOLERANCE );
337  CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 , libmesh_real(((*basem_1_1_1)-(*basem_n1_1_n1))(2)) , TOLERANCE*TOLERANCE );
338  }
T libmesh_real(T a)
TypeVector< T > * basem_n1_1_n1
TypeVector< T > * basem_1_1_1
static const Real TOLERANCE
void TypeVectorTestBase< Node >::testZero ( )
inherited

Definition at line 93 of file type_vector_test.h.

94  {
95  DerivedClass avector(1,1,1);
96  avector.zero();
97 
98  CPPUNIT_ASSERT_EQUAL( T(0), avector(0));
99  CPPUNIT_ASSERT_EQUAL( T(0), avector(1));
100  CPPUNIT_ASSERT_EQUAL( T(0), avector(2));
101  }
void TypeVectorTestBase< Node >::testZeroBase ( )
inherited

Definition at line 241 of file type_vector_test.h.

242  {
243  TypeVector<T> avector((*basem_1_1_1));
244  avector.zero();
245 
246  CPPUNIT_ASSERT_EQUAL( T(0), avector(0));
247  CPPUNIT_ASSERT_EQUAL( T(0), avector(1));
248  CPPUNIT_ASSERT_EQUAL( T(0), avector(2));
249  }
TypeVector< T > * basem_1_1_1
This class defines a vector in LIBMESH_DIM dimensional space of type T.
Definition: tensor_tools.h:30

Member Data Documentation

Node* NodeTest::dof_object_instance
private

Definition at line 36 of file node_test.C.


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