Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matlab-pdeutils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graeser
matlab-pdeutils
Commits
1d2b8ec8
Commit
1d2b8ec8
authored
8 years ago
by
tokies
Browse files
Options
Downloads
Patches
Plain Diff
* Added documentation for plotGridFunction.
* Added error in case of dimension != 2.
parent
ab5e26b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pdeutils/functions/plotGridFunction.m
+18
-5
18 additions, 5 deletions
pdeutils/functions/plotGridFunction.m
with
18 additions
and
5 deletions
pdeutils/functions/plotGridFunction.m
+
18
−
5
View file @
1d2b8ec8
function
plotGridFunction
(
grid
,
basis
,
u
)
function
plotGridFunction
(
grid
,
basis
,
u
)
%plotGridFunction Plots a discrete finite element function.
% WARNING:
% Currently this function only works with the nodal P1/Q1 bases.
%
% Inputs:
% grid Grid of the finite element space.
% basis Basis of the finite element space.
% u Vector representation of discrete function with respect
% to the given basis and grid.
%
dim
=
size
(
grid
.
nodes
,
1
);
dim
=
size
(
grid
.
nodes
,
1
);
if
(
dim
==
2
)
if
(
dim
==
2
)
% referenceElement = generateGrid([0 0; 1 0; 0 1]', [1 2 3]');
n_nodes
=
size
(
grid
.
nodes
,
2
);
trisurf
(
grid
.
elements
(
1
:
3
,:)
', grid.nodes(1,:)'
,
grid
.
nodes
(
2
,:)
'
,
u
(
1
:
n_nodes
),
u
(
1
:
n_nodes
));
else
error
(
'Plotting in dim=%d is not supported.'
,
...
dim
);
end
n_nodes
=
size
(
grid
.
nodes
,
2
);
trisurf
(
grid
.
elements
(
1
:
3
,:)
', grid.nodes(1,:)'
,
grid
.
nodes
(
2
,:)
'
,
u
(
1
:
n_nodes
),
u
(
1
:
n_nodes
));
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment