Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
fracture-flow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
benchmarks
fracture-flow
Commits
75070fbf
Commit
75070fbf
authored
8 years ago
by
Ivar Stefansson
Browse files
Options
Downloads
Patches
Plain Diff
Replace combine_faces.m
parent
228ab67c
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
scripts/combine_faces.m
+23
-23
23 additions, 23 deletions
scripts/combine_faces.m
with
23 additions
and
23 deletions
scripts/combine_faces.m
+
23
−
23
View file @
75070fbf
function
[
cell
_v
ertices
_o
n
,
vertices
_p
]
=
combine_faces
(
cell
_v
ertices
_o
n
,
vertices
_p
,
is
v
ertical
)
%
UNTITLED2
calculates the average of the two pressure values for the faces
% which coincide with the line
if
is
v
ertical
cell
_xory
=
sort
([
cell
_v
ertices
_o
n
(:,
2
),
cell
_v
ertices
_o
n
(:,
4
),],
2
);
else
cell
_xory
=
sort
([
cell
_v
ertices
_o
n
(:,
1
),
cell
_v
ertices
_o
n
(:,
3
),],
2
);
end
for
i
=
1
:
length
(
vertices
_p
)/
2
% two values for each face
ind
=
ismember
(
cell
_xory
(:,
1
),
cell
_xory
(
i
,
1
));
r
=
find
(
ind
);
n
=
length
(
ind
);
% remove the second cell
cell
_v
ertices
_o
n
=
[
cell
_v
ertices
_o
n
(
1
:
r
(
2
)
-
1
,:);
cell
_v
ertices
_o
n
(
r
(
2
)
+
1
:
n
,:)];
cell
_xory
=
[
cell
_xory
(
1
:
r
(
2
)
-
1
,:);
cell
_xory
(
r
(
2
)
+
1
:
n
,
:)];
% replace the first pressure by the mean of the two
vertices
_p
(
r
(
1
))
=
mean
(
vertices
_p
(
ind
));
% and remove the second one
vertices
_p
=
[
vertices
_p
(
1
:
r
(
2
)
-
1
);
vertices
_p
(
r
(
2
)
+
1
:
n
)];
end
end
function
[
cell
V
ertices
O
n
,
vertices
P
]
=
combine_faces
(
cell
V
ertices
O
n
,
vertices
P
,
is
V
ertical
)
%
combine_faces
calculates the average of the two pressure values for the faces
% which coincide with the line
if
is
V
ertical
cell
XOrY
=
sort
([
cell
V
ertices
O
n
(:,
2
),
cell
V
ertices
O
n
(:,
4
),],
2
);
else
cell
XOrY
=
sort
([
cell
V
ertices
O
n
(:,
1
),
cell
V
ertices
O
n
(:,
3
),],
2
);
end
for
i
=
1
:
length
(
vertices
P
)/
2
% two values for each face
ind
=
ismember
(
cell
XOrY
(:,
1
),
cell
XOrY
(
i
,
1
));
r
=
find
(
ind
);
n
=
length
(
ind
);
% remove the second cell
cell
V
ertices
O
n
=
[
cell
V
ertices
O
n
(
1
:
r
(
2
)
-
1
,:);
cell
V
ertices
O
n
(
r
(
2
)
+
1
:
n
,:)];
cell
XOrY
=
[
cell
XOrY
(
1
:
r
(
2
)
-
1
,:);
cell
XOrY
(
r
(
2
)
+
1
:
n
,
:)];
% replace the first pressure by the mean of the two
vertices
P
(
r
(
1
))
=
mean
(
vertices
P
(
ind
));
% and remove the second one
vertices
P
=
[
vertices
P
(
1
:
r
(
2
)
-
1
);
vertices
P
(
r
(
2
)
+
1
:
n
)];
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