OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
Output_Data::Output_Preprocessor_1D Class Reference

#include <export.h>

Collaboration diagram for Output_Data::Output_Preprocessor_1D:

Public Member Functions

 Output_Preprocessor_1D (const Grid_Info &_grid, const vector< string > _oTags, string homedir="")
 
void operator() (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void distdump (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 

Private Member Functions

void Ex (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Ey (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Ez (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Bx (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void By (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Bz (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void px (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void f0 (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void f10 (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void f11 (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void f20 (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void fl0 (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void n (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void T (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Jx (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Jy (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Jz (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Qx (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Qy (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Qz (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void vNx (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void vNy (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void vNz (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Ux (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Uy (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Uz (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Z (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void ni (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 
void Ti (const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
 

Private Attributes

size_t Nbc
 
Export_Files::Xport expo
 
p1x1_1D px_x
 
fx1_1D f_x
 
vector< string > oTags
 

Detailed Description

Definition at line 406 of file export.h.

Constructor & Destructor Documentation

◆ Output_Preprocessor_1D()

Output_Data::Output_Preprocessor_1D::Output_Preprocessor_1D ( const Grid_Info _grid,
const vector< string >  _oTags,
string  homedir = "" 
)
inline

Definition at line 410 of file export.h.

413  : expo( _grid.axis, _oTags, homedir),
414  px_x( _grid ), //pxpy_x( _grid),
415  f_x( _grid),
416  oTags(_oTags) { }
Export_Files::Xport expo
Definition: export.h:429
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47

Member Function Documentation

◆ Bx()

void Output_Data::Output_Preprocessor_1D::Bx ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1571 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, EMF1D::Bx(), State1D::EMF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), and Parallel_Environment_1D::RANK().

1572  {
1573 
1574  size_t Nbc = Input::List().BoundaryCells;
1575  MPI_Status status;
1576  size_t st(0), bi(0);
1577  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1578  size_t outNxGlobal(grid.axis.Nxg(0));
1579 
1580  int msg_sz(outNxLocal); //*szy);
1581  float* Bxbuf = new float[msg_sz];
1582  valarray<float> BxGlobal(outNxGlobal); //, yglob_axis.dim());
1583 
1584  for(size_t i(0); i < msg_sz; ++i) {
1585  Bxbuf[i] = static_cast<float>( Y.EMF().Bx()(Nbc+i).real() );
1586  }
1587 
1588  if (PE.NODES() > 1) {
1589  if (PE.RANK()!=0) {
1590  MPI_Send(Bxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1591  }
1592  else {
1593  // Fill data for rank = 0
1594  for(size_t i(0); i < outNxLocal; i++) {
1595  BxGlobal[i] = Bxbuf[i];
1596  }
1597  // Fill data for rank > 0
1598  for (int rr = 1; rr < PE.NODES(); ++rr){
1599  MPI_Recv(Bxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1600  for(size_t i(0); i < outNxLocal; i++) {
1601  BxGlobal[i + outNxLocal*rr] = Bxbuf[i];
1602  }
1603  }
1604  }
1605  }
1606  // Fill data for Nodes = 0
1607  else {
1608  for(size_t i(0); i < outNxGlobal; i++) {
1609  BxGlobal[i] = Bxbuf[i];
1610  }
1611  }
1612 
1613  if (PE.RANK() == 0) expo.Export_h5("Bx", BxGlobal, tout);
1614 
1615  delete[] Bxbuf;
1616 
1617 }
Export_Files::Xport expo
Definition: export.h:429
Field1D & Bx()
Definition: state.h:293
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
EMF1D & EMF() const
Definition: state.h:610
Here is the call graph for this function:

◆ By()

void Output_Data::Output_Preprocessor_1D::By ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1621 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, EMF1D::By(), State1D::EMF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), and Parallel_Environment_1D::RANK().

1622  {
1623 
1624  size_t Nbc = Input::List().BoundaryCells;
1625  MPI_Status status;
1626  size_t st(0), bi(0);
1627  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1628  size_t outNxGlobal(grid.axis.Nxg(0));
1629 
1630  int msg_sz(outNxLocal); //*szy);
1631  float* Bybuf = new float[msg_sz];
1632  valarray<float> ByGlobal(outNxGlobal); //, yglob_axis.dim());
1633 
1634  for(size_t i(0); i < msg_sz; ++i) {
1635  Bybuf[i] = static_cast<float>( Y.EMF().By()(Nbc+i).real() );
1636  }
1637 
1638  if (PE.NODES() > 1) {
1639  if (PE.RANK()!=0) {
1640  MPI_Send(Bybuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1641  }
1642  else {
1643  // Fill data for rank = 0
1644  for(size_t i(0); i < outNxLocal; i++) {
1645  ByGlobal[i] = Bybuf[i];
1646  }
1647  // Fill data for rank > 0
1648  for (int rr = 1; rr < PE.NODES(); ++rr){
1649  MPI_Recv(Bybuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1650  for(size_t i(0); i < outNxLocal; i++) {
1651  ByGlobal[i + outNxLocal*rr] = Bybuf[i];
1652  }
1653  }
1654  }
1655  }
1656  // Fill data for Nodes = 0
1657  else {
1658  for(size_t i(0); i < outNxGlobal; i++) {
1659  ByGlobal[i] = Bybuf[i];
1660  }
1661  }
1662 
1663  if (PE.RANK() == 0) expo.Export_h5("By", ByGlobal, tout);
1664 
1665  delete[] Bybuf;
1666 
1667 }
Field1D & By()
Definition: state.h:294
Export_Files::Xport expo
Definition: export.h:429
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
EMF1D & EMF() const
Definition: state.h:610
Here is the call graph for this function:

◆ Bz()

void Output_Data::Output_Preprocessor_1D::Bz ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1671 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, EMF1D::Bz(), State1D::EMF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), and Parallel_Environment_1D::RANK().

1672  {
1673 
1674  size_t Nbc = Input::List().BoundaryCells;
1675  MPI_Status status;
1676  size_t st(0), bi(0);
1677  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1678  size_t outNxGlobal(grid.axis.Nxg(0));
1679 
1680  int msg_sz(outNxLocal); //*szy);
1681  float* Bzbuf = new float[msg_sz];
1682  valarray<float> BzGlobal(outNxGlobal); //, yglob_axis.dim());
1683 
1684  for(size_t i(0); i < msg_sz; ++i) {
1685  Bzbuf[i] = static_cast<float>( Y.EMF().Bz()(Nbc+i).real() );
1686  }
1687 
1688  if (PE.NODES() > 1) {
1689  if (PE.RANK()!=0) {
1690  MPI_Send(Bzbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1691  }
1692  else {
1693  // Fill data for rank = 0
1694  for(size_t i(0); i < outNxLocal; i++) {
1695  BzGlobal[i] = Bzbuf[i];
1696  }
1697  // Fill data for rank > 0
1698  for (int rr = 1; rr < PE.NODES(); ++rr){
1699  MPI_Recv(Bzbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1700  for(size_t i(0); i < outNxLocal; i++) {
1701  BzGlobal[i + outNxLocal*rr] = Bzbuf[i];
1702  }
1703  }
1704  }
1705  }
1706  // Fill data for Nodes = 0
1707  else {
1708  for(size_t i(0); i < outNxGlobal; i++) {
1709  BzGlobal[i] = Bzbuf[i];
1710  }
1711  }
1712 
1713  if (PE.RANK() == 0) expo.Export_h5("Bz", BzGlobal, tout);
1714 
1715  delete[] Bzbuf;
1716 
1717 }
Export_Files::Xport expo
Definition: export.h:429
Field1D & Bz()
Definition: state.h:295
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
EMF1D & EMF() const
Definition: state.h:610
Here is the call graph for this function:

◆ distdump()

void Output_Data::Output_Preprocessor_1D::distdump ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)

Definition at line 1389 of file export.cpp.

References Input::List().

Referenced by main().

1390  {
1391 
1392  if (Input::List().o_p1x1){
1393  px( Y, grid, tout, PE );
1394  }
1395  if (Input::List().o_f0x1){
1396  f0( Y, grid, tout, PE );
1397  }
1398  if (Input::List().o_f10x1){
1399  f10( Y, grid, tout, PE );
1400  }
1401  if (Input::List().o_f11x1){
1402  f11( Y, grid, tout, PE );
1403  }
1404  if (Input::List().o_f20x1){
1405  f20( Y, grid, tout, PE );
1406  }
1407  if (Input::List().o_fl0x1){
1408  fl0( Y, grid, tout, PE );
1409  }
1410 // if (Input::List().o_p2p1x1){
1411 // pxpy( Y, grid, tout, PE );
1412 // }
1413 
1414 }
void f10(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1997
void f0(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1862
void f20(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2140
void fl0(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2212
void f11(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2068
void px(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1720
Input_List & List()
Definition: input.cpp:1585
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ex()

void Output_Data::Output_Preprocessor_1D::Ex ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1421 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::EMF(), EMF1D::Ex(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), and Parallel_Environment_1D::RANK().

1422  {
1423 
1424  size_t Nbc = Input::List().BoundaryCells;
1425  MPI_Status status;
1426  size_t st(0), bi(0);
1427  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1428  size_t outNxGlobal(grid.axis.Nxg(0));
1429 
1430  int msg_sz(outNxLocal); //*szy);
1431  float* Exbuf = new float[msg_sz];
1432  valarray<float> ExGlobal(outNxGlobal); //, yglob_axis.dim());
1433 
1434  for(size_t i(0); i < msg_sz; ++i) {
1435  Exbuf[i] = static_cast<float>( Y.EMF().Ex()(Nbc+i).real() );
1436  }
1437 
1438  if (PE.NODES() > 1) {
1439  if (PE.RANK()!=0) {
1440  MPI_Send(Exbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1441  }
1442  else {
1443  // Fill data for rank = 0
1444  for(size_t i(0); i < outNxLocal; i++) {
1445  ExGlobal[i] = Exbuf[i];
1446  }
1447  // Fill data for rank > 0
1448  for (int rr = 1; rr < PE.NODES(); ++rr){
1449  MPI_Recv(Exbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1450  for(size_t i(0); i < outNxLocal; i++) {
1451  ExGlobal[i + outNxLocal*rr] = Exbuf[i];
1452  }
1453  }
1454  }
1455  }
1456  // Fill data for Nodes = 0
1457  else {
1458  for(size_t i(0); i < outNxGlobal; i++) {
1459  ExGlobal[i] = Exbuf[i];
1460  }
1461  }
1462 
1463  if (PE.RANK() == 0) expo.Export_h5("Ex", ExGlobal, tout);
1464 
1465  delete[] Exbuf;
1466 
1467 }
Export_Files::Xport expo
Definition: export.h:429
Field1D & Ex()
Definition: state.h:290
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
EMF1D & EMF() const
Definition: state.h:610
Here is the call graph for this function:

◆ Ey()

void Output_Data::Output_Preprocessor_1D::Ey ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1471 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::EMF(), EMF1D::Ey(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), and Parallel_Environment_1D::RANK().

1472  {
1473 
1474  size_t Nbc = Input::List().BoundaryCells;
1475  MPI_Status status;
1476  size_t st(0), bi(0);
1477  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1478  size_t outNxGlobal(grid.axis.Nxg(0));
1479 
1480  int msg_sz(outNxLocal); //*szy);
1481  float* Eybuf = new float[msg_sz];
1482  valarray<float> EyGlobal(outNxGlobal); //, yglob_axis.dim());
1483 
1484  for(size_t i(0); i < msg_sz; ++i) {
1485  Eybuf[i] = static_cast<float>( Y.EMF().Ey()(Nbc+i).real() );
1486  }
1487 
1488  if (PE.NODES() > 1) {
1489  if (PE.RANK()!=0) {
1490  MPI_Send(Eybuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1491  }
1492  else {
1493  // Fill data for rank = 0
1494  for(size_t i(0); i < outNxLocal; i++) {
1495  EyGlobal[i] = Eybuf[i];
1496  }
1497  // Fill data for rank > 0
1498  for (int rr = 1; rr < PE.NODES(); ++rr){
1499  MPI_Recv(Eybuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1500  for(size_t i(0); i < outNxLocal; i++) {
1501  EyGlobal[i + outNxLocal*rr] = Eybuf[i];
1502  }
1503  }
1504  }
1505  }
1506  // Fill data for Nodes = 0
1507  else {
1508  for(size_t i(0); i < outNxGlobal; i++) {
1509  EyGlobal[i] = Eybuf[i];
1510  }
1511  }
1512 
1513  if (PE.RANK() == 0) expo.Export_h5("Ey", EyGlobal, tout);
1514 
1515  delete[] Eybuf;
1516 
1517 }
Export_Files::Xport expo
Definition: export.h:429
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
Field1D & Ey()
Definition: state.h:291
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
EMF1D & EMF() const
Definition: state.h:610
Here is the call graph for this function:

◆ Ez()

void Output_Data::Output_Preprocessor_1D::Ez ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1521 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::EMF(), EMF1D::Ez(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), and Parallel_Environment_1D::RANK().

1522  {
1523 
1524  size_t Nbc = Input::List().BoundaryCells;
1525  MPI_Status status;
1526  size_t st(0), bi(0);
1527  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1528  size_t outNxGlobal(grid.axis.Nxg(0));
1529 
1530  int msg_sz(outNxLocal); //*szy);
1531  float* Ezbuf = new float[msg_sz];
1532  valarray<float> EzGlobal(outNxGlobal); //, yglob_axis.dim());
1533 
1534  for(size_t i(0); i < msg_sz; ++i) {
1535  Ezbuf[i] = static_cast<float>( Y.EMF().Ez()(Nbc+i).real() );
1536  }
1537 
1538  if (PE.NODES() > 1) {
1539  if (PE.RANK()!=0) {
1540  MPI_Send(Ezbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1541  }
1542  else {
1543  // Fill data for rank = 0
1544  for(size_t i(0); i < outNxLocal; i++) {
1545  EzGlobal[i] = Ezbuf[i];
1546  }
1547  // Fill data for rank > 0
1548  for (int rr = 1; rr < PE.NODES(); ++rr){
1549  MPI_Recv(Ezbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1550  for(size_t i(0); i < outNxLocal; i++) {
1551  EzGlobal[i + outNxLocal*rr] = Ezbuf[i];
1552  }
1553  }
1554  }
1555  }
1556  // Fill data for Nodes = 0
1557  else {
1558  for(size_t i(0); i < outNxGlobal; i++) {
1559  EzGlobal[i] = Ezbuf[i];
1560  }
1561  }
1562 
1563  if (PE.RANK() == 0) expo.Export_h5("Ez", EzGlobal, tout);
1564 
1565  delete[] Ezbuf;
1566 
1567 }
Export_Files::Xport expo
Definition: export.h:429
Field1D & Ez()
Definition: state.h:292
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
EMF1D & EMF() const
Definition: state.h:610
Here is the call graph for this function:

◆ f0()

void Output_Data::Output_Preprocessor_1D::f0 ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1862 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and State1D::Species().

1863  {
1864 
1865  size_t Nbc = Input::List().BoundaryCells;
1866  MPI_Status status;
1867 
1868  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1869  size_t outNxGlobal(grid.axis.Nxg(0));
1870 
1871  for(int s(0); s < Y.Species(); ++s) {
1872 
1873  int msg_sz(2*outNxLocal*f_x.Np(s));
1874  Array3D<float> f0x1Global(f_x.Np(s),outNxGlobal,2); //, yglob_axis.dim());
1875  float* f0xbuf = new float[msg_sz];
1876 
1877  for (size_t i(0); i < outNxLocal; ++i) {
1878 
1879  Array2D<float> data2D = f_x( Y.DF(s),0,0, i+Nbc, s);
1880 
1881  for (size_t j(0); j < f_x.Np(s); ++j) {
1882  // std::cout << "\n f0(" << i << "," << j << ") = (" << data2D(j,1) << "," << data2D(j,2) <<")";
1883  f0xbuf[2*j+ 2*i*f_x.Np(s)]=data2D(j,0);
1884 
1885  f0xbuf[2*j+1+ 2*i*f_x.Np(s)]=data2D(j,1);
1886  }
1887  }
1888 
1889  if (PE.NODES() > 1) {
1890  if (PE.RANK()!=0) {
1891  MPI_Send(f0xbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1892  }
1893  else {
1894  // Fill data for rank = 0
1895  for(size_t i(0); i < outNxLocal; i++) {
1896 
1897  for (size_t j(0); j < f_x.Np(s); ++j) {
1898  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
1899  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
1900  }
1901  }
1902  // Fill data for rank > 0
1903  for (int rr = 1; rr < PE.NODES(); ++rr){
1904  MPI_Recv(f0xbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1905 
1906  for(size_t i(0); i < outNxLocal; i++) {
1907  for (size_t j(0); j < f_x.Np(s); ++j) {
1908  f0x1Global(j,i + outNxLocal*rr,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
1909  f0x1Global(j,i + outNxLocal*rr,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
1910  }
1911  }
1912  }
1913  }
1914  }
1915  else {
1916  for(size_t i(0); i < outNxGlobal; i++) {
1917 
1918  for (size_t j(0); j < f_x.Np(s); ++j) {
1919  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
1920  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
1921  }
1922  }
1923  }
1924 
1925  if (PE.RANK() == 0) expo.Export_h5("f0-x", f0x1Global, tout, s);
1926 
1927  delete[] f0xbuf;
1928  }
1929 
1930 }
Export_Files::Xport expo
Definition: export.h:429
size_t Np(size_t s) const
Definition: export.h:388
DistFunc1D & DF(size_t s)
Definition: state.h:602
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ f10()

void Output_Data::Output_Preprocessor_1D::f10 ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1997 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and State1D::Species().

1998  {
1999 
2000  size_t Nbc = Input::List().BoundaryCells;
2001  MPI_Status status;
2002 
2003  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2004  size_t outNxGlobal(grid.axis.Nxg(0));
2005 
2006  for(int s(0); s < Y.Species(); ++s) {
2007 
2008  int msg_sz(2*outNxLocal*f_x.Np(s));
2009  Array3D<float> f0x1Global(f_x.Np(s),outNxGlobal,2); //, yglob_axis.dim());
2010  float* f0xbuf = new float[msg_sz];
2011 
2012  for (size_t i(0); i < outNxLocal; ++i) {
2013 
2014  Array2D<float> data2D = f_x( Y.DF(s), 1, 0, i+Nbc, s);
2015 
2016  for (size_t j(0); j < f_x.Np(s); ++j) {
2017  // std::cout << "\n f0(" << i << "," << j << ") = (" << data2D(j,1) << "," << data2D(j,2) <<")";
2018  f0xbuf[2*j+ 2*i*f_x.Np(s)]=data2D(j,0);
2019 
2020  f0xbuf[2*j+1+ 2*i*f_x.Np(s)]=data2D(j,1);
2021  }
2022  }
2023 
2024  if (PE.NODES() > 1) {
2025  if (PE.RANK()!=0) {
2026  MPI_Send(f0xbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2027  }
2028  else {
2029  // Fill data for rank = 0
2030  for(size_t i(0); i < outNxLocal; i++) {
2031 
2032  for (size_t j(0); j < f_x.Np(s); ++j) {
2033  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2034  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2035  }
2036  }
2037  // Fill data for rank > 0
2038  for (int rr = 1; rr < PE.NODES(); ++rr){
2039  MPI_Recv(f0xbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2040 
2041  for(size_t i(0); i < outNxLocal; i++) {
2042  for (size_t j(0); j < f_x.Np(s); ++j) {
2043  f0x1Global(j,i + outNxLocal*rr,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2044  f0x1Global(j,i + outNxLocal*rr,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2045  }
2046  }
2047  }
2048  }
2049  }
2050  else {
2051  for(size_t i(0); i < outNxGlobal; i++) {
2052 
2053  for (size_t j(0); j < f_x.Np(s); ++j) {
2054  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2055  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2056  }
2057  }
2058  }
2059 
2060  if (PE.RANK() == 0) expo.Export_h5("f10-x", f0x1Global, tout, s);
2061 
2062  delete[] f0xbuf;
2063  }
2064 
2065 }
Export_Files::Xport expo
Definition: export.h:429
size_t Np(size_t s) const
Definition: export.h:388
DistFunc1D & DF(size_t s)
Definition: state.h:602
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ f11()

void Output_Data::Output_Preprocessor_1D::f11 ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2068 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and State1D::Species().

2069  {
2070 
2071  size_t Nbc = Input::List().BoundaryCells;
2072  MPI_Status status;
2073 
2074  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2075  size_t outNxGlobal(grid.axis.Nxg(0));
2076 
2077  for(int s(0); s < Y.Species(); ++s) {
2078 
2079  int msg_sz(2*outNxLocal*f_x.Np(s));
2080  Array3D<float> f0x1Global(f_x.Np(s),outNxGlobal,2); //, yglob_axis.dim());
2081  float* f0xbuf = new float[msg_sz];
2082 
2083  for (size_t i(0); i < outNxLocal; ++i) {
2084 
2085  Array2D<float> data2D = f_x( Y.DF(s),1,1, i+Nbc, s);
2086 
2087  for (size_t j(0); j < f_x.Np(s); ++j) {
2088  // std::cout << "\n f0(" << i << "," << j << ") = (" << data2D(j,1) << "," << data2D(j,2) <<")";
2089  f0xbuf[2*j+ 2*i*f_x.Np(s)]=data2D(j,0);
2090 
2091  f0xbuf[2*j+1+ 2*i*f_x.Np(s)]=data2D(j,1);
2092  }
2093  }
2094 
2095  if (PE.NODES() > 1) {
2096  if (PE.RANK()!=0) {
2097  MPI_Send(f0xbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2098  }
2099  else {
2100  // Fill data for rank = 0
2101  for(size_t i(0); i < outNxLocal; i++) {
2102 
2103  for (size_t j(0); j < f_x.Np(s); ++j) {
2104  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2105  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2106  }
2107  }
2108  // Fill data for rank > 0
2109  for (int rr = 1; rr < PE.NODES(); ++rr){
2110  MPI_Recv(f0xbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2111 
2112  for(size_t i(0); i < outNxLocal; i++) {
2113  for (size_t j(0); j < f_x.Np(s); ++j) {
2114  f0x1Global(j,i + outNxLocal*rr,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2115  f0x1Global(j,i + outNxLocal*rr,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2116  }
2117  }
2118  }
2119  }
2120  }
2121  else {
2122  for(size_t i(0); i < outNxGlobal; i++) {
2123 
2124  for (size_t j(0); j < f_x.Np(s); ++j) {
2125  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2126  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2127  }
2128  }
2129  }
2130 
2131  if (PE.RANK() == 0) expo.Export_h5("f11-x", f0x1Global, tout, s);
2132 
2133  delete[] f0xbuf;
2134  }
2135 
2136 
2137 }
Export_Files::Xport expo
Definition: export.h:429
size_t Np(size_t s) const
Definition: export.h:388
DistFunc1D & DF(size_t s)
Definition: state.h:602
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ f20()

void Output_Data::Output_Preprocessor_1D::f20 ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2140 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and State1D::Species().

2141  {
2142 
2143  size_t Nbc = Input::List().BoundaryCells;
2144  MPI_Status status;
2145 
2146  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2147  size_t outNxGlobal(grid.axis.Nxg(0));
2148 
2149  for(int s(0); s < Y.Species(); ++s) {
2150 
2151  int msg_sz(2*outNxLocal*f_x.Np(s));
2152  Array3D<float> f0x1Global(f_x.Np(s),outNxGlobal,2); //, yglob_axis.dim());
2153  float* f0xbuf = new float[msg_sz];
2154 
2155  for (size_t i(0); i < outNxLocal; ++i) {
2156 
2157  Array2D<float> data2D = f_x( Y.DF(s), 2, 0, i+Nbc, s);
2158 
2159  for (size_t j(0); j < f_x.Np(s); ++j) {
2160  // std::cout << "\n f0(" << i << "," << j << ") = (" << data2D(j,1) << "," << data2D(j,2) <<")";
2161  f0xbuf[2*j+ 2*i*f_x.Np(s)]=data2D(j,0);
2162 
2163  f0xbuf[2*j+1+ 2*i*f_x.Np(s)]=data2D(j,1);
2164  }
2165  }
2166 
2167  if (PE.NODES() > 1) {
2168  if (PE.RANK()!=0) {
2169  MPI_Send(f0xbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2170  }
2171  else {
2172  // Fill data for rank = 0
2173  for(size_t i(0); i < outNxLocal; i++) {
2174 
2175  for (size_t j(0); j < f_x.Np(s); ++j) {
2176  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2177  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2178  }
2179  }
2180  // Fill data for rank > 0
2181  for (int rr = 1; rr < PE.NODES(); ++rr){
2182  MPI_Recv(f0xbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2183 
2184  for(size_t i(0); i < outNxLocal; i++) {
2185  for (size_t j(0); j < f_x.Np(s); ++j) {
2186  f0x1Global(j,i + outNxLocal*rr,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2187  f0x1Global(j,i + outNxLocal*rr,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2188  }
2189  }
2190  }
2191  }
2192  }
2193  else {
2194  for(size_t i(0); i < outNxGlobal; i++) {
2195 
2196  for (size_t j(0); j < f_x.Np(s); ++j) {
2197  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2198  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2199  }
2200  }
2201  }
2202 
2203  if (PE.RANK() == 0) expo.Export_h5("f20-x", f0x1Global, tout, s);
2204 
2205  delete[] f0xbuf;
2206  }
2207 
2208 }
Export_Files::Xport expo
Definition: export.h:429
size_t Np(size_t s) const
Definition: export.h:388
DistFunc1D & DF(size_t s)
Definition: state.h:602
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ fl0()

void Output_Data::Output_Preprocessor_1D::fl0 ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2212 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), DistFunc1D::l0(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and State1D::Species().

2213  {
2214 
2215  size_t Nbc = Input::List().BoundaryCells;
2216  MPI_Status status;
2217 
2218  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2219  size_t outNxGlobal(grid.axis.Nxg(0));
2220 
2221  for(int s(0); s < Y.Species(); ++s) {
2222 
2223  int msg_sz(2*outNxLocal*f_x.Np(s));
2224  Array3D<float> f0x1Global(f_x.Np(s),outNxGlobal,2); //, yglob_axis.dim());
2225  float* f0xbuf = new float[msg_sz];
2226 
2227  for (size_t i(0); i < outNxLocal; ++i) {
2228 
2229  Array2D<float> data2D = f_x( Y.DF(s), Y.DF(s).l0()-1,0, i+Nbc, s);
2230 
2231  for (size_t j(0); j < f_x.Np(s); ++j) {
2232  // std::cout << "\n f0(" << i << "," << j << ") = (" << data2D(j,1) << "," << data2D(j,2) <<")";
2233  f0xbuf[2*j+ 2*i*f_x.Np(s)]=data2D(j,0);
2234 
2235  f0xbuf[2*j+1+ 2*i*f_x.Np(s)]=data2D(j,1);
2236  }
2237  }
2238 
2239  if (PE.NODES() > 1) {
2240  if (PE.RANK()!=0) {
2241  MPI_Send(f0xbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2242  }
2243  else {
2244  // Fill data for rank = 0
2245  for(size_t i(0); i < outNxLocal; i++) {
2246 
2247  for (size_t j(0); j < f_x.Np(s); ++j) {
2248  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2249  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2250  }
2251  }
2252  // Fill data for rank > 0
2253  for (int rr = 1; rr < PE.NODES(); ++rr){
2254  MPI_Recv(f0xbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2255 
2256  for(size_t i(0); i < outNxLocal; i++) {
2257  for (size_t j(0); j < f_x.Np(s); ++j) {
2258  f0x1Global(j,i + outNxLocal*rr,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2259  f0x1Global(j,i + outNxLocal*rr,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2260  }
2261  }
2262  }
2263  }
2264  }
2265  else {
2266  for(size_t i(0); i < outNxGlobal; i++) {
2267 
2268  for (size_t j(0); j < f_x.Np(s); ++j) {
2269  f0x1Global(j,i,0) = f0xbuf[2*j+ 2*i*f_x.Np(s)];
2270  f0x1Global(j,i,1) = f0xbuf[2*j+1+ 2*i*f_x.Np(s)];
2271  }
2272  }
2273  }
2274 
2275  if (PE.RANK() == 0) expo.Export_h5("fl0-x", f0x1Global, tout, s);
2276 
2277  delete[] f0xbuf;
2278  }
2279 
2280 }
Export_Files::Xport expo
Definition: export.h:429
size_t Np(size_t s) const
Definition: export.h:388
DistFunc1D & DF(size_t s)
Definition: state.h:602
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t l0() const
Definition: state.h:396
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ Jx()

void Output_Data::Output_Preprocessor_1D::Jx ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2434 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Algorithms::MakeCAxis(), DistFunc1D::mass(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), DistFunc1D::q(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2435  {
2436 
2437 
2438  size_t Nbc = Input::List().BoundaryCells;
2439  MPI_Status status;
2440  // size_t st(0), bi(0);
2441  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2442  size_t outNxGlobal(grid.axis.Nxg(0));
2443 
2444  int msg_sz(outNxLocal); //*szy);
2445  float* Jxbuf = new float[msg_sz];
2446  valarray<float> JxGlobal(outNxGlobal); //, yglob_axis.dim());
2447 
2448  for(int s(0); s < Y.Species(); ++s) {
2449 
2450 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2451  valarray<float> pra( Algorithms::MakeCAxis(float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
2452 
2453  for(size_t i(0); i < msg_sz; ++i) {
2454  Jxbuf[i] = Y.DF(s).q()/Y.DF(s).mass()*4.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,0)).xVec(i+Nbc) ), pra, 3);
2455  }
2456 
2457  if (PE.NODES() > 1) {
2458  if (PE.RANK()!=0) {
2459  MPI_Send(Jxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2460  }
2461  else {
2462  // Fill data for rank = 0
2463  for(size_t i(0); i < outNxLocal; i++) {
2464  JxGlobal[i] = Jxbuf[i];
2465  }
2466  // Fill data for rank > 0
2467  for (int rr = 1; rr < PE.NODES(); ++rr){
2468  MPI_Recv(Jxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2469  for(size_t i(0); i < outNxLocal; i++) {
2470  JxGlobal[i + outNxLocal*rr] = Jxbuf[i];
2471  }
2472  }
2473  }
2474  }
2475  // Fill data for Nodes = 0
2476  else {
2477  for(size_t i(0); i < outNxGlobal; i++) {
2478  JxGlobal[i] = Jxbuf[i];
2479  }
2480  }
2481 
2482  if (PE.RANK() == 0) expo.Export_h5("Jx", JxGlobal, tout, s);
2483 
2484  }
2485 
2486  delete[] Jxbuf;
2487 
2488 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
double mass() const
Definition: state.h:400
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
double q() const
Definition: state.h:399
DistFunc1D & DF(size_t s)
Definition: state.h:602
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ Jy()

void Output_Data::Output_Preprocessor_1D::Jy ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2493 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Algorithms::MakeCAxis(), DistFunc1D::mass(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), DistFunc1D::q(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2494  {
2495 
2496 
2497  size_t Nbc = Input::List().BoundaryCells;
2498  MPI_Status status;
2499  // size_t st(0), bi(0);
2500  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2501  size_t outNxGlobal(grid.axis.Nxg(0));
2502 
2503  int msg_sz(outNxLocal); //*szy);
2504  float* Jybuf = new float[msg_sz];
2505  valarray<float> JyGlobal(outNxGlobal); //, yglob_axis.dim());
2506 
2507  for(int s(0); s < Y.Species(); ++s) {
2508 
2509 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2510  valarray<float> pra( Algorithms::MakeCAxis(float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
2511 
2512  for(size_t i(0); i < msg_sz; ++i) {
2513  Jybuf[i] = Y.DF(s).q()/Y.DF(s).mass()*8.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2514  }
2515 
2516  if (PE.NODES() > 1) {
2517  if (PE.RANK()!=0) {
2518  MPI_Send(Jybuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2519  }
2520  else {
2521  // Fill data for rank = 0
2522  for(size_t i(0); i < outNxLocal; i++) {
2523  JyGlobal[i] = Jybuf[i];
2524  }
2525  // Fill data for rank > 0
2526  for (int rr = 1; rr < PE.NODES(); ++rr){
2527  MPI_Recv(Jybuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2528  for(size_t i(0); i < outNxLocal; i++) {
2529  JyGlobal[i + outNxLocal*rr] = Jybuf[i];
2530  }
2531  }
2532  }
2533  }
2534  // Fill data for Nodes = 0
2535  else {
2536  for(size_t i(0); i < outNxGlobal; i++) {
2537  JyGlobal[i] = Jybuf[i];
2538  }
2539  }
2540 
2541  if (PE.RANK() == 0) expo.Export_h5("Jy", JyGlobal, tout, s);
2542 
2543  }
2544 
2545  delete[] Jybuf;
2546 
2547 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
double mass() const
Definition: state.h:400
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
double q() const
Definition: state.h:399
DistFunc1D & DF(size_t s)
Definition: state.h:602
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ Jz()

void Output_Data::Output_Preprocessor_1D::Jz ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2551 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Algorithms::MakeCAxis(), DistFunc1D::mass(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), DistFunc1D::q(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat_complex().

2552  {
2553 
2554 
2555  size_t Nbc = Input::List().BoundaryCells;
2556  MPI_Status status;
2557  // size_t st(0), bi(0);
2558  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2559  size_t outNxGlobal(grid.axis.Nxg(0));
2560 
2561  int msg_sz(outNxLocal); //*szy);
2562  float* Jzbuf = new float[msg_sz];
2563  valarray<float> JzGlobal(outNxGlobal); //, yglob_axis.dim());
2564 
2565  for(int s(0); s < Y.Species(); ++s) {
2566 
2567 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2568  valarray<float> pra( Algorithms::MakeCAxis(float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
2569  for(size_t i(0); i < msg_sz; ++i) {
2570  Jzbuf[i] = Y.DF(s).q()/Y.DF(s).mass()*-8.0/3.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2571  }
2572 
2573  if (PE.NODES() > 1) {
2574  if (PE.RANK()!=0) {
2575  MPI_Send(Jzbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2576  }
2577  else {
2578  // Fill data for rank = 0
2579  for(size_t i(0); i < outNxLocal; i++) {
2580  JzGlobal[i] = Jzbuf[i];
2581  }
2582  // Fill data for rank > 0
2583  for (int rr = 1; rr < PE.NODES(); ++rr){
2584  MPI_Recv(Jzbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2585  for(size_t i(0); i < outNxLocal; i++) {
2586  JzGlobal[i + outNxLocal*rr] = Jzbuf[i];
2587  }
2588  }
2589  }
2590  }
2591  // Fill data for Nodes = 0
2592  else {
2593  for(size_t i(0); i < outNxGlobal; i++) {
2594  JzGlobal[i] = Jzbuf[i];
2595  }
2596  }
2597 
2598  if (PE.RANK() == 0) expo.Export_h5("Jz", JzGlobal, tout, s);
2599 
2600  }
2601 
2602  delete[] Jzbuf;
2603 
2604 }
vector< float > vfloat_complex(const vector< complex< double > > vDouble)
Definition: nmethods.cpp:412
Export_Files::Xport expo
Definition: export.h:429
double mass() const
Definition: state.h:400
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
double q() const
Definition: state.h:399
DistFunc1D & DF(size_t s)
Definition: state.h:602
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ n()

void Output_Data::Output_Preprocessor_1D::n ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2285 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Input::List(), Algorithms::MakeCAxis(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2286  {
2287 
2288 
2289  size_t Nbc = Input::List().BoundaryCells;
2290  MPI_Status status;
2291  size_t st(0), bi(0);
2292  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2293  size_t outNxGlobal(grid.axis.Nxg(0));
2294 
2295  int msg_sz(outNxLocal); //*szy);
2296  float* nbuf = new float[msg_sz];
2297  valarray<float> nGlobal(outNxGlobal); //, yglob_axis.dim());
2298 
2299  for(int s(0); s < Y.Species(); ++s) {
2300 
2301 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2302 
2303  valarray<float> pra( Algorithms::MakeCAxis(float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
2304  for(size_t i(0); i < msg_sz; ++i) {
2305 
2306  // std::cout << "f00n[" << i << "]=" << (Y.SH(s,0,0)).xVec(i+Nbc)[0] << "\n";
2307 
2308  nbuf[i] = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 2);
2309  }
2310 
2311  if (PE.NODES() > 1) {
2312  if (PE.RANK()!=0) {
2313  MPI_Send(nbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2314  }
2315  else {
2316  // Fill data for rank = 0
2317  for(size_t i(0); i < outNxLocal; i++) {
2318  nGlobal[i] = nbuf[i];
2319  }
2320  // Fill data for rank > 0
2321  for (int rr = 1; rr < PE.NODES(); ++rr){
2322  MPI_Recv(nbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2323  for(size_t i(0); i < outNxLocal; i++) {
2324  nGlobal[i + outNxLocal*rr] = nbuf[i];
2325  }
2326  }
2327  }
2328  }
2329  // Fill data for Nodes = 0
2330  else {
2331  for(size_t i(0); i < outNxGlobal; i++) {
2332  nGlobal[i] = nbuf[i];
2333  }
2334  }
2335 
2336  if (PE.RANK() == 0) expo.Export_h5("n", nGlobal, tout, s);
2337 
2338  }
2339 
2340  delete[] nbuf;
2341 
2342 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ ni()

void Output_Data::Output_Preprocessor_1D::ni ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 3305 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Hydro1D::density(), State1D::HYDRO(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), and Parallel_Environment_1D::RANK().

3306  {
3307 
3308 
3309  size_t Nbc = Input::List().BoundaryCells;
3310  MPI_Status status;
3311  // size_t st(0), bi(0);
3312  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
3313  size_t outNxGlobal(grid.axis.Nxg(0));
3314 
3315  int msg_sz(outNxLocal); //*szy);
3316  float* nibuf = new float[msg_sz];
3317  valarray<float> niGlobal(outNxGlobal); //, yglob_axis.dim());
3318 
3319  for(size_t i(0); i < msg_sz; ++i) {
3320  nibuf[i] = static_cast<float>(Y.HYDRO().density(i+Nbc));
3321  }
3322 
3323  if (PE.NODES() > 1) {
3324  if (PE.RANK()!=0) {
3325  MPI_Send(nibuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3326  }
3327  else {
3328  // Fill data for rank = 0
3329  for(size_t i(0); i < outNxLocal; i++) {
3330  niGlobal[i] = nibuf[i];
3331  }
3332  // Fill data for rank > 0
3333  for (int rr = 1; rr < PE.NODES(); ++rr){
3334  MPI_Recv(nibuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3335  for(size_t i(0); i < outNxLocal; i++) {
3336  niGlobal[i + outNxLocal*rr] = nibuf[i];
3337  }
3338  }
3339  }
3340  }
3341  // Fill data for Nodes = 0
3342  else {
3343  for(size_t i(0); i < outNxGlobal; i++) {
3344  niGlobal[i] = nibuf[i];
3345  }
3346  }
3347 
3348  if (PE.RANK() == 0) expo.Export_h5("ni", niGlobal, tout, 0);
3349 
3350 
3351 
3352  delete[] nibuf;
3353 
3354 }
Export_Files::Xport expo
Definition: export.h:429
Hydro1D & HYDRO()
Definition: state.h:613
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
double & density(size_t i)
Definition: state.h:527
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ operator()()

void Output_Data::Output_Preprocessor_1D::operator() ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)

Definition at line 1277 of file export.cpp.

References Input::List().

1278  {
1279 
1280  if (Input::List().o_Ex) {
1281  Ex( Y, grid, tout, PE );
1282  }
1283 
1284  if (Input::List().o_Ey) {
1285  Ey( Y, grid, tout, PE );
1286  }
1287 
1288  if (Input::List().o_Ez) {
1289  Ez( Y, grid, tout, PE );
1290  }
1291 
1292  if (Input::List().o_Bx) {
1293  Bx( Y, grid, tout, PE );
1294  }
1295 
1296  if (Input::List().o_By) {
1297  By( Y, grid, tout, PE );
1298  }
1299 
1300  if (Input::List().o_Bz) {
1301  Bz( Y, grid, tout, PE );
1302  }
1303 
1304  if (Input::List().o_x1x2) {
1305  n( Y, grid, tout, PE );
1306  }
1307 
1308  if (Input::List().o_Temperature) {
1309  T( Y, grid, tout, PE );
1310  }
1311 
1312  if (Input::List().o_Jx) {
1313  Jx( Y, grid, tout, PE );
1314  }
1315 
1316  if (Input::List().o_Jy) {
1317  Jy( Y, grid, tout, PE );
1318  }
1319 
1320  if (Input::List().o_Jz) {
1321  Jz( Y, grid, tout, PE );
1322  }
1323 
1324  if (Input::List().o_Qx) {
1325  Qx( Y, grid, tout, PE );
1326  }
1327 
1328  if (Input::List().o_Qy) {
1329  Qy( Y, grid, tout, PE );
1330  }
1331 
1332  if (Input::List().o_Qz) {
1333  Qz( Y, grid, tout, PE );
1334  }
1335  if (Input::List().o_vNx) {
1336  vNx( Y, grid, tout, PE );
1337  }
1338  if (Input::List().o_vNy) {
1339  vNy( Y, grid, tout, PE );
1340  }
1341  if (Input::List().o_vNz) {
1342  vNz( Y, grid, tout, PE );
1343  }
1344 
1345 // if (Input::List().o_p1x1){
1346 // px( Y, grid, tout, PE );
1347 // }
1348 // if (Input::List().o_f0x1){
1349 // f0( Y, grid, tout, PE );
1350 // }
1351 // if (Input::List().o_f10x1){
1352 // f10( Y, grid, tout, PE );
1353 // }
1354 // if (Input::List().o_f11x1){
1355 // f11( Y, grid, tout, PE );
1356 // }
1357 // if (Input::List().o_p2p1x1){
1358 // pxpy( Y, grid, tout, PE );
1359 // }
1360 
1361  if (Input::List().o_Ux) {
1362  Ux( Y, grid, tout, PE );
1363  }
1364 
1365  if (Input::List().o_Uy) {
1366  Uy( Y, grid, tout, PE );
1367  }
1368 
1369  if (Input::List().o_Uz) {
1370  Uz( Y, grid, tout, PE );
1371  }
1372 
1373  if (Input::List().o_Z) {
1374  Z( Y, grid, tout, PE );
1375  }
1376 
1377  if (Input::List().o_ni) {
1378  ni( Y, grid, tout, PE );
1379  }
1380 
1381  if (Input::List().o_Ux) {
1382  Ti( Y, grid, tout, PE );
1383  }
1384 
1385 }
void Qx(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2607
void Bx(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1571
void Jy(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2493
void Uy(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:3144
void Qy(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2713
void Jz(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2551
void vNx(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2926
void Qz(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2819
void Uz(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:3196
void Ex(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1421
void vNy(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2985
void T(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2345
void Ux(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:3092
void Ez(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1521
void n(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2285
Input_List & List()
Definition: input.cpp:1585
void vNz(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:3037
void Ti(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:3360
void Z(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:3249
void By(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1621
void ni(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:3305
void Jx(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:2434
void Ey(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1471
void Bz(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
Definition: export.cpp:1671
Here is the call graph for this function:

◆ px()

void Output_Data::Output_Preprocessor_1D::px ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 1720 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and State1D::Species().

1721  {
1722  // std::cout << "0 \n";
1723  size_t Nbc = Input::List().BoundaryCells;
1724  MPI_Status status;
1725  size_t st(0), bi(0);
1726  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
1727  size_t outNxGlobal(grid.axis.Nxg(0));
1728 
1729 
1730 
1731  for(int s(0); s < Y.Species(); ++s) {
1732  size_t Npx(2*f_x.Np(s)+1);
1733  int msg_sz(outNxLocal*Npx);
1734  Array2D<float> p1x1Global(Npx,outNxGlobal); //, yglob_axis.dim());
1735  float* pxbuf = new float[Npx*outNxLocal];
1736 
1737  for (size_t i(0); i < outNxLocal; ++i) {
1738 
1739  valarray<float> data1D = px_x( Y.DF(s), i+Nbc, s);
1740 
1741  for (size_t j(0); j < Npx; ++j) {
1742  pxbuf[j+i*Npx]=data1D[j];
1743  }
1744  }
1745 
1746  if (PE.NODES() > 1) {
1747  if (PE.RANK()!=0) {
1748  MPI_Send(pxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
1749  }
1750  else {
1751  // Fill data for rank = 0
1752  for(size_t i(0); i < outNxLocal; i++) {
1753  for (size_t j(0); j < Npx; ++j) {
1754  p1x1Global(j,i) = pxbuf[j+i*Npx];
1755  }
1756  }
1757  // Fill data for rank > 0
1758  for (int rr = 1; rr < PE.NODES(); ++rr){
1759  MPI_Recv(pxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
1760  for(size_t i(0); i < outNxLocal; i++) {
1761  for (size_t j(0); j < Npx; ++j) {
1762  p1x1Global(j,i + outNxLocal*rr) = pxbuf[j+i*Npx];
1763  }
1764  }
1765  }
1766  }
1767  }
1768  else {
1769  for(size_t i(0); i < outNxGlobal; i++) {
1770  for (size_t j(0); j < Npx; ++j) {
1771  p1x1Global(j,i) = pxbuf[j+i*Npx];
1772  }
1773  }
1774  }
1775 
1776  if (PE.RANK() == 0) expo.Export_h5("px-x", p1x1Global, tout, s);
1777 
1778  delete[] pxbuf;
1779  }
1780 
1781 }
Export_Files::Xport expo
Definition: export.h:429
size_t Np(size_t s) const
Definition: export.h:388
DistFunc1D & DF(size_t s)
Definition: state.h:602
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ Qx()

void Output_Data::Output_Preprocessor_1D::Qx ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2607 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Input::List(), Algorithms::MakeCAxis(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2608  {
2609 
2610 
2611  size_t Nbc = Input::List().BoundaryCells;
2612  MPI_Status status;
2613 
2614  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2615  size_t outNxGlobal(grid.axis.Nxg(0));
2616 
2617  int msg_sz(outNxLocal); //*szy);
2618 
2619  double Vxbuf;
2620  double Vybuf;
2621  double Vzbuf;
2622  double VxVxbuf;
2623  double VyVybuf;
2624  double VzVzbuf;
2625  double VxVybuf;
2626  double VxVzbuf;
2627  double VyVzbuf;
2628  double nbuf;
2629  double Ubuf;
2630 
2631  float* Qxbuf = new float[msg_sz];
2632  valarray<float> QxGlobal(outNxGlobal); //, yglob_axis.dim());
2633 
2634  for(int s(0); s < Y.Species(); ++s) {
2635 
2636 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2637  valarray<float> pra( Algorithms::MakeCAxis(float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
2638  for(size_t i(0); i < msg_sz; ++i) {
2639 // nbuf = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 2);
2640 // Ubuf = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 4);
2641 //
2642 // Vxbuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,0)).xVec(i+Nbc) ), pra, 3);
2643 // Vybuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2644 // Vzbuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2645 // Vxbuf /= nbuf;
2646 // Vybuf /= nbuf;
2647 // Vzbuf /= nbuf;
2648 //
2649 // VxVxbuf = 4.0/3.0*2.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,0)).xVec(i+Nbc) ), pra, 4);
2650 // VyVybuf = 4.0*4.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,2)).xVec(i+Nbc) ), pra, 4);
2651 // VzVzbuf = -1.0*VyVybuf;
2652 //
2653 // VyVybuf -= VxVxbuf/2.0;
2654 // VzVzbuf -= VxVxbuf/2.0;
2655 //
2656 // VxVxbuf += Ubuf/2.0;
2657 // VyVybuf += Ubuf/2.0;
2658 // VzVzbuf += Ubuf/2.0;
2659 //
2660 // VxVybuf = 4.0*2.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,1)).xVec(i+Nbc) ), pra, 4);
2661 // VxVzbuf = -4.0*2.0/5.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,2,1)).xVec(i+Nbc) ), pra, 4);
2662 // VyVzbuf = -4.0*4.0/5.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,2,2)).xVec(i+Nbc) ), pra, 4);
2663 //
2664 // VxVxbuf /= nbuf;
2665 // VyVybuf /= nbuf;
2666 // VzVzbuf /= nbuf;
2667 // VxVybuf /= nbuf;
2668 // VxVzbuf /= nbuf;
2669 // VyVzbuf /= nbuf;
2670 
2671  Qxbuf[i] = 4.0*M_PI/3.0*Algorithms::moment( vfloat( (Y.SH(s,1,0)).xVec(i+Nbc) ), pra, 5);
2672 // Qxbuf[i] -= Vxbuf *(VxVxbuf +VyVybuf +VzVzbuf )*nbuf ;
2673 // Qxbuf[i] -= 2.0 *( VxVxbuf *Vxbuf + VxVybuf *Vybuf + VxVzbuf*Vzbuf)*nbuf ;
2674 // Qxbuf[i] += 2.0 *( Vxbuf *Vxbuf + Vybuf *Vybuf +Vzbuf*Vzbuf ) * Vxbuf * nbuf ;
2675  Qxbuf[i] *= 0.5;
2676  }
2677 
2678  if (PE.NODES() > 1) {
2679  if (PE.RANK()!=0) {
2680  MPI_Send(Qxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2681  }
2682  else {
2683  // Fill data for rank = 0
2684  for(size_t i(0); i < outNxLocal; i++) {
2685  QxGlobal[i] = Qxbuf[i];
2686  }
2687  // Fill data for rank > 0
2688  for (int rr = 1; rr < PE.NODES(); ++rr){
2689  MPI_Recv(Qxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2690  for(size_t i(0); i < outNxLocal; i++) {
2691  QxGlobal[i + outNxLocal*rr] = Qxbuf[i];
2692  }
2693  }
2694  }
2695  }
2696  // Fill data for Nodes = 0
2697  else {
2698  for(size_t i(0); i < outNxGlobal; i++) {
2699  QxGlobal[i] = Qxbuf[i];
2700  }
2701  }
2702 
2703  if (PE.RANK() == 0) expo.Export_h5("Qx", QxGlobal, tout, s);
2704 
2705  }
2706 
2707  delete[] Qxbuf;
2708 
2709 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ Qy()

void Output_Data::Output_Preprocessor_1D::Qy ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2713 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Input::List(), Algorithms::MakeCAxis(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2714  {
2715 
2716 
2717  size_t Nbc = Input::List().BoundaryCells;
2718  MPI_Status status;
2719 
2720  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2721  size_t outNxGlobal(grid.axis.Nxg(0));
2722 
2723  int msg_sz(outNxLocal); //*szy);
2724 
2725  double Vxbuf;
2726  double Vybuf;
2727  double Vzbuf;
2728  double VxVxbuf;
2729  double VyVybuf;
2730  double VzVzbuf;
2731  double VxVybuf;
2732  double VxVzbuf;
2733  double VyVzbuf;
2734  double nbuf;
2735  double Ubuf;
2736 
2737  float* Qxbuf = new float[msg_sz];
2738  valarray<float> QxGlobal(outNxGlobal); //, yglob_axis.dim());
2739 
2740  for(int s(0); s < Y.Species(); ++s) {
2741 
2742 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2743  valarray<float> pra( Algorithms::MakeCAxis(float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
2744  for(size_t i(0); i < msg_sz; ++i) {
2745 // nbuf = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 2);
2746 // Ubuf = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 4);
2747 //
2748 // Vxbuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,0)).xVec(i+Nbc) ), pra, 3);
2749 // Vybuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2750 // Vzbuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2751 // Vxbuf /= nbuf;
2752 // Vybuf /= nbuf;
2753 // Vzbuf /= nbuf;
2754 //
2755 // VxVxbuf = 4.0/3.0*2.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,0)).xVec(i+Nbc) ), pra, 4);
2756 // VyVybuf = 4.0*4.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,2)).xVec(i+Nbc) ), pra, 4);
2757 // VzVzbuf = -1.0*VyVybuf;
2758 //
2759 // VyVybuf -= VxVxbuf/2.0;
2760 // VzVzbuf -= VxVxbuf/2.0;
2761 //
2762 // VxVxbuf += Ubuf/2.0;
2763 // VyVybuf += Ubuf/2.0;
2764 // VzVzbuf += Ubuf/2.0;
2765 //
2766 // VxVybuf = 4.0*2.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,1)).xVec(i+Nbc) ), pra, 4);
2767 // VxVzbuf = -4.0*2.0/5.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,2,1)).xVec(i+Nbc) ), pra, 4);
2768 // VyVzbuf = -4.0*4.0/5.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,2,2)).xVec(i+Nbc) ), pra, 4);
2769 //
2770 // VxVxbuf /= nbuf;
2771 // VyVybuf /= nbuf;
2772 // VzVzbuf /= nbuf;
2773 // VxVybuf /= nbuf;
2774 // VxVzbuf /= nbuf;
2775 // VyVzbuf /= nbuf;
2776 
2777  Qxbuf[i] = 8.0*M_PI/3.0*Algorithms::moment( vfloat( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 5);
2778 // Qxbuf[i] -= Vxbuf *(VxVxbuf +VyVybuf +VzVzbuf )*nbuf ;
2779 // Qxbuf[i] -= 2.0 *( VxVxbuf *Vxbuf + VxVybuf *Vybuf + VxVzbuf*Vzbuf)*nbuf ;
2780 // Qxbuf[i] += 2.0 *( Vxbuf *Vxbuf + Vybuf *Vybuf +Vzbuf*Vzbuf ) * Vxbuf * nbuf ;
2781  Qxbuf[i] *= 0.5;
2782  }
2783 
2784  if (PE.NODES() > 1) {
2785  if (PE.RANK()!=0) {
2786  MPI_Send(Qxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2787  }
2788  else {
2789  // Fill data for rank = 0
2790  for(size_t i(0); i < outNxLocal; i++) {
2791  QxGlobal[i] = Qxbuf[i];
2792  }
2793  // Fill data for rank > 0
2794  for (int rr = 1; rr < PE.NODES(); ++rr){
2795  MPI_Recv(Qxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2796  for(size_t i(0); i < outNxLocal; i++) {
2797  QxGlobal[i + outNxLocal*rr] = Qxbuf[i];
2798  }
2799  }
2800  }
2801  }
2802  // Fill data for Nodes = 0
2803  else {
2804  for(size_t i(0); i < outNxGlobal; i++) {
2805  QxGlobal[i] = Qxbuf[i];
2806  }
2807  }
2808 
2809  if (PE.RANK() == 0) expo.Export_h5("Qy", QxGlobal, tout, s);
2810 
2811  }
2812 
2813  delete[] Qxbuf;
2814 
2815 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ Qz()

void Output_Data::Output_Preprocessor_1D::Qz ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2819 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Input::List(), Algorithms::MakeCAxis(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat_complex().

2820  {
2821 
2822 
2823  size_t Nbc = Input::List().BoundaryCells;
2824  MPI_Status status;
2825 
2826  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2827  size_t outNxGlobal(grid.axis.Nxg(0));
2828 
2829  int msg_sz(outNxLocal); //*szy);
2830 
2831  double Vxbuf;
2832  double Vybuf;
2833  double Vzbuf;
2834  double VxVxbuf;
2835  double VyVybuf;
2836  double VzVzbuf;
2837  double VxVybuf;
2838  double VxVzbuf;
2839  double VyVzbuf;
2840  double nbuf;
2841  double Ubuf;
2842 
2843  float* Qxbuf = new float[msg_sz];
2844  valarray<float> QxGlobal(outNxGlobal); //, yglob_axis.dim());
2845 
2846  for(int s(0); s < Y.Species(); ++s) {
2847 
2848 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2849  valarray<float> pra( Algorithms::MakeCAxis( float(0.0),f_x.Pmax(s), f_x.Np(s) ) );
2850  for(size_t i(0); i < msg_sz; ++i) {
2851 // nbuf = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 2);
2852 // Ubuf = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 4);
2853 //
2854 // Vxbuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,0)).xVec(i+Nbc) ), pra, 3);
2855 // Vybuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2856 // Vzbuf = 4.0/3.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 3);
2857 // Vxbuf /= nbuf;
2858 // Vybuf /= nbuf;
2859 // Vzbuf /= nbuf;
2860 //
2861 // VxVxbuf = 4.0/3.0*2.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,0)).xVec(i+Nbc) ), pra, 4);
2862 // VyVybuf = 4.0*4.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,2)).xVec(i+Nbc) ), pra, 4);
2863 // VzVzbuf = -1.0*VyVybuf;
2864 //
2865 // VyVybuf -= VxVxbuf/2.0;
2866 // VzVzbuf -= VxVxbuf/2.0;
2867 //
2868 // VxVxbuf += Ubuf/2.0;
2869 // VyVybuf += Ubuf/2.0;
2870 // VzVzbuf += Ubuf/2.0;
2871 //
2872 // VxVybuf = 4.0*2.0/5.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,2,1)).xVec(i+Nbc) ), pra, 4);
2873 // VxVzbuf = -4.0*2.0/5.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,2,1)).xVec(i+Nbc) ), pra, 4);
2874 // VyVzbuf = -4.0*4.0/5.0*M_PI*Algorithms::moment( vfloat_complex( (Y.SH(s,2,2)).xVec(i+Nbc) ), pra, 4);
2875 //
2876 // VxVxbuf /= nbuf;
2877 // VyVybuf /= nbuf;
2878 // VzVzbuf /= nbuf;
2879 // VxVybuf /= nbuf;
2880 // VxVzbuf /= nbuf;
2881 // VyVzbuf /= nbuf;
2882 
2883  Qxbuf[i] = -8.0*M_PI/3.0*Algorithms::moment( vfloat_complex( (Y.SH(s,1,1)).xVec(i+Nbc) ), pra, 5);
2884 // Qxbuf[i] -= Vxbuf *(VxVxbuf +VyVybuf +VzVzbuf )*nbuf ;
2885 // Qxbuf[i] -= 2.0 *( VxVxbuf *Vxbuf + VxVybuf *Vybuf + VxVzbuf*Vzbuf)*nbuf ;
2886 // Qxbuf[i] += 2.0 *( Vxbuf *Vxbuf + Vybuf *Vybuf +Vzbuf*Vzbuf ) * Vxbuf * nbuf ;
2887  Qxbuf[i] *= 0.5;
2888  }
2889 
2890  if (PE.NODES() > 1) {
2891  if (PE.RANK()!=0) {
2892  MPI_Send(Qxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2893  }
2894  else {
2895  // Fill data for rank = 0
2896  for(size_t i(0); i < outNxLocal; i++) {
2897  QxGlobal[i] = Qxbuf[i];
2898  }
2899  // Fill data for rank > 0
2900  for (int rr = 1; rr < PE.NODES(); ++rr){
2901  MPI_Recv(Qxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2902  for(size_t i(0); i < outNxLocal; i++) {
2903  QxGlobal[i + outNxLocal*rr] = Qxbuf[i];
2904  }
2905  }
2906  }
2907  }
2908  // Fill data for Nodes = 0
2909  else {
2910  for(size_t i(0); i < outNxGlobal; i++) {
2911  QxGlobal[i] = Qxbuf[i];
2912  }
2913  }
2914 
2915  if (PE.RANK() == 0) expo.Export_h5("Qz", QxGlobal, tout, s);
2916 
2917  }
2918 
2919  delete[] Qxbuf;
2920 
2921 }
vector< float > vfloat_complex(const vector< complex< double > > vDouble)
Definition: nmethods.cpp:412
Export_Files::Xport expo
Definition: export.h:429
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ T()

void Output_Data::Output_Preprocessor_1D::T ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2345 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::DF(), Input::List(), Algorithms::MakeCAxis(), DistFunc1D::mass(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2346  {
2347 
2348 
2349  size_t Nbc = Input::List().BoundaryCells;
2350  MPI_Status status;
2351  // size_t st(0), bi(0);
2352  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2353  size_t outNxGlobal(grid.axis.Nxg(0));
2354 
2355  int msg_sz(outNxLocal); //*szy);
2356  // float* nbuf = new float[msg_sz];
2357  float* tbuf = new float[msg_sz];
2358  valarray<float> tGlobal(outNxGlobal); //, yglob_axis.dim());
2359 
2360  double convert_factor = (2.99792458e8)*(2.99792458e8)*(9.1093829e-31)/(1.602176565e-19);
2361 
2362  for(int s(0); s < Y.Species(); ++s) {
2363 
2364 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2365  valarray<float> pra( Algorithms::MakeCAxis(float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
2366  // float deltapra = pra[1] - pra[0];
2367 
2368  // need nbuf for density normalization
2369  for(size_t i(0); i < msg_sz; ++i) {
2370  tbuf[i] = 4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 4);
2371  tbuf[i] /= 3.0*4.0*M_PI*Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 2);
2372 
2373  // tbuf[i] *= convert_factor/Y.DF(s).mass();
2374 
2375  tbuf[i] *= 1.0/Y.DF(s).mass();
2376 
2377  }
2378 
2379 // for (int ix(0); ix < outNxLocal; ++ix){
2380 // double accumulator = 0.0;
2381 // for(int ip(0); ip < pra.size(); ++ip) {
2382 // double p_squared = pra[ip]*pra[ip];
2383 // double val = Y.SH(s,0,0)(ip,ix+Nbc).real();
2384 // // pr/dx() can be moved outside loop if anyone cares.
2385 // val *= (deltapra) *p_squared*p_squared;
2386 // accumulator += val;
2387 // }
2388 // tbuf[ix] = accumulator;
2389 // // do the normalization
2390 // tbuf[ix] *= ( 4.0*M_PI*2.0/3.0 );
2391 // // do the density part of the normalization...
2392 // tbuf[ix] /= nbuf[ix];
2393 
2394 // // double pth2 = ( TemperatureFromPthSq[ix] );
2395 // tbuf[ix] *= convert_factor;//pth2 / (1.0 + pth2) * convert_factor;
2396 // }
2397 
2398  if (PE.NODES() > 1) {
2399  if (PE.RANK()!=0) {
2400  MPI_Send(tbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2401  }
2402  else {
2403  // Fill data for rank = 0
2404  for(size_t i(0); i < outNxLocal; i++) {
2405  tGlobal[i] = tbuf[i];
2406  }
2407  // Fill data for rank > 0
2408  for (int rr = 1; rr < PE.NODES(); ++rr){
2409  MPI_Recv(tbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2410  for(size_t i(0); i < outNxLocal; i++) {
2411  tGlobal[i + outNxLocal*rr] = tbuf[i];
2412  }
2413  }
2414  }
2415  }
2416  // Fill data for Nodes = 0
2417  else {
2418  for(size_t i(0); i < outNxGlobal; i++) {
2419  tGlobal[i] = tbuf[i];
2420  }
2421  }
2422 
2423  if (PE.RANK() == 0) expo.Export_h5("T", tGlobal, tout, s);
2424 
2425  }
2426 
2427  // delete[] nbuf;
2428  delete[] tbuf;
2429 
2430 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
double mass() const
Definition: state.h:400
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
DistFunc1D & DF(size_t s)
Definition: state.h:602
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ Ti()

void Output_Data::Output_Preprocessor_1D::Ti ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 3360 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::HYDRO(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and Hydro1D::temperature().

3361  {
3362 
3363 
3364  size_t Nbc = Input::List().BoundaryCells;
3365  MPI_Status status;
3366  // size_t st(0), bi(0);
3367  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
3368  size_t outNxGlobal(grid.axis.Nxg(0));
3369 
3370  int msg_sz(outNxLocal); //*szy);
3371  float* Thydrobuf = new float[msg_sz];
3372  valarray<float> ThydroGlobal(outNxGlobal); //, yglob_axis.dim());
3373 
3374  for(size_t i(0); i < msg_sz; ++i) {
3375  Thydrobuf[i] = static_cast<float>(511000.0/3.0*Y.HYDRO().temperature(i+Nbc));
3376  }
3377 
3378  if (PE.NODES() > 1) {
3379  if (PE.RANK()!=0) {
3380  MPI_Send(Thydrobuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3381  }
3382  else {
3383  // Fill data for rank = 0
3384  for(size_t i(0); i < outNxLocal; i++) {
3385  ThydroGlobal[i] = Thydrobuf[i];
3386  }
3387  // Fill data for rank > 0
3388  for (int rr = 1; rr < PE.NODES(); ++rr){
3389  MPI_Recv(Thydrobuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3390  for(size_t i(0); i < outNxLocal; i++) {
3391  ThydroGlobal[i + outNxLocal*rr] = Thydrobuf[i];
3392  }
3393  }
3394  }
3395  }
3396  // Fill data for Nodes = 0
3397  else {
3398  for(size_t i(0); i < outNxGlobal; i++) {
3399  ThydroGlobal[i] = Thydrobuf[i];
3400  }
3401  }
3402 
3403  if (PE.RANK() == 0) expo.Export_h5("Ti", ThydroGlobal, tout, 0);
3404 
3405 
3406 
3407  delete[] Thydrobuf;
3408 
3409 }
Export_Files::Xport expo
Definition: export.h:429
Hydro1D & HYDRO()
Definition: state.h:613
double & temperature(size_t i)
Definition: state.h:539
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ Ux()

void Output_Data::Output_Preprocessor_1D::Ux ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 3092 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::HYDRO(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and Hydro1D::vx().

3093  {
3094 
3095 
3096  size_t Nbc = Input::List().BoundaryCells;
3097  MPI_Status status;
3098  // size_t st(0), bi(0);
3099  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
3100  size_t outNxGlobal(grid.axis.Nxg(0));
3101 
3102  int msg_sz(outNxLocal); //*szy);
3103  float* Uxbuf = new float[msg_sz];
3104  valarray<float> UxGlobal(outNxGlobal); //, yglob_axis.dim());
3105 
3106  for(size_t i(0); i < msg_sz; ++i) {
3107  Uxbuf[i] = static_cast<float>(Y.HYDRO().vx(i+Nbc));
3108  }
3109 
3110  if (PE.NODES() > 1) {
3111  if (PE.RANK()!=0) {
3112  MPI_Send(Uxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3113  }
3114  else {
3115  // Fill data for rank = 0
3116  for(size_t i(0); i < outNxLocal; i++) {
3117  UxGlobal[i] = Uxbuf[i];
3118  }
3119  // Fill data for rank > 0
3120  for (int rr = 1; rr < PE.NODES(); ++rr){
3121  MPI_Recv(Uxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3122  for(size_t i(0); i < outNxLocal; i++) {
3123  UxGlobal[i + outNxLocal*rr] = Uxbuf[i];
3124  }
3125  }
3126  }
3127  }
3128  // Fill data for Nodes = 0
3129  else {
3130  for(size_t i(0); i < outNxGlobal; i++) {
3131  UxGlobal[i] = Uxbuf[i];
3132  }
3133  }
3134 
3135  if (PE.RANK() == 0) expo.Export_h5("Ux", UxGlobal, tout, 0);
3136 
3137 
3138 
3139  delete[] Uxbuf;
3140 
3141 }
Export_Files::Xport expo
Definition: export.h:429
Hydro1D & HYDRO()
Definition: state.h:613
double & vx(size_t i)
Definition: state.h:530
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ Uy()

void Output_Data::Output_Preprocessor_1D::Uy ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 3144 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::HYDRO(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and Hydro1D::vy().

3145  {
3146 
3147 
3148  size_t Nbc = Input::List().BoundaryCells;
3149  MPI_Status status;
3150  // size_t st(0), bi(0);
3151  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
3152  size_t outNxGlobal(grid.axis.Nxg(0));
3153 
3154  int msg_sz(outNxLocal); //*szy);
3155  float* Uxbuf = new float[msg_sz];
3156  valarray<float> UxGlobal(outNxGlobal); //, yglob_axis.dim());
3157 
3158  for(size_t i(0); i < msg_sz; ++i) {
3159  Uxbuf[i] = static_cast<float>(Y.HYDRO().vy(i+Nbc));
3160  }
3161 
3162  if (PE.NODES() > 1) {
3163  if (PE.RANK()!=0) {
3164  MPI_Send(Uxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3165  }
3166  else {
3167  // Fill data for rank = 0
3168  for(size_t i(0); i < outNxLocal; i++) {
3169  UxGlobal[i] = Uxbuf[i];
3170  }
3171  // Fill data for rank > 0
3172  for (int rr = 1; rr < PE.NODES(); ++rr){
3173  MPI_Recv(Uxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3174  for(size_t i(0); i < outNxLocal; i++) {
3175  UxGlobal[i + outNxLocal*rr] = Uxbuf[i];
3176  }
3177  }
3178  }
3179  }
3180  // Fill data for Nodes = 0
3181  else {
3182  for(size_t i(0); i < outNxGlobal; i++) {
3183  UxGlobal[i] = Uxbuf[i];
3184  }
3185  }
3186 
3187  if (PE.RANK() == 0) expo.Export_h5("Uy", UxGlobal, tout, 0);
3188 
3189 
3190 
3191  delete[] Uxbuf;
3192 
3193 }
Export_Files::Xport expo
Definition: export.h:429
Hydro1D & HYDRO()
Definition: state.h:613
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
double & vy(size_t i)
Definition: state.h:533
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ Uz()

void Output_Data::Output_Preprocessor_1D::Uz ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 3196 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::HYDRO(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and Hydro1D::vz().

3197  {
3198 
3199 
3200  size_t Nbc = Input::List().BoundaryCells;
3201  MPI_Status status;
3202  // size_t st(0), bi(0);
3203  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
3204  size_t outNxGlobal(grid.axis.Nxg(0));
3205 
3206  int msg_sz(outNxLocal); //*szy);
3207  float* Uxbuf = new float[msg_sz];
3208  valarray<float> UxGlobal(outNxGlobal); //, yglob_axis.dim());
3209 
3210 
3211  for(size_t i(0); i < msg_sz; ++i) {
3212  Uxbuf[i] = static_cast<float>(Y.HYDRO().vz(i+Nbc));
3213  }
3214 
3215  if (PE.NODES() > 1) {
3216  if (PE.RANK()!=0) {
3217  MPI_Send(Uxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3218  }
3219  else {
3220  // Fill data for rank = 0
3221  for(size_t i(0); i < outNxLocal; i++) {
3222  UxGlobal[i] = Uxbuf[i];
3223  }
3224  // Fill data for rank > 0
3225  for (int rr = 1; rr < PE.NODES(); ++rr){
3226  MPI_Recv(Uxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3227  for(size_t i(0); i < outNxLocal; i++) {
3228  UxGlobal[i + outNxLocal*rr] = Uxbuf[i];
3229  }
3230  }
3231  }
3232  }
3233  // Fill data for Nodes = 0
3234  else {
3235  for(size_t i(0); i < outNxGlobal; i++) {
3236  UxGlobal[i] = Uxbuf[i];
3237  }
3238  }
3239 
3240  if (PE.RANK() == 0) expo.Export_h5("Uz", UxGlobal, tout, 0);
3241 
3242 
3243 
3244  delete[] Uxbuf;
3245 
3246 }
Export_Files::Xport expo
Definition: export.h:429
double & vz(size_t i)
Definition: state.h:536
Hydro1D & HYDRO()
Definition: state.h:613
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ vNx()

void Output_Data::Output_Preprocessor_1D::vNx ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2926 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Input::List(), Algorithms::MakeCAxis(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2927  {
2928 
2929 
2930  size_t Nbc = Input::List().BoundaryCells;
2931  MPI_Status status;
2932  // size_t st(0), bi(0);
2933  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2934  size_t outNxGlobal(grid.axis.Nxg(0));
2935 
2936  int msg_sz(outNxLocal); //*szy);
2937  float* vNxbuf = new float[msg_sz];
2938  valarray<float> vNxGlobal(outNxGlobal); //, yglob_axis.dim());
2939 
2940  for(int s(0); s < Y.Species(); ++s) {
2941 
2942 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
2943 
2944  valarray<float> pra( Algorithms::MakeCAxis( float(0.0),f_x.Pmax(s), f_x.Np(s) ) );
2945 
2946  for(size_t i(0); i < msg_sz; ++i) {
2947  vNxbuf[i] = (float) (1.0 / 6.0 * (Algorithms::moment(vfloat((Y.SH(s, 1, 0)).xVec(i + Nbc) ), pra, 6)
2948  / Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 5)));
2949  }
2950 
2951  if (PE.NODES() > 1) {
2952  if (PE.RANK()!=0) {
2953  MPI_Send(vNxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
2954  }
2955  else {
2956  // Fill data for rank = 0
2957  for(size_t i(0); i < outNxLocal; i++) {
2958  vNxGlobal[i] = vNxbuf[i];
2959  }
2960  // Fill data for rank > 0
2961  for (int rr = 1; rr < PE.NODES(); ++rr){
2962  MPI_Recv(vNxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
2963  for(size_t i(0); i < outNxLocal; i++) {
2964  vNxGlobal[i + outNxLocal*rr] = vNxbuf[i];
2965  }
2966  }
2967  }
2968  }
2969  // Fill data for Nodes = 0
2970  else {
2971  for(size_t i(0); i < outNxGlobal; i++) {
2972  vNxGlobal[i] = vNxbuf[i];
2973  }
2974  }
2975 
2976  if (PE.RANK() == 0) expo.Export_h5("vNx", vNxGlobal, tout, 0);
2977 
2978  }
2979 
2980  delete[] vNxbuf;
2981 
2982 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ vNy()

void Output_Data::Output_Preprocessor_1D::vNy ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 2985 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Input::List(), Algorithms::MakeCAxis(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), and vfloat().

2986  {
2987 
2988 
2989  size_t Nbc = Input::List().BoundaryCells;
2990  MPI_Status status;
2991  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
2992  size_t outNxGlobal(grid.axis.Nxg(0));
2993 
2994  int msg_sz(outNxLocal); //*szy);
2995  float* vNxbuf = new float[msg_sz];
2996  valarray<float> vNxGlobal(outNxGlobal);
2997 
2998  for(int s(0); s < Y.Species(); ++s) {
2999 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
3000  valarray<float> pra( Algorithms::MakeCAxis( float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
3001 
3002  for(size_t i(0); i < msg_sz; ++i) {
3003  vNxbuf[i] = (float) (2.0 / 6.0 * (Algorithms::moment(vfloat((Y.SH(s, 1, 1)).xVec(i + Nbc) ), pra, 6)
3004  / Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 5)));
3005  }
3006  if (PE.NODES() > 1) {
3007  if (PE.RANK()!=0) {
3008  MPI_Send(vNxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3009  }
3010  else {
3011  // Fill data for rank = 0
3012  for(size_t i(0); i < outNxLocal; i++) {
3013  vNxGlobal[i] = vNxbuf[i];
3014  }
3015  // Fill data for rank > 0
3016  for (int rr = 1; rr < PE.NODES(); ++rr){
3017  MPI_Recv(vNxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3018  for(size_t i(0); i < outNxLocal; i++) {
3019  vNxGlobal[i + outNxLocal*rr] = vNxbuf[i];
3020  }
3021  }
3022  }
3023  }
3024  // Fill data for Nodes = 0
3025  else {
3026  for(size_t i(0); i < outNxGlobal; i++) {
3027  vNxGlobal[i] = vNxbuf[i];
3028  }
3029  }
3030  if (PE.RANK() == 0) expo.Export_h5("vNy", vNxGlobal, tout, 0);
3031  }
3032  delete[] vNxbuf;
3033 }
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ vNz()

void Output_Data::Output_Preprocessor_1D::vNz ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 3037 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, Input::List(), Algorithms::MakeCAxis(), Algorithms::moment(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), State1D::SH(), State1D::Species(), vfloat(), and vfloat_complex().

3038  {
3039 
3040 
3041  size_t Nbc = Input::List().BoundaryCells;
3042  MPI_Status status;
3043  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
3044  size_t outNxGlobal(grid.axis.Nxg(0));
3045 
3046  int msg_sz(outNxLocal);
3047  float* vNxbuf = new float[msg_sz];
3048  valarray<float> vNxGlobal(outNxGlobal);
3049 
3050  for(int s(0); s < Y.Species(); ++s) {
3051 // valarray<float> pra( Algorithms::MakeAxis( f_x.Pmin(s), f_x.Pmax(s), f_x.Np(s) ) );
3052 
3053  valarray<float> pra( Algorithms::MakeCAxis( float(0.0), f_x.Pmax(s), f_x.Np(s) ) );
3054 
3055  for(size_t i(0); i < msg_sz; ++i) {
3056  vNxbuf[i] = (float) (-2.0 / 6.0 * (Algorithms::moment(vfloat_complex((Y.SH(s, 1, 1)).xVec(i + Nbc) ), pra, 6)
3057  / Algorithms::moment( vfloat( (Y.SH(s,0,0)).xVec(i+Nbc) ), pra, 5)));
3058  }
3059  if (PE.NODES() > 1) {
3060  if (PE.RANK()!=0) {
3061  MPI_Send(vNxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3062  }
3063  else {
3064  // Fill data for rank = 0
3065  for(size_t i(0); i < outNxLocal; i++) {
3066  vNxGlobal[i] = vNxbuf[i];
3067  }
3068  // Fill data for rank > 0
3069  for (int rr = 1; rr < PE.NODES(); ++rr){
3070  MPI_Recv(vNxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3071  for(size_t i(0); i < outNxLocal; i++) {
3072  vNxGlobal[i + outNxLocal*rr] = vNxbuf[i];
3073  }
3074  }
3075  }
3076  }
3077  // Fill data for Nodes = 0
3078  else {
3079  for(size_t i(0); i < outNxGlobal; i++) {
3080  vNxGlobal[i] = vNxbuf[i];
3081  }
3082  }
3083  if (PE.RANK() == 0) expo.Export_h5("vNz", vNxGlobal, tout, 0);
3084  }
3085  delete[] vNxbuf;
3086 }
vector< float > vfloat_complex(const vector< complex< double > > vDouble)
Definition: nmethods.cpp:412
Export_Files::Xport expo
Definition: export.h:429
valarray< float > vfloat(const valarray< double > &vDouble)
Definition: nmethods.cpp:381
float Pmax(size_t s) const
Definition: export.h:390
size_t Np(size_t s) const
Definition: export.h:388
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:

◆ Z()

void Output_Data::Output_Preprocessor_1D::Z ( const State1D Y,
const Grid_Info grid,
const size_t  tout,
const Parallel_Environment_1D PE 
)
private

Definition at line 3249 of file export.cpp.

References Grid_Info::axis, Input::Input_List::BoundaryCells, State1D::HYDRO(), Input::List(), Parallel_Environment_1D::NODES(), Algorithms::AxisBundle< T >::Nx(), Algorithms::AxisBundle< T >::Nxg(), Parallel_Environment_1D::RANK(), and Hydro1D::Z().

3250  {
3251 
3252 
3253  size_t Nbc = Input::List().BoundaryCells;
3254  MPI_Status status;
3255  // size_t st(0), bi(0);
3256  size_t outNxLocal(grid.axis.Nx(0) - 2*Nbc);
3257  size_t outNxGlobal(grid.axis.Nxg(0));
3258 
3259  int msg_sz(outNxLocal); //*szy);
3260  float* Uxbuf = new float[msg_sz];
3261  valarray<float> UxGlobal(outNxGlobal); //, yglob_axis.dim());
3262 
3263 
3264  for(size_t i(0); i < msg_sz; ++i) {
3265  Uxbuf[i] = static_cast<float>(Y.HYDRO().Z(i+Nbc));
3266  }
3267 
3268  if (PE.NODES() > 1) {
3269  if (PE.RANK()!=0) {
3270  MPI_Send(Uxbuf, msg_sz, MPI_FLOAT, 0, PE.RANK(), MPI_COMM_WORLD);
3271  }
3272  else {
3273  // Fill data for rank = 0
3274  for(size_t i(0); i < outNxLocal; i++) {
3275  UxGlobal[i] = Uxbuf[i];
3276  }
3277  // Fill data for rank > 0
3278  for (int rr = 1; rr < PE.NODES(); ++rr){
3279  MPI_Recv(Uxbuf, msg_sz, MPI_FLOAT, rr, rr, MPI_COMM_WORLD, &status);
3280  for(size_t i(0); i < outNxLocal; i++) {
3281  UxGlobal[i + outNxLocal*rr] = Uxbuf[i];
3282  }
3283  }
3284  }
3285  }
3286  // Fill data for Nodes = 0
3287  else {
3288  for(size_t i(0); i < outNxGlobal; i++) {
3289  UxGlobal[i] = Uxbuf[i];
3290  }
3291  }
3292 
3293  if (PE.RANK() == 0) expo.Export_h5("Z", UxGlobal, tout, 0);
3294 
3295 
3296 
3297  delete[] Uxbuf;
3298 
3299 }
Export_Files::Xport expo
Definition: export.h:429
Hydro1D & HYDRO()
Definition: state.h:613
double & Z(size_t i)
Definition: state.h:542
const Algorithms::AxisBundle< double > axis
Definition: setup.h:47
Input_List & List()
Definition: input.cpp:1585
size_t Nx(size_t i) const
size_t Nxg(size_t i) const
void Export_h5(const std::string tag, std::valarray< float > ex, const size_t &step, const int spec=-1)
Definition: export.cpp:3416
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

Field Documentation

◆ expo

Export_Files::Xport Output_Data::Output_Preprocessor_1D::expo
private

Definition at line 429 of file export.h.

◆ f_x

fx1_1D Output_Data::Output_Preprocessor_1D::f_x
private

Definition at line 431 of file export.h.

◆ Nbc

size_t Output_Data::Output_Preprocessor_1D::Nbc
private

Definition at line 428 of file export.h.

◆ oTags

vector< string > Output_Data::Output_Preprocessor_1D::oTags
private

Definition at line 433 of file export.h.

◆ px_x

p1x1_1D Output_Data::Output_Preprocessor_1D::px_x
private

Definition at line 430 of file export.h.


The documentation for this class was generated from the following files: