Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panzer: Resolved UVM issues for mixed poisson #9669

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,19 @@ template <typename EvalT,typename Traits>
void SineSolution<EvalT,Traits>::evaluateFields(typename Traits::EvalData workset)
{
using panzer::index_t;
for (index_t cell = 0; cell < workset.num_cells; ++cell) {
for (int point = 0; point < solution.extent_int(1); ++point) {
auto ip_coordinates = this->wda(workset).int_rules[ir_index]->ip_coordinates.get_static_view();
auto solution_v = solution.get_static_view();

const double & x = this->wda(workset).int_rules[ir_index]->ip_coordinates(cell,point,0);
const double & y = this->wda(workset).int_rules[ir_index]->ip_coordinates(cell,point,1);
const double & z = this->wda(workset).int_rules[ir_index]->ip_coordinates(cell,point,2);
Kokkos::parallel_for (workset.num_cells, KOKKOS_LAMBDA (const index_t cell) {
for (int point = 0; point < solution_v.extent_int(1); ++point) {

solution(cell,point) = std::sin(2.0*M_PI*x)*std::sin(2*M_PI*y)*std::sin(2.0*M_PI*z);
const double & x = ip_coordinates(cell,point,0);
const double & y = ip_coordinates(cell,point,1);
const double & z = ip_coordinates(cell,point,2);

solution_v(cell,point) = std::sin(2.0*M_PI*x)*std::sin(2*M_PI*y)*std::sin(2.0*M_PI*z);
}
}
});
}

//**********************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@ evaluateFields(panzer::Traits::EvalData workset)
// scaline field value only if the scaling parameter is specified, otherwise use 1.0
double scaling = (scaling_.size()>0) ? scaling_[fieldIndex] : 1.0;

for(unsigned i=0; i<field.extent(0);i++)
cellValue(i,0) = field(i,0,d);
auto cellValue_v = cellValue.get_static_view();
auto field_v = field.get_static_view();
Kokkos::parallel_for(field_v.extent(0), KOKKOS_LAMBDA (int i) {
cellValue_v(i,0) = field_v(i,0,d);
});
Kokkos::fence();

// add in vector value at d^th dimension
mesh_->setCellFieldData(fieldName,blockId,localCellIds,cellValue.get_view(),scaling);
Expand Down