Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_numerics
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
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
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_numerics
Commits
5e45e622
Commit
5e45e622
authored
5 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
LAtest DCPSE solver
parent
d4ee22da
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/DCPSE_op/DCPSE_op.hpp
+66
-0
66 additions, 0 deletions
src/DCPSE_op/DCPSE_op.hpp
src/DCPSE_op/DCPSE_op_test.cpp
+17
-1
17 additions, 1 deletion
src/DCPSE_op/DCPSE_op_test.cpp
with
83 additions
and
1 deletion
src/DCPSE_op/DCPSE_op.hpp
+
66
−
0
View file @
5e45e622
...
...
@@ -8,6 +8,72 @@
#ifndef DCPSE_OP_HPP_
#define DCPSE_OP_HPP_
template
<
typename
operand_type
>
class
Lap_node
{
operand_type
arg
;
public:
typedef
int
it_is_a_node
;
Lap_node
(
operand_type
&
arg
)
:
arg
(
arg
)
{}
};
class
Lap
{
public:
template
<
typename
operand_type
>
Lap_node
<
operand_type
>
operator
()(
operand_type
arg
)
{
return
Lap_node
<
operand_type
>
(
arg
);
}
};
template
<
typename
operand_type1
,
typename
operand_type2
>
class
plus
{
operand_type1
op1
;
operand_type2
op2
;
public:
typedef
int
it_is_a_node
;
plus
(
const
operand_type1
&
op1
,
const
operand_type2
&
op2
)
:
op1
(
op1
),
op2
(
op2
)
{}
void
value
()
{
//op1.value() + op.value;
}
};
class
Field
{
typedef
int
it_is_a_node
;
void
value
()
{
// add non zero
}
};
template
<
typename
operand_type1
,
typename
operand_type2
/*, typename sfinae=typename std::enable_if<
std::is_same<typename operand_type1::it_is_a_node,int>::value
>::type*/
>
plus
<
operand_type1
,
operand_type2
>
operator
+
(
const
operand_type1
&
op1
,
const
operand_type2
&
op2
)
{
return
plus
<
operand_type1
,
operand_type2
>
(
op1
,
op2
);
}
#endif
/* DCPSE_OP_HPP_ */
This diff is collapsed.
Click to expand it.
src/DCPSE_op/DCPSE_op_test.cpp
+
17
−
1
View file @
5e45e622
...
...
@@ -7,14 +7,30 @@
#define BOOST_TEST_DYN_LINK
#include
"util/util_debug.hpp"
#include
<boost/test/unit_test.hpp>
#include
<iostream>
#include
"DCPSE_op.hpp"
//template<typename T>
//struct Debug;
BOOST_AUTO_TEST_SUITE
(
dcpse_op_suite_tests
)
BOOST_AUTO_TEST_CASE
(
dcpse_op_tests
)
{
std
::
cout
<<
"TEST"
<<
std
::
endl
;
Lap
L
;
Field
F
;
auto
expr
=
L
(
L
(
F
))
+
L
(
F
)
+
F
;
std
::
cout
<<
demangle
(
typeid
(
decltype
(
expr
)).
name
())
<<
"
\n
"
;
//Debug<decltype(expr)> a;
typedef
decltype
(
expr
)
::
blabla
blabla
;
auto
err
=
L
+
L
;
}
BOOST_AUTO_TEST_SUITE_END
()
...
...
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