void TestDefineZeroDirichletOnMeshBoundary() { // Load a 2D square mesh with 1 central non-boundary node TrianglesMeshReader<2,2> mesh_reader("mesh/test/data/square_4_elements"); TetrahedralMesh<2,2> mesh; mesh.ConstructFromMeshReader(mesh_reader); BoundaryConditionsContainer<2,2,1> bcc; bcc.DefineZeroDirichletOnMeshBoundary(&mesh); // Check boundary nodes have the right condition for (int i=0; i<4; i++) { double value = bcc.GetDirichletBCValue(mesh.GetNode(i)); TS_ASSERT_DELTA(value, 0.0, 1e-12); } // Check non-boundary node has no condition TS_ASSERT(!bcc.HasDirichletBoundaryCondition(mesh.GetNode(4))); }