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

[Problem] New loading

parent 60cb427d
No related branches found
No related tags found
No related merge requests found
import math
class neumannCondition: class neumannCondition:
def __call__(self, relativeTime): def __call__(self, relativeTime):
return 0 return 0
class velocityDirichletCondition: class velocityDirichletCondition:
def __call__(self, relativeTime): def __call__(self, relativeTime):
if relativeTime <= 0.25: finalVelocity = -5e-5
factor = 4*relativeTime; if relativeTime <= 0.1:
else: return finalVelocity * ( 1.0 - math.cos(relativeTime * math.pi / 0.1) ) / 2.0
factor = 1 return finalVelocity
return -5e-5 * factor
Functions = { Functions = {
'neumannCondition' : neumannCondition(), 'neumannCondition' : neumannCondition(),
......
...@@ -258,7 +258,7 @@ int main(int argc, char *argv[]) { ...@@ -258,7 +258,7 @@ int main(int argc, char *argv[]) {
{ {
double v_initial_const; double v_initial_const;
velocityDirichletFunction.evaluate(0.0, v_initial_const); velocityDirichletFunction.evaluate(0.0, v_initial_const);
assert(v_initial_const == 0.0); assert(std::abs(v_initial_const) < 1e-14);
} }
Vector vr_initial(fineVertexCount); Vector vr_initial(fineVertexCount);
vr_initial = 0.0; vr_initial = 0.0;
......
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