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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
260d0871
Commit
260d0871
authored
13 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
function : do not invalidate constant function on setElement
parent
a2739f4c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/function.cpp
+9
-7
9 additions, 7 deletions
Solver/function.cpp
Solver/function.h
+1
-0
1 addition, 0 deletions
Solver/function.h
with
10 additions
and
7 deletions
Solver/function.cpp
+
9
−
7
View file @
260d0871
...
@@ -325,17 +325,19 @@ dataCacheMap::~dataCacheMap()
...
@@ -325,17 +325,19 @@ dataCacheMap::~dataCacheMap()
void
dataCacheMap
::
setNbEvaluationPoints
(
int
nbEvaluationPoints
)
void
dataCacheMap
::
setNbEvaluationPoints
(
int
nbEvaluationPoints
)
{
{
if
(
_nbEvaluationPoints
==
nbEvaluationPoints
)
for
(
std
::
list
<
dataCacheMap
*>::
iterator
it
=
_children
.
begin
();
it
!=
_children
.
end
();
it
++
)
{
(
*
it
)
->
setNbEvaluationPoints
(
nbEvaluationPoints
);
}
if
(
_nbEvaluationPoints
==
nbEvaluationPoints
)
{
for
(
std
::
set
<
dataCacheDouble
*>::
iterator
it
=
_allDataCaches
.
begin
();
it
!=
_allDataCaches
.
end
();
it
++
)
(
*
it
)
->
_valid
=
false
;
return
;
return
;
}
_nbEvaluationPoints
=
nbEvaluationPoints
;
_nbEvaluationPoints
=
nbEvaluationPoints
;
for
(
std
::
set
<
dataCacheDouble
*>::
iterator
it
=
_allDataCaches
.
begin
();
for
(
std
::
set
<
dataCacheDouble
*>::
iterator
it
=
_allDataCaches
.
begin
();
it
!=
_allDataCaches
.
end
();
it
++
){
it
!=
_allDataCaches
.
end
();
it
++
){
(
*
it
)
->
resize
(
nbEvaluationPoints
);
(
*
it
)
->
resize
(
nbEvaluationPoints
);
}
}
for
(
std
::
list
<
dataCacheMap
*>::
iterator
it
=
_children
.
begin
();
it
!=
_children
.
end
();
it
++
)
{
(
*
it
)
->
setNbEvaluationPoints
(
nbEvaluationPoints
);
}
}
}
// Some examples of functions
// Some examples of functions
...
@@ -356,14 +358,14 @@ void functionConstant::call(dataCacheMap *m, fullMatrix<double> &val)
...
@@ -356,14 +358,14 @@ void functionConstant::call(dataCacheMap *m, fullMatrix<double> &val)
val
(
i
,
j
)
=
_source
(
j
,
0
);
val
(
i
,
j
)
=
_source
(
j
,
0
);
}
}
functionConstant
::
functionConstant
(
std
::
vector
<
double
>
source
)
:
function
(
source
.
size
())
functionConstant
::
functionConstant
(
std
::
vector
<
double
>
source
)
:
function
(
source
.
size
()
,
false
)
{
{
_source
=
fullMatrix
<
double
>
(
source
.
size
(),
1
);
_source
=
fullMatrix
<
double
>
(
source
.
size
(),
1
);
for
(
size_t
i
=
0
;
i
<
source
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
source
.
size
();
i
++
)
_source
(
i
,
0
)
=
source
[
i
];
_source
(
i
,
0
)
=
source
[
i
];
}
}
functionConstant
::
functionConstant
(
double
source
)
:
function
(
1
)
functionConstant
::
functionConstant
(
double
source
)
:
function
(
1
,
false
)
{
{
_source
.
resize
(
1
,
1
);
_source
.
resize
(
1
,
1
);
_source
(
0
,
0
)
=
source
;
_source
(
0
,
0
)
=
source
;
...
...
This diff is collapsed.
Click to expand it.
Solver/function.h
+
1
−
0
View file @
260d0871
...
@@ -164,6 +164,7 @@ class dataCacheDouble {
...
@@ -164,6 +164,7 @@ class dataCacheDouble {
void
_eval
();
void
_eval
();
void
resize
(
int
nrow
);
void
resize
(
int
nrow
);
public:
public:
inline
function
*
getFunction
()
{
return
_function
;}
//set the value (without computing it by _eval) and invalidate the
//set the value (without computing it by _eval) and invalidate the
// dependencies this function is needed to be able to pass the
// dependencies this function is needed to be able to pass the
// _value to functions like gemm or mult but you cannot keep the
// _value to functions like gemm or mult but you cannot keep the
...
...
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