-- FreeFem++ v4.6 (Thu Apr 2 15:47:38 CEST 2020 - git v4.6) Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // Discussion: 2 : // 3 : // Vortex caused by free convection 4 : // 5 : // Solves the Laplace Equation on a parallel plate capacitor boundary. 6 : // P1 Elements are used. 7 : // 8 : // Export the data, using ffmatlib, for graphic processing by MATLAB or Octave. 9 : // 10 : // Licensing: 11 : // 12 : // Copyright (C) 2018 Chloros2 13 : // 14 : // This program is free software: you can redistribute it and/or modify it 15 : // under the terms of the GNU General Public License as published by 16 : // the Free Software Foundation, either version 3 of the License, or 17 : // (at your option) any later version. 18 : // 19 : // This program is distributed in the hope that it will be useful, but 20 : // WITHOUT ANY WARRANTY; without even the implied warranty of 21 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 : // GNU General Public License for more details. 23 : // 24 : // You should have received a copy of the GNU General Public License 25 : // along with this program. If not, see 26 : // . 27 : // 28 : // Modified: 29 : // 30 : // 2018-05-19 31 : // 32 : // Author: 33 : // 34 : // Chloros2 35 : // 36 : // Local: 37 : // 38 : // real dt, the time step. 39 : // 40 : // real g, gravitational coefficient. 41 : // 42 : // real Tcold, the temperature of the cold wall, in centigrade. 43 : // 44 : // real tend, the final time. 45 : // 46 : // real Thot, the temperature of the hot wall, in centigrade. 47 : // 48 : include "ffmatlib.idp"/*ffmatlib.idp Export Macros (Plot Solutions for Matlab and Octave) 2 : * 3 : * Author: Chloros2 4 : * Created: 2018-12-21 5 : * 6 : * This file is part of the ffmatlib which is hosted at 7 : * https://github.com/samplemaker/freefem_matlab_octave_plot 8 : * 9 : * Copyright (C) 2018 Chloros2 10 : * 11 : * This program is free software: you can redistribute it and/or modify it 12 : * under the terms of the GNU General Public License as published by 13 : * the Free Software Foundation, either version 3 of the License, or 14 : * (at your option) any later version. 15 : * 16 : * This program is distributed in the hope that it will be useful, but 17 : * WITHOUT ANY WARRANTY; without even the implied warranty of 18 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 : * GNU General Public License for more details. 20 : * 21 : * You should have received a copy of the GNU General Public License 22 : * along with this program. If not, see 23 : * . 24 : * 25 : */ 26 : 27 : //Save finite element connectivity (j-th degree of freedom for i-th element) 28 : macro ffSaveVh(Th, Vh, filename){ 29 # { 30 # ofstream file(filename); 31 # file.precision(10); 32 # for (int i=0; i