| 1641 | } |
| 1642 | |
| 1643 | void vtkNek5000Reader::copyContinuumData(vtkUnstructuredGrid* pv_ugrid) |
| 1644 | { |
| 1645 | #ifndef NDEBUG |
| 1646 | int my_rank; |
| 1647 | vtkMultiProcessController* ctrl = vtkMultiProcessController::GetGlobalController(); |
| 1648 | if (ctrl != nullptr) |
| 1649 | { |
| 1650 | my_rank = ctrl->GetLocalProcessId(); |
| 1651 | } |
| 1652 | else |
| 1653 | { |
| 1654 | my_rank = 0; |
| 1655 | } |
| 1656 | #endif |
| 1657 | int index = 0; |
| 1658 | int num_verts = this->myNumBlocks * this->totalBlockSize; |
| 1659 | |
| 1660 | // for each variable |
| 1661 | for (auto v_index = 0; v_index < this->num_vars; v_index++) |
| 1662 | { |
| 1663 | if (this->GetPointArrayStatus(v_index)) |
| 1664 | { |
| 1665 | // if this is a scalar |
| 1666 | if (this->var_length[v_index] == 1) |
| 1667 | { |
| 1668 | index = 0; |
| 1669 | vtkFloatArray* scalars = vtkFloatArray::New(); |
| 1670 | // scalars->SetNumberOfComponents(1); |
| 1671 | // scalars->SetNumberOfTuples(num_verts); |
| 1672 | scalars->SetName(this->var_names[v_index]); |
| 1673 | scalars->SetArray( |
| 1674 | this->dataArray[v_index], num_verts, 0, vtkDataArray::VTK_DATA_ARRAY_DELETE); |
| 1675 | /* |
| 1676 | for (int b_index = 0; b_index < this->myNumBlocks; ++b_index) |
| 1677 | { |
| 1678 | for (int p_index = 0; p_index < this->totalBlockSize; ++p_index) |
| 1679 | { |
| 1680 | scalars->SetValue(index, this->dataArray[v_index][index]); |
| 1681 | index++; |
| 1682 | } |
| 1683 | }*/ |
| 1684 | this->UGrid->GetPointData()->AddArray(scalars); |
| 1685 | scalars->Delete(); |
| 1686 | } |
| 1687 | // if this is a vector |
| 1688 | else if (this->var_length[v_index] > 1) |
| 1689 | { |
| 1690 | index = 0; |
| 1691 | vtkFloatArray* vectors = vtkFloatArray::New(); |
| 1692 | vectors->SetNumberOfComponents(3); |
| 1693 | vectors->SetNumberOfTuples(num_verts); |
| 1694 | vectors->SetName(this->var_names[v_index]); |
| 1695 | |
| 1696 | // for each element/block in the continuum mesh |
| 1697 | for (int b_index = 0; b_index < this->myNumBlocks; ++b_index) |
| 1698 | { |
| 1699 | // for every point in this element/block |
| 1700 | #ifndef NDEBUG |
no test coverage detected