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
55328782
Commit
55328782
authored
8 years ago
by
Ivar Stefansson
Browse files
Options
Downloads
Patches
Plain Diff
Delete LineNorm.m
parent
876f6d3d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/LineNorm.m
+0
-127
0 additions, 127 deletions
scripts/LineNorm.m
with
0 additions
and
127 deletions
scripts/LineNorm.m
deleted
100644 → 0
+
0
−
127
View file @
876f6d3d
coarsefile
=
'../new_case_4/results/bernd_dfm_lefttoright.mat'
;
load
(
coarsefile
);
%load 'coarse file.mat'
X
=
Points
;
FRAC
=
true
;
if
FRAC
% i = 2; %fracture identity
Xp
=
fracxandp
{
i
};
% The fracture information has here the format
endpoints
=
[
Xp
(
1
,
1
:
2
);
Xp
(
end
,
1
:
2
)];
% [x1(c) y1(c) p(c); x2(c) y2(c) p(c)] for cell c in position
% Xp(2*c-1:2*c, :), the coordinates being the vertices of the fracture.
end
%load geiger_permeable_reference.mat
load
anna_reference_lefttoright
.
mat
% Both the "coarse" and "fine" input files are assumed to have a triangulation
% CELL t with one (number of vertices of the cell) x 1 pointer to the points
% x of each grid cell and vector p for pressure in each cell (length(p) ==
% length(t)). In case a fracture is being evaluated, the only coarse
% simulation information needed is fracxandp, a cell containing the
% pressure and coordinate information for each fracture.
% Capital Letters Indicate The Coarse Grid.
boundary_line
=
false
;
%segment = [endpoints(1),endpoints(2,1)];
segment
=
[
1
,
1
];
% assign two identical values for the whole cross-section of
% the domain. Assign x values for the endpoints of the desired segment
% unless the line is vertical, in which case the two y values should be
% provided.
% NOTE the segments are assumed to be chosen so that the cells end at the
% endpoints (fracture endpoints, in our case). If not, only the part of the
% line that is covered by coarse and fine cells lying in the interior of
% the segment is evaluated.
if
endpoints
(
1
)
==
endpoints
(
2
)
a
=
endpoints
(
1
);
b
=
0
;
isvertical
=
true
;
if
segment
(
1
)
==
segment
(
2
)
fracture_length
=
abs
(
endpoints
(
3
)
-
endpoints
(
4
));
else
fracture_length
=
abs
(
segment
(
1
)
-
segment
(
2
));
end
else
a
=
(
endpoints
(
2
,
2
)
-
endpoints
(
1
,
2
))
/
(
endpoints
(
2
,
1
)
-
endpoints
(
1
,
1
));
b
=
endpoints
(
1
,
2
)
-
a
*
endpoints
(
1
,
1
);
isvertical
=
false
;
if
segment
(
1
)
==
segment
(
2
)
fracture_length
=
hypot
(
abs
(
endpoints
(
1
)
-
endpoints
(
2
)),
...
abs
(
endpoints
(
3
)
-
endpoints
(
4
)));
else
fracture_length
=
hypot
(
abs
(
segment
(
1
)
-
segment
(
2
)),
...
abs
(
endpoints
(
3
)
-
endpoints
(
4
)));
end
end
[
nw
,
vertices_on
]
=
check_points
(
x
,
a
,
b
,
isvertical
);
if
~
FRAC
[
Nw
,
Vertices_on
]
=
check_points
(
X
,
a
,
b
,
isvertical
);
end
%must unfortunately allow for cells with different number of vertices both
%for fine grid (Bernd uses both for the hydrocoin case, at least) and coarse.
% Therefore, cell_points_on is a CELL with nvertices(c) pointer extracted
%from t. c_p_nw_on is the corresponding logical nw cell.
[
cell_points_on
,
p_on
,
c_p_nw_on
,
cell_vertices_on
,
vertices_p
]
=
...
extract_on_line
(
t
,
x
,
nw
,
vertices_on
,
p
);
if
~
FRAC
[
Cell_points_on
,
P_on
,
C_p_nw_on
,
Cell_vertices_on
,
Vertices_p
]
=
...
extract_on_line
(
T
,
X
,
Nw
,
Vertices_on
,
P
);
else
Cell_vertices_on
=
[];
Vertices_p
=
[];
end
if
~
boundary_line
&&
~
isempty
(
cell_vertices_on
)
[
cell_vertices_on
,
vertices_p
]
=
combine_faces
(
cell_vertices_on
,
vertices_p
,
isvertical
);
end
if
~
boundary_line
&&
~
isempty
(
Cell_vertices_on
)
[
Cell_vertices_on
,
Vertices_p
]
=
combine_faces
(
Cell_vertices_on
,
Vertices_p
,
isvertical
);
end
% find the points where the line intersects each of the fine and coarse
% cells, respectively. Format intersectionpoints(c) = [x1,y1,x2,y2] for the
% two points for cell c.
[
intersectionpoints
]
=
intersections_of_cells
(
endpoints
,
isvertical
,
...
cell_points_on
,
c_p_nw_on
);
if
FRAC
n
=
length
(
Xp
);
ind_two
=
linspace
(
2
,
n
,
n
/
2
);
ind_one
=
ind_two
-
1
;
Intersectionpoints
=
[
Xp
(
ind_one
,
1
:
2
),
Xp
(
ind_two
,
1
:
2
)];
P_on
=
Xp
(
ind_two
,
3
);
else
[
Intersectionpoints
]
=
intersections_of_cells
(
endpoints
,
isvertical
,
...
Cell_points_on
,
C_p_nw_on
);
end
% Add the values for the faces coinciding with the line:
if
~
isempty
(
cell_vertices_on
)
intersectionpoints
=
[
intersectionpoints
;
cell_vertices_on
];
p_on
=
[
p_on
;
vertices_p
];
end
if
~
isempty
(
Cell_vertices_on
)
Intersectionpoints
=
[
Intersectionpoints
;
Cell_vertices_on
];
P_on
=
[
P_on
;
Vertices_p
];
end
% Loop through large cells, find smalls cells (partly) inside and evaluate
% norms
[
E2
]
=
evaluate_norm
(
Intersectionpoints
,
intersectionpoints
,
P_on
,
p_on
,
isvertical
,
segment
);
dP2
=
(
max
(
p
)
-
min
(
p
))
^
2
*
fracture_length
;
Erel
=
sqrt
(
E2
)/
sqrt
(
dP2
)
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