Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dolfin_dic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
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
Admin message
GitLab upgrade completed. Current version is 17.8.2.
Show more breadcrumbs
ALVAREZ BARRIENTOS Felipe
dolfin_dic
Commits
035ba9cf
Commit
035ba9cf
authored
5 years ago
by
Martin Genet
Browse files
Options
Downloads
Patches
Plain Diff
Use dolfin::Array instead of double[]
parent
9aec4ae2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generated_image_expressions_cpp.py
+13
-11
13 additions, 11 deletions
generated_image_expressions_cpp.py
with
13 additions
and
11 deletions
generated_image_expressions_cpp.py
+
13
−
11
View file @
035ba9cf
...
...
@@ -47,20 +47,19 @@ class MyExpr : public Expression
unsigned int k_point;
unsigned int image_n_points;
mutable Array<double> X;
mutable Array<double> UX; // MG20190521: these guys cannot be public for some reason
mutable Array<double> x; // MG20190521: these guys cannot be public for some reason
mutable Array<double> x; // MG20190521: these guys cannot be public for some reason
mutable Array<double> ux;
double static_scaling;
mutable Array<double> X;
// double x[3];
double ux[
'''
+
str
(
im_dim
)
+
'''
];
double m[1];
double I[1];
vtkSmartPointer<vtkXMLImageDataReader> reader;
vtkSmartPointer<vtkImageData> image;
vtkSmartPointer<vtkDataArray> array_image_scalars;
vtkSmartPointer<vtkImageData> image_probed;
//
vtkSmartPointer<vtkImageData> image_probed;
// MG20190607: does not work for some reason
vtkSmartPointer<vtkDataArray> array_probed_mask;
vtkSmartPointer<vtkDataArray> array_probed_disp;
vtkSmartPointer<vtkImageInterpolator> interpolator;
...
...
@@ -75,13 +74,14 @@ public:
MyExpr():
Expression(),
X(3),
UX(
'''
+
str
(
im_dim
)
+
'''
),
x(3),
ux(
'''
+
str
(
im_dim
)
+
'''
),
reader(vtkSmartPointer<vtkXMLImageDataReader>::New()),
interpolator(vtkSmartPointer<vtkImageInterpolator>::New()),
warp(vtkSmartPointer<vtkWarpVector>::New()),
probe(vtkSmartPointer<vtkProbeFilter>::New()),
X(3),
UX(
'''
+
str
(
im_dim
)
+
'''
),
x(3)
probe(vtkSmartPointer<vtkProbeFilter>::New())
{
}
...
...
@@ -153,6 +153,9 @@ public:
void generate_image()
{
// std::cout <<
"
n_points =
"
<< ugrid->GetNumberOfPoints() << std::endl;
// std::cout <<
"
n_cells =
"
<< ugrid->GetNumberOfCells() << std::endl;
warp->SetInputData(ugrid);
warp->Update();
...
...
@@ -174,8 +177,7 @@ public:
else
{
image->GetPoint(k_point, x.data());
// image->GetPoint(k_point, x);
array_probed_disp->GetTuple(k_point, ux);
'''
+
(
'''
array_probed_disp->GetTuple(k_point, ux.data());
'''
+
(
'''
X[0] = x[0] - ux[0];
X[1] = x[1] - ux[1];
'''
)
*
(
im_dim
==
2
)
+
(
'''
X[0] = x[0] - ux[0];
...
...
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