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
81926f63
Commit
81926f63
authored
14 years ago
by
Marie Wilmet
Browse files
Options
Downloads
Patches
Plain Diff
Cas test BloodFlow 1D (Aorta+Bifurcation) .lua et .py
parent
bdd62177
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
+11
-12
11 additions, 12 deletions
Solver/function.cpp
Solver/function.h
+1
-0
1 addition, 0 deletions
Solver/function.h
with
12 additions
and
12 deletions
Solver/function.cpp
+
11
−
12
View file @
81926f63
...
@@ -599,27 +599,26 @@ class functionLua : public function {
...
@@ -599,27 +599,26 @@ class functionLua : public function {
#endif
#endif
// functionC
// functionC
void
functionC
::
buildLibraryFromFile
(
const
std
::
string
cfilename
,
const
std
::
string
libfilename
)
{
void
functionC
::
buildLibrary
(
std
::
string
code
,
std
::
string
filename
)
{
//todo use CMAKE_CXX_COMPILER
//todo use clean temporary file names
//todo work on windows :-)
//todo if DG_BUILD_DIR is not defined, use the directory used at compilation time
FILE
*
tmpSrc
=
fopen
(
"_tmpSrc.cpp"
,
"w"
);
fprintf
(
tmpSrc
,
"%s
\n
"
,
code
.
c_str
());
fclose
(
tmpSrc
);
FILE
*
tmpMake
=
fopen
(
"_tmpMake"
,
"w"
);
FILE
*
tmpMake
=
fopen
(
"_tmpMake"
,
"w"
);
fprintf
(
tmpMake
,
"include $(DG_BUILD_DIR)/CMakeFiles/dg.dir/flags.make
\n
"
fprintf
(
tmpMake
,
"include $(DG_BUILD_DIR)/CMakeFiles/dg.dir/flags.make
\n
"
"%s : %s
\n
"
"%s : %s
\n
"
"
\t
g++ -fPIC -shared -o $@ $(CXX_FLAGS) $(CXX_DEFINES) $<
\n
"
,
"
\t
g++ -fPIC -shared -o $@ $(CXX_FLAGS) $(CXX_DEFINES) $<
\n
"
,
filename
.
c_str
(),
"_tmpSrc.cpp"
);
lib
filename
.
c_str
(),
cfilename
.
c_str
()
);
fclose
(
tmpMake
);
fclose
(
tmpMake
);
if
(
system
(
"make -f _tmpMake"
))
if
(
system
(
"make -f _tmpMake"
))
Msg
::
Error
(
"make command failed
\n
"
);
Msg
::
Error
(
"make command failed
\n
"
);
UnlinkFile
(
"_tmpSrc.cpp"
);
UnlinkFile
(
"_tmpMake.cpp"
);
UnlinkFile
(
"_tmpMake.cpp"
);
}
}
void
functionC
::
buildLibrary
(
std
::
string
code
,
std
::
string
filename
)
{
FILE
*
tmpSrc
=
fopen
(
"_tmpSrc.cpp"
,
"w"
);
fprintf
(
tmpSrc
,
"%s
\n
"
,
code
.
c_str
());
fclose
(
tmpSrc
);
buildLibraryFromFile
(
"_tmpSrc.cpp"
,
filename
);
UnlinkFile
(
"_tmpSrc.cpp"
);
}
void
functionC
::
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
void
functionC
::
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
{
{
switch
(
args
.
size
())
{
switch
(
args
.
size
())
{
...
...
This diff is collapsed.
Click to expand it.
Solver/function.h
+
1
−
0
View file @
81926f63
...
@@ -285,6 +285,7 @@ class functionC : public function {
...
@@ -285,6 +285,7 @@ class functionC : public function {
void
(
*
callback
)(
void
);
void
(
*
callback
)(
void
);
public:
public:
static
void
buildLibrary
(
std
::
string
code
,
std
::
string
filename
)
;
static
void
buildLibrary
(
std
::
string
code
,
std
::
string
filename
)
;
static
void
buildLibraryFromFile
(
const
std
::
string
cfilename
,
const
std
::
string
libfilename
);
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
;
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
;
functionC
(
std
::
string
file
,
std
::
string
symbol
,
int
nbCol
,
functionC
(
std
::
string
file
,
std
::
string
symbol
,
int
nbCol
,
std
::
vector
<
const
function
*>
dependencies
);
std
::
vector
<
const
function
*>
dependencies
);
...
...
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