-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunTorsoPDE.m
36 lines (29 loc) · 1.24 KB
/
runTorsoPDE.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
clear all; close all;
load('torsoTetraMesh.mat')
load('ElementID2RegionID_1.mat')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% create torso pde model
torso_model = createpde();
% Geometry
geometryFromMesh(torso_model,triTorsoMesh.Points',triTorsoMesh.ConnectivityList',ElementID2RegionID);
generateMesh(torso_model); %clean up the mesh
figure
pdegplot(torso_model,'FaceLabels','on')
% PDESystemSize
% = 1 (which is the default)
% EquationCoeeficients-LaplaceEquation
specifyCoefficients(torso_model, 'm',0,...
'd',0,...
'c',1,...
'a',0,...
'f',0);
% Boundary Conditions
% Front patch faces ...
frontPatch = cellFaces(torso_model.Geometry,2,'external');
applyBoundaryCondition(torso_model,'dirichlet', 'Face', frontPatch, 'u', 100);
% Back patch faces ...
backPatch = cellFaces(torso_model.Geometry,3,'external');
applyBoundaryCondition(torso_model,'dirichlet', 'Face', backPatch, 'u', 0);
% solve pde
results = solvepde(torso_model);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%