Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
af57cde6
Commit
af57cde6
authored
3 years ago
by
Axelle Drouard
Browse files
Options
Downloads
Patches
Plain Diff
Fix theta and sum_theta. Add second member b=0 for Dirichlet BC.
parent
a13f7d36
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scheme/ScalarNodalScheme.cpp
+24
-8
24 additions, 8 deletions
src/scheme/ScalarNodalScheme.cpp
with
24 additions
and
8 deletions
src/scheme/ScalarNodalScheme.cpp
+
24
−
8
View file @
af57cde6
...
@@ -518,7 +518,7 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
...
@@ -518,7 +518,7 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
const
auto
&
cell_nodes
=
cell_to_node_matrix
[
cell_id
];
const
auto
&
cell_nodes
=
cell_to_node_matrix
[
cell_id
];
for
(
size_t
i_node
=
0
;
i_node
<
cell_nodes
.
size
();
++
i_node
)
{
for
(
size_t
i_node
=
0
;
i_node
<
cell_nodes
.
size
();
++
i_node
)
{
const
NodeId
node_id
=
cell_nodes
[
i_node
];
const
NodeId
node_id
=
cell_nodes
[
i_node
];
if
(
not
is_boundary_node
[
node_id
])
{
if
(
is_boundary_node
[
node_id
]
&&
not
node_is_corner
[
node_id
]
)
{
compute_theta
(
cell_id
,
i_node
)
=
dot
(
inverse
(
node_betar
[
node_id
])
*
Cjr
(
cell_id
,
i_node
),
v
[
node_id
]);
compute_theta
(
cell_id
,
i_node
)
=
dot
(
inverse
(
node_betar
[
node_id
])
*
Cjr
(
cell_id
,
i_node
),
v
[
node_id
]);
}
}
}
}
...
@@ -530,6 +530,7 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
...
@@ -530,6 +530,7 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
NodeValue
<
double
>
compute_sum_theta
{
mesh
->
connectivity
()};
NodeValue
<
double
>
compute_sum_theta
{
mesh
->
connectivity
()};
parallel_for
(
parallel_for
(
mesh
->
numberOfNodes
(),
PUGS_LAMBDA
(
NodeId
node_id
)
{
mesh
->
numberOfNodes
(),
PUGS_LAMBDA
(
NodeId
node_id
)
{
if
((
is_boundary_node
[
node_id
])
&&
(
not
node_is_corner
[
node_id
]))
{
const
auto
&
node_to_cell
=
node_to_cell_matrix
[
node_id
];
const
auto
&
node_to_cell
=
node_to_cell_matrix
[
node_id
];
const
auto
&
node_local_number_in_its_cell
=
node_local_numbers_in_their_cells
.
itemArray
(
node_id
);
const
auto
&
node_local_number_in_its_cell
=
node_local_numbers_in_their_cells
.
itemArray
(
node_id
);
compute_sum_theta
[
node_id
]
=
0
;
compute_sum_theta
[
node_id
]
=
0
;
...
@@ -538,6 +539,7 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
...
@@ -538,6 +539,7 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
const
size_t
i_node
=
node_local_number_in_its_cell
[
i_cell
];
const
size_t
i_node
=
node_local_number_in_its_cell
[
i_cell
];
compute_sum_theta
[
node_id
]
+=
theta
(
cell_id
,
i_node
);
compute_sum_theta
[
node_id
]
+=
theta
(
cell_id
,
i_node
);
}
}
}
});
});
return
compute_sum_theta
;
return
compute_sum_theta
;
}();
}();
...
@@ -627,6 +629,20 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
...
@@ -627,6 +629,20 @@ class ScalarNodalSchemeHandler::ScalarNodalScheme : public ScalarNodalSchemeHand
}
}
b
[
cell_id
]
+=
0.5
*
node_boundary_values
[
node_id
]
*
sum_mes_l
;
b
[
cell_id
]
+=
0.5
*
node_boundary_values
[
node_id
]
*
sum_mes_l
;
}
}
}
else
if
(
node_is_dirichlet
[
node_id
])
{
if
(
is_boundary_node
[
node_id
]
&&
(
not
node_is_corner
[
node_id
]))
{
for
(
size_t
i_cell
=
0
;
i_cell
<
node_to_cell
.
size
();
++
i_cell
)
{
const
CellId
cell_id
=
node_to_cell
[
i_cell
];
b
[
cell_id
]
+=
0
;
}
}
else
if
(
node_is_corner
[
node_id
])
{
for
(
size_t
i_cell
=
0
;
i_cell
<
node_to_cell
.
size
();
++
i_cell
)
{
const
CellId
cell_id
=
node_to_cell
[
i_cell
];
b
[
cell_id
]
+=
0
;
}
}
};
};
Vector
<
double
>
T
{
mesh
->
numberOfCells
()};
Vector
<
double
>
T
{
mesh
->
numberOfCells
()};
...
...
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