Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
e7de9a4d
There was an error fetching the commit references. Please try again later.
Commit
e7de9a4d
authored
7 years ago
by
fencl
Browse files
Options
Downloads
Patches
Plain Diff
finall change of inicialization for 2D
parent
48d2d42a
No related branches found
No related tags found
1 merge request
!1
Hamilton jacobi
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalMethodsBase_impl.h
+70
-12
70 additions, 12 deletions
...olvers/hamilton-jacobi/tnlDirectEikonalMethodsBase_impl.h
with
70 additions
and
12 deletions
src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalMethodsBase_impl.h
+
70
−
12
View file @
e7de9a4d
...
@@ -51,21 +51,23 @@ initInterface( const MeshFunctionType& input,
...
@@ -51,21 +51,23 @@ initInterface( const MeshFunctionType& input,
{
{
output[ cell.getIndex() ] = - ( h * c )/( c - input[ e ] );
output[ cell.getIndex() ] = - ( h * c )/( c - input[ e ] );
}*/
}*/
c
>=
0
?
output
[
cell
.
getIndex
()
]
=
(
h
*
c
)
/
(
c
-
input
[
e
]
)
:
output
[
cell
.
getIndex
()
]
=
output
[
cell
.
getIndex
()
]
=
-
(
h
*
c
)
/
(
c
-
input
[
e
]
);
c
>=
0
?
(
h
*
c
)
/
(
c
-
input
[
e
]
)
:
-
(
h
*
c
)
/
(
c
-
input
[
e
]
);
interfaceMap
[
cell
.
getIndex
()
]
=
true
;
interfaceMap
[
cell
.
getIndex
()
]
=
true
;
continue
;
continue
;
}
}
else
if
(
c
*
input
[
w
]
<=
0
)
if
(
c
*
input
[
w
]
<=
0
)
{
{
c
<=
0
?
output
[
cell
.
getIndex
()
]
=
(
h
*
c
)
/
(
c
-
input
[
e
]
)
:
output
[
cell
.
getIndex
()
]
=
output
[
cell
.
getIndex
()
]
=
-
(
h
*
c
)
/
(
c
-
input
[
e
]
);
c
>=
0
?
(
h
*
c
)
/
(
c
-
input
[
w
]
)
:
-
(
h
*
c
)
/
(
c
-
input
[
w
]
);
interfaceMap
[
cell
.
getIndex
()
]
=
true
;
interfaceMap
[
cell
.
getIndex
()
]
=
true
;
continue
;
continue
;
}
}
}
}
output
[
cell
.
getIndex
()
]
=
output
[
cell
.
getIndex
()
]
=
c
>
0
?
TypeInfo
<
RealType
>::
getMaxValue
()
:
c
>
0
?
TNL
::
TypeInfo
<
RealType
>::
getMaxValue
()
:
-
TypeInfo
<
RealType
>::
getMaxValue
();
-
TypeInfo
<
RealType
>::
getMaxValue
();
interfaceMap
[
cell
.
getIndex
()
]
=
false
;
interfaceMap
[
cell
.
getIndex
()
]
=
false
;
}
}
...
@@ -95,6 +97,16 @@ initInterface( const MeshFunctionType& input,
...
@@ -95,6 +97,16 @@ initInterface( const MeshFunctionType& input,
const
MeshType
&
mesh
=
input
.
getMesh
();
const
MeshType
&
mesh
=
input
.
getMesh
();
typedef
typename
MeshType
::
Cell
Cell
;
typedef
typename
MeshType
::
Cell
Cell
;
Cell
cell
(
mesh
);
Cell
cell
(
mesh
);
for
(
cell
.
getCoordinates
().
y
()
=
0
;
cell
.
getCoordinates
().
y
()
<
mesh
.
getDimensions
().
y
();
cell
.
getCoordinates
().
y
()
++
)
for
(
cell
.
getCoordinates
().
x
()
=
0
;
cell
.
getCoordinates
().
x
()
<
mesh
.
getDimensions
().
x
();
cell
.
getCoordinates
().
x
()
++
)
output
[
cell
.
getIndex
()
]
=
input
(
cell
)
>=
0
?
TypeInfo
<
RealType
>::
getMaxValue
()
:
-
TypeInfo
<
RealType
>::
getMaxValue
();
for
(
cell
.
getCoordinates
().
y
()
=
0
;
for
(
cell
.
getCoordinates
().
y
()
=
0
;
cell
.
getCoordinates
().
y
()
<
mesh
.
getDimensions
().
y
();
cell
.
getCoordinates
().
y
()
<
mesh
.
getDimensions
().
y
();
cell
.
getCoordinates
().
y
()
++
)
cell
.
getCoordinates
().
y
()
++
)
...
@@ -107,19 +119,65 @@ initInterface( const MeshFunctionType& input,
...
@@ -107,19 +119,65 @@ initInterface( const MeshFunctionType& input,
if
(
!
cell
.
isBoundaryEntity
()
)
if
(
!
cell
.
isBoundaryEntity
()
)
{
{
auto
neighbors
=
cell
.
getNeighborEntities
();
auto
neighbors
=
cell
.
getNeighborEntities
();
//
const RealType& hx = mesh.getSpaceSteps().x();
const
RealType
&
hx
=
mesh
.
getSpaceSteps
().
x
();
//
const RealType& hy = mesh.getSpaceSteps().y();
const
RealType
&
hy
=
mesh
.
getSpaceSteps
().
y
();
//const RealType& pom
;
Real
pom
=
0
;
const
IndexType
e
=
neighbors
.
template
getEntityIndex
<
1
,
0
>();
const
IndexType
e
=
neighbors
.
template
getEntityIndex
<
1
,
0
>();
const
IndexType
w
=
neighbors
.
template
getEntityIndex
<
-
1
,
0
>();
//
const IndexType w = neighbors.template getEntityIndex< -1, 0 >();
const
IndexType
n
=
neighbors
.
template
getEntityIndex
<
0
,
1
>();
const
IndexType
n
=
neighbors
.
template
getEntityIndex
<
0
,
1
>();
const
IndexType
s
=
neighbors
.
template
getEntityIndex
<
0
,
-
1
>();
//
const IndexType s = neighbors.template getEntityIndex< 0, -1 >();
if
(
c
*
input
[
e
]
<=
0
||
c
*
input
[
w
]
<=
0
||
/*
if( c * input[ e ] <= 0 || c * input[ w ] <= 0 ||
c * input[ n ] <= 0 || c * input[ s ] <= 0 )
c * input[ n ] <= 0 || c * input[ s ] <= 0 )
{
{
output[ cell.getIndex() ] = tnlTypeInfo< RealType >::getMaxValue();
output[ cell.getIndex() ] = tnlTypeInfo< RealType >::getMaxValue();
interfaceMap[ cell.getIndex() ] = true;
interfaceMap[ cell.getIndex() ] = true;
continue;
continue;
}*/
if
(
c
*
input
[
n
]
<=
0
)
{
if
(
c
>=
0
)
{
pom
=
(
hy
*
c
)
/
(
c
-
input
[
n
]);
if
(
output
[
cell
.
getIndex
()
]
>
pom
)
output
[
cell
.
getIndex
()
]
=
pom
;
output
[
n
]
=
(
hy
*
c
)
/
(
c
-
input
[
n
])
-
hy
;
}
else
{
pom
=
-
(
hy
*
c
)
/
(
c
-
input
[
n
]);
if
(
output
[
cell
.
getIndex
()
]
<
pom
)
output
[
cell
.
getIndex
()
]
=
pom
;
output
[
n
]
=
hy
-
(
hy
*
c
)
/
(
c
-
input
[
n
]);
}
interfaceMap
[
cell
.
getIndex
()
]
=
true
;
interfaceMap
[
n
]
=
true
;
continue
;
}
if
(
c
*
input
[
e
]
<=
0
)
{
if
(
c
>=
0
)
{
pom
=
(
hx
*
c
)
/
(
c
-
input
[
e
]);
if
(
output
[
cell
.
getIndex
()
]
>
pom
)
output
[
cell
.
getIndex
()
]
=
pom
;
pom
=
pom
-
hx
;
//output[ e ] = (hx * c)/( c - input[ e ]) - hx;
if
(
output
[
e
]
!=
0
&&
output
[
e
]
>=
pom
)
output
[
e
]
=
pom
;
}
else
{
pom
=
-
(
hx
*
c
)
/
(
c
-
input
[
e
]);
if
(
output
[
cell
.
getIndex
()
]
<
pom
)
output
[
cell
.
getIndex
()
]
=
pom
;
pom
=
pom
+
hx
;
//output[ e ] = hx - (hx * c)/( c - input[ e ]);
if
(
output
[
e
]
<
pom
)
output
[
e
]
=
pom
;
}
interfaceMap
[
cell
.
getIndex
()
]
=
true
;
interfaceMap
[
e
]
=
true
;
continue
;
}
}
}
}
output
[
cell
.
getIndex
()
]
=
output
[
cell
.
getIndex
()
]
=
...
...
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