Skip to content
Snippets Groups Projects
Commit 24a7ea8e authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Make dirichlet conditions independent of the mesh

parent fecd02e0
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,7 @@ int main(int argc, char *argv[]) {
auto const solver_tolerance = parset.get<double>("solver.tolerance");
auto const refinements = parset.get<size_t>("grid.refinements");
double const refinement_factor = std::pow(2, refinements);
auto const verbose = parset.get<bool>("verbose");
Solver::VerbosityMode const verbosity =
......@@ -235,9 +236,11 @@ int main(int argc, char *argv[]) {
stiffnessMatrix.mmv(u4, b4);
// Apply Dirichlet condition
for (int i = 0; i < finestSize; ++i)
if (ignoreNodes[i].count() == dim)
if (ignoreNodes[i].count() == dim) {
functions.get("dirichletCondition")
.evaluate(h * run, u4_diff[i][0]);
u4_diff[i][0] /= refinement_factor;
}
for (int state_fpi = 0;
state_fpi < parset.get<int>("solver.tnnmg.fixed_point_iterations");
......
......@@ -14,9 +14,9 @@ class neumannCondition:
class dirichletCondition:
def __call__(self, x):
# return 0
fst = 3e-5
snd = 1e-5
trd = 3e-5
fst = 5e-4
snd = 2e-4
trd = 5e-4
if x < 1.0/3:
return fst
elif x < 2.0/3:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment