[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] (no subject)
From: |
Tetsuo Koyama |
Subject: |
[Getfem-commits] (no subject) |
Date: |
Fri, 31 May 2019 20:18:41 -0400 (EDT) |
branch: devel-tetsuo-houbolt
commit 16bd11b108d2dc50a9fc90e6d465654c4d43f8e0
Author: Tetsuo Koyama <address@hidden>
Date: Sat Jun 1 09:16:32 2019 +0900
Add Houbolt method tests
---
interface/tests/python/demo_wave_equation.py | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/interface/tests/python/demo_wave_equation.py
b/interface/tests/python/demo_wave_equation.py
index ace88eb..bfad86b 100644
--- a/interface/tests/python/demo_wave_equation.py
+++ b/interface/tests/python/demo_wave_equation.py
@@ -2,8 +2,8 @@
# -*- coding: UTF8 -*-
# Python GetFEM++ interface
#
-# Copyright (C) 2015-2017 FABRE Mathieu, SECK Mamadou, DALLERIT Valentin,
-# Yves Renard.
+# Copyright (C) 2015-2019 FABRE Mathieu, SECK Mamadou, DALLERIT Valentin,
+# Yves Renard, Tetsuo Koyama.
#
# This file is a part of GetFEM++
#
@@ -54,8 +54,11 @@ V0 = 0.*U0
md=gf.Model('real');
md.add_fem_variable('u', mf);
+md.add_fem_variable('u1', mf);
md.add_Laplacian_brick(mim, 'u');
+md.add_Laplacian_brick(mim, 'u1');
md.add_Dirichlet_condition_with_multipliers(mim, 'u', mf, 1);
+md.add_Dirichlet_condition_with_multipliers(mim, 'u1', mf, 1);
# md.add_Dirichlet_condition_with_penalization(mim, 'u', 1E9, 1);
# md.add_Dirichlet_condition_with_simplification('u', 1);
@@ -66,12 +69,17 @@ beta = 0.25;
gamma = 0.5;
md.add_Newmark_scheme('u', beta, gamma)
+md.add_Houbolt_scheme('u1')
md.add_mass_brick(mim, 'Dot2_u')
+md.add_mass_brick(mim, 'Dot2_u1')
md.set_time_step(dt)
## Initial data.
md.set_variable('Previous_u', U0)
md.set_variable('Previous_Dot_u', V0)
+md.set_variable('Previous_u1', U0)
+md.set_variable('Previous2_u1', U0)
+md.set_variable('Previous3_u1', U0)
## Initialisation of the acceleration 'Previous_Dot2_u'
md.perform_init_time_derivative(dt/2.)
@@ -85,6 +93,13 @@ mf.export_to_vtk('results/displacement_0.vtk', U0)
mf.export_to_vtk('results/velocity_0.vtk', V0)
mf.export_to_vtk('results/acceleration_0.vtk', A0)
+A0 = 0.*U0
+
+os.system('mkdir results1');
+mf.export_to_vtk('results1/displacement_0.vtk', U0)
+mf.export_to_vkt('results1/velocity_0.vtk', V0)
+mf.export_to_vtk('results1/acceleration_0.vtk', A0)
+
## Iterations
n = 1;
for t in np.arange(0.,T,dt):
@@ -98,6 +113,14 @@ for t in np.arange(0.,T,dt):
mf.export_to_vtk('results/velocity_%d.vtk' % n, V)
mf.export_to_vtk('results/acceleration_%d.vtk' % n, A)
+ U = md.variable('u1')
+ V = md.variable('Dot_u1')
+ A = md.variable('Dot2_u1')
+
+ mf.export_to_vtk('results1/displacement_%d.vtk' % n, U)
+ mf.export_to_vtk('results1/velocity_%d.vtk' % n, V)
+ mf.export_to_vtk('results1/acceleration_%d.vtk' % n, A)
+
n += 1
md.shift_variables_for_time_integration()