Skip to content
Snippets Groups Projects
Commit c31445d1 authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Change the flag names to make them consistent with the BoundaryPatchFactory

The old flag names are still working but a dynamic deprecation warning is
printed to the user
parent 106e3182
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ void DirichletBCAssembler<GridType>::assembleDirichletBC(const GridType& grid, ...@@ -117,7 +117,7 @@ void DirichletBCAssembler<GridType>::assembleDirichletBC(const GridType& grid,
inflateBitField(*dummy.getVertices(),coarseDirichletNodes); inflateBitField(*dummy.getVertices(),coarseDirichletNodes);
else { else {
std::cout << "Warning: No *_dnFile found in the parameter set, unset all Dirichlet dofs!\n"; std::cout << "Warning: No *PatchFile found in the parameter set, unset all Dirichlet dofs!\n";
leafDirichletNodes.resize(grid.size(dim),false); leafDirichletNodes.resize(grid.size(dim),false);
leafDirichletValues.resize(grid.size(dim)); leafDirichletValues.resize(grid.size(dim));
leafDirichletValues = 0; leafDirichletValues = 0;
...@@ -125,16 +125,26 @@ void DirichletBCAssembler<GridType>::assembleDirichletBC(const GridType& grid, ...@@ -125,16 +125,26 @@ void DirichletBCAssembler<GridType>::assembleDirichletBC(const GridType& grid,
} }
// read values from amira file // read values from amira file
if (config.hasKey("amira_dvFile")) { if (config.hasKey("amiraValuesFile") or config.hasKey(("amira_dvFile"))) {
if (config.hasKey("amira_dvFile"))
Dune::dwarn << "Warning the flag 'amira_dvFile' has been deprecated in favour of 'amiraValuesFile'\n";
std::string fileName = (config.hasKey("amiraValuesFile")) ? "amiraValuesFile" : "amira_dvFile";
#if HAVE_AMIRAMESH #if HAVE_AMIRAMESH
Dune::AmiraMeshReader<GridType>::readFunction(coarseDirichletValues, path+config.get("amira_dvFile","")); Dune::AmiraMeshReader<GridType>::readFunction(coarseDirichletValues, path + fileName);
#else
DUNE_THROW(Dune::Exception, "You need libamiramesh if you want to read data in Amira format!");
#endif #endif
} }
// construct constant field // construct constant field
else if (config.hasKey("constant_dv")) { else if (config.hasKey("constantValues") or config.hasKey("constant_dv")) {
if (config.hasKey("constant_dv"))
Dune::dwarn << "Warning the flag 'constant_dv' has been deprecated in favour of 'constantValues'\n";
std::string flag = (config.hasKey("constantValues")) ? "constantValues" : "constant_dv";
using BlockType = typename VectorType::block_type; using BlockType = typename VectorType::block_type;
auto constant_dv = config.get<BlockType>("constant_dv"); auto constant_dv = config.get<BlockType>(flag);
for (size_t i=0; i<coarseDirichletValues.size(); i++) { for (size_t i=0; i<coarseDirichletValues.size(); i++) {
if (coarseDirichletNodes[i].any()) if (coarseDirichletNodes[i].any())
coarseDirichletValues[i] = constant_dv; coarseDirichletValues[i] = constant_dv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment