Upload files to "Sheet5/Ex5_Second_Attempt"
.
This commit is contained in:
parent
f7c1e47d9c
commit
3d3a16c8e2
5 changed files with 138644 additions and 0 deletions
5
Sheet5/Ex5_Second_Attempt/ToDo.txt
Normal file
5
Sheet5/Ex5_Second_Attempt/ToDo.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
// Jan 15, 2019
|
||||||
|
|
||||||
|
geom.h:75 void SetValues(std::vector<double> &v) const; // GH: TODO with functor
|
||||||
|
Set vector values using a functor ff(x,y).
|
||||||
|
See solution in Progs/cds
|
||||||
41
Sheet5/Ex5_Second_Attempt/square.m
Normal file
41
Sheet5/Ex5_Second_Attempt/square.m
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
% Square:
|
||||||
|
% flatpak run org.octave.Octave <filename>
|
||||||
|
% or
|
||||||
|
% octave --no-window-system --no-gui -qf <filename>
|
||||||
|
|
||||||
|
clear all
|
||||||
|
clc
|
||||||
|
% %% L-shape
|
||||||
|
% g=[2 0 2 0 0 1 0; % #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
|
||||||
|
% 2 2 2 0 1 1 0;
|
||||||
|
% 2 2 1 1 0.5 1 0;
|
||||||
|
% 2 1 1 0.5 2 1 0;
|
||||||
|
% 2 1 0 2 2 1 0;
|
||||||
|
% 2 0 0 2 0 1 0]';
|
||||||
|
|
||||||
|
%% square
|
||||||
|
g=[2 0 1 0 0 1 0; % #vertices,v_1x, v_2x, v_1y, v_2y, subdomain_left, subdomain_right
|
||||||
|
2 1 1 0 1 1 0;
|
||||||
|
2 1 0 1 1 1 0;
|
||||||
|
2 0 0 1 0 1 0]';
|
||||||
|
|
||||||
|
[p,e,t] = initmesh(g,'hmax',0.01);
|
||||||
|
pdemesh(p,e,t)
|
||||||
|
|
||||||
|
%% GH
|
||||||
|
% output from <https://de.mathworks.com/help/pde/ug/initmesh.html initmesh>
|
||||||
|
%
|
||||||
|
% coordinates p: [2][nnode]
|
||||||
|
% connectivity t: [4][nelem] with t(4,:) are the subdomain numbers
|
||||||
|
% edges e: [7][nedges] boundary edges
|
||||||
|
% e([1,2],:) - start/end vertex of edge
|
||||||
|
% e([3,4],:) - start/end values
|
||||||
|
% e(5,:) - segment number
|
||||||
|
% e([6,7],:) - left/right subdomain
|
||||||
|
|
||||||
|
ascii_write_mesh( p, t, e, mfilename);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
% tmp=t(1:3,:)
|
||||||
|
|
||||||
138487
Sheet5/Ex5_Second_Attempt/square_100.txt
Normal file
138487
Sheet5/Ex5_Second_Attempt/square_100.txt
Normal file
File diff suppressed because it is too large
Load diff
95
Sheet5/Ex5_Second_Attempt/square_tiny.txt
Normal file
95
Sheet5/Ex5_Second_Attempt/square_tiny.txt
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
13
|
||||||
|
2
|
||||||
|
16
|
||||||
|
3
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0.5
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0.5
|
||||||
|
0.5
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0.5
|
||||||
|
0.4999999999999999
|
||||||
|
0.4999999999999999
|
||||||
|
0.3333333333333333
|
||||||
|
0.6666666666666666
|
||||||
|
0.6666666666666666
|
||||||
|
0.6666666666666666
|
||||||
|
0.6666666666666666
|
||||||
|
0.3333333333333333
|
||||||
|
0.3333333333333333
|
||||||
|
0.3333333333333333
|
||||||
|
8
|
||||||
|
1
|
||||||
|
13
|
||||||
|
5
|
||||||
|
2
|
||||||
|
12
|
||||||
|
6
|
||||||
|
3
|
||||||
|
11
|
||||||
|
7
|
||||||
|
4
|
||||||
|
10
|
||||||
|
1
|
||||||
|
5
|
||||||
|
13
|
||||||
|
10
|
||||||
|
8
|
||||||
|
13
|
||||||
|
2
|
||||||
|
6
|
||||||
|
12
|
||||||
|
3
|
||||||
|
7
|
||||||
|
11
|
||||||
|
4
|
||||||
|
8
|
||||||
|
10
|
||||||
|
12
|
||||||
|
9
|
||||||
|
13
|
||||||
|
10
|
||||||
|
9
|
||||||
|
11
|
||||||
|
7
|
||||||
|
10
|
||||||
|
11
|
||||||
|
11
|
||||||
|
9
|
||||||
|
12
|
||||||
|
6
|
||||||
|
11
|
||||||
|
12
|
||||||
|
9
|
||||||
|
10
|
||||||
|
13
|
||||||
|
5
|
||||||
|
12
|
||||||
|
13
|
||||||
|
8
|
||||||
|
1
|
||||||
|
5
|
||||||
|
5
|
||||||
|
2
|
||||||
|
2
|
||||||
|
6
|
||||||
|
6
|
||||||
|
3
|
||||||
|
3
|
||||||
|
7
|
||||||
|
7
|
||||||
|
4
|
||||||
|
4
|
||||||
|
8
|
||||||
|
8
|
||||||
|
1
|
||||||
16
Sheet5/Ex5_Second_Attempt/userset.cpp
Normal file
16
Sheet5/Ex5_Second_Attempt/userset.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include "userset.h"
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
|
||||||
|
double FunctF(double const x, double const y)
|
||||||
|
{
|
||||||
|
// return std::sin(3.14159*1*x)*std::sin(3.14159*1*y);
|
||||||
|
// return 16.0*1024. ;
|
||||||
|
// return (double)1.0 ;
|
||||||
|
return x * x * std::sin(2.5 * 3.14159 * y);
|
||||||
|
}
|
||||||
|
|
||||||
|
double FunctU(const double /* x */, double const /* y */)
|
||||||
|
{
|
||||||
|
return 1.0 ;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue