Skip to content
Snippets Groups Projects
Commit 8c97aa5d authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Use constructBoundaryDofs to find all dofs on the Dirichlet boundary

This prepares for a later switch to a second-order basis

[[Imported from SVN: r9656]]
parent 53629bf4
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
#include <dune/grid/io/file/gmshreader.hh>
#include <dune/fufem/boundarypatch.hh>
#include <dune/fufem/functiontools/boundarydofs.hh>
#include <dune/fufem/functionspacebases/p1nodalbasis.hh>
#include <dune/solvers/solvers/iterativesolver.hh>
......@@ -212,12 +213,14 @@ int main (int argc, char *argv[]) try
std::cout << "Neumann boundary has " << neumannBoundary.numFaces() << " faces\n";
BitSetVector<1> dirichletNodes(feBasis.size(), false);
constructBoundaryDofs(dirichletBoundary,feBasis,dirichletNodes);
BitSetVector<blocksize> dirichletNodes(feBasis.size(), false);
BitSetVector<blocksize> dirichletDofs(feBasis.size(), false);
for (size_t i=0; i<feBasis.size(); i++)
if (dirichletVertices[i][0])
if (dirichletNodes[i][0])
for (int j=0; j<5; j++)
dirichletNodes[i][j] = true;
dirichletDofs[i][j] = true;
// //////////////////////////
// Initial iterate
......@@ -285,7 +288,7 @@ int main (int argc, char *argv[]) try
solver.setup(*grid,
&assembler,
x,
dirichletNodes,
dirichletDofs,
tolerance,
maxTrustRegionSteps,
initialTrustRegionRadius,
......@@ -303,7 +306,7 @@ int main (int argc, char *argv[]) try
for (vIt=gridView.begin<dim>(); vIt!=vEndIt; ++vIt) {
int idx = indexSet.index(*vIt);
if (dirichletNodes[idx][0]) {
if (dirichletDofs[idx][0]) {
// Only the positions have Dirichlet values
dirichletValues(vIt->geometry().corner(0), x[idx].r,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment