Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
a6982eac
Commit
a6982eac
authored
14 years ago
by
Emilie Marchandise
Browse files
Options
Downloads
Patches
Plain Diff
Bench multiphase
parent
1a752768
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/function.cpp
+59
-0
59 additions, 0 deletions
Solver/function.cpp
Solver/function.h
+2
-1
2 additions, 1 deletion
Solver/function.h
with
61 additions
and
1 deletion
Solver/function.cpp
+
59
−
0
View file @
a6982eac
...
...
@@ -417,6 +417,65 @@ function *functionSumNew(const function *f0, const function *f1)
return
new
functionSum
(
f0
,
f1
);
}
// functionLevelset
class
functionLevelset
:
public
function
{
public:
fullMatrix
<
double
>
_f0
;
double
_valMin
,
_valPlus
;
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
{
for
(
int
i
=
0
;
i
<
val
.
size1
();
i
++
)
for
(
int
j
=
0
;
j
<
val
.
size2
();
j
++
){
val
(
i
,
j
)
=
_valPlus
;
if
(
_f0
(
i
,
j
)
<
0.0
)
val
(
i
,
j
)
=
_valMin
;
}
}
functionLevelset
(
const
function
*
f0
,
const
double
valMin
,
const
double
valPlus
)
:
function
(
f0
->
getNbCol
())
{
setArgument
(
_f0
,
f0
);
_valMin
=
valMin
;
_valPlus
=
valPlus
;
}
};
function
*
functionLevelsetNew
(
const
function
*
f0
,
const
double
valMin
,
const
double
valPlus
)
{
return
new
functionLevelset
(
f0
,
valMin
,
valPlus
);
}
class
functionLevelsetSmooth
:
public
function
{
public:
fullMatrix
<
double
>
_f0
;
double
_valMin
,
_valPlus
,
_E
;
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
{
for
(
int
i
=
0
;
i
<
val
.
size1
();
i
++
)
for
(
int
j
=
0
;
j
<
val
.
size2
();
j
++
){
double
phi
=
_f0
(
i
,
j
);
double
Heps
=
0.5
+
0.5
*
phi
/
_E
+
0.5
/
3.14
*
sin
(
3.14
*
phi
/
_E
);
if
(
fabs
(
phi
)
<
_E
)
val
(
i
,
j
)
=
Heps
*
_valPlus
+
(
1
-
Heps
)
*
_valMin
;
else
if
(
phi
>
_E
)
val
(
i
,
j
)
=
_valPlus
;
else
if
(
phi
<
-
_E
)
val
(
i
,
j
)
=
_valMin
;
}
}
functionLevelsetSmooth
(
const
function
*
f0
,
const
double
valMin
,
const
double
valPlus
,
const
double
E
)
:
function
(
f0
->
getNbCol
())
{
setArgument
(
_f0
,
f0
);
_valMin
=
valMin
;
_valPlus
=
valPlus
;
_E
=
E
;
}
};
function
*
functionLevelsetSmoothNew
(
const
function
*
f0
,
const
double
valMin
,
const
double
valPlus
,
const
double
E
)
{
return
new
functionLevelsetSmooth
(
f0
,
valMin
,
valPlus
,
E
);
}
// functionProd
class
functionProd
:
public
function
{
...
...
This diff is collapsed.
Click to expand it.
Solver/function.h
+
2
−
1
View file @
a6982eac
...
...
@@ -291,7 +291,8 @@ class functionC : public function {
functionC
(
std
::
string
file
,
std
::
string
symbol
,
int
nbCol
,
std
::
vector
<
const
function
*>
dependencies
);
};
function
*
functionLevelsetNew
(
const
function
*
f0
,
const
double
valMin
,
const
double
valPlus
);
function
*
functionLevelsetSmoothNew
(
const
function
*
f0
,
const
double
valMin
,
const
double
valPlus
,
const
double
E
);
function
*
functionSumNew
(
const
function
*
f0
,
const
function
*
f1
);
function
*
functionProdNew
(
const
function
*
f0
,
const
function
*
f1
);
function
*
functionScaleNew
(
const
function
*
f0
,
const
double
s
);
...
...
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