Classes | Defines | Typedefs | Functions | Variables

Interface.cpp File Reference

#include "Interface.hpp"
#include "Albany_MpasSTKMeshStruct.hpp"
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_RCP.hpp"
#include "Albany_Utils.hpp"
#include "Albany_SolverFactory.hpp"
#include "Teuchos_XMLParameterListHelpers.hpp"
#include <stk_mesh/base/FieldData.hpp>
#include "Piro_PerformSolve.hpp"
#include "Thyra_EpetraThyraWrappers.hpp"
#include <stk_io/IossBridge.hpp>
#include <stk_io/MeshReadWriteUtils.hpp>
#include <stk_mesh/base/GetEntities.hpp>
#include <Ionit_Initializer.h>
#include "Albany_OrdinarySTKFieldContainer.hpp"
Include dependency graph for Interface.cpp:

Go to the source code of this file.

Classes

struct  TET_

Defines

#define GET_HERE   printf("get %25s, line: %d\n", __FILE__, __LINE__);

Typedefs

typedef struct TET_ TET

Functions

Teuchos::RCP< const Epetra_Vector > epetraVectorFromThyra (const Teuchos::RCP< const Epetra_Comm > &comm, const Teuchos::RCP< const Thyra::VectorBase< double > > &thyra)
Teuchos::RCP< const
Epetra_MultiVector > 
epetraMultiVectorFromThyra (const Teuchos::RCP< const Epetra_Comm > &comm, const Teuchos::RCP< const Thyra::MultiVectorBase< double > > &thyra)
void epetraFromThyra (const Teuchos::RCP< const Epetra_Comm > &comm, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< double > > > &thyraResponses, const Teuchos::Array< Teuchos::Array< Teuchos::RCP< const Thyra::MultiVectorBase< double > > > > &thyraSensitivities, Teuchos::Array< Teuchos::RCP< const Epetra_Vector > > &responses, Teuchos::Array< Teuchos::Array< Teuchos::RCP< const Epetra_MultiVector > > > &sensitivities)
int velocity_solver_init_mpi_ (int *fComm)
 Interface functions.
void velocity_solver_set_grid_data_ (int const *_nCells_F, int const *_nEdges_F, int const *_nVertices_F, int const *_nLayers, int const *_nCellsSolve_F, int const *_nEdgesSolve_F, int const *_nVerticesSolve_F, int const *_maxNEdgesOnCell_F, double const *radius_F, int const *_cellsOnEdge_F, int const *_cellsOnVertex_F, int const *_verticesOnCell_F, int const *_verticesOnEdge_F, int const *_edgesOnCell_F, int const *_nEdgesOnCells_F, int const *_indexToCellID_F, double const *_xCell_F, double const *_yCell_F, double const *_zCell_F, double const *_areaTriangle_F, int const *sendCellsArray_F, int const *recvCellsArray_F, int const *sendEdgesArray_F, int const *recvEdgesArray_F, int const *sendVerticesArray_F, int const *recvVerticesArray_F)
void velocity_solver_init_l1l2_ (double const *levelsRatio_F)
void velocity_solver_export_2d_data_ (double const *lowerSurface_F, double const *thickness_F, double const *beta_F)
void velocity_solver_solve_l1l2_ (double const *lowerSurface_F, double const *thickness_F, double const *beta_F, double const *temperature_F, double *u_normal_F, double *, double *)
void velocity_solver_export_l1l2_velocity_ ()
void velocity_solver_init_fo_ (double const *levelsRatio_F)
void velocity_solver_solve_fo_ (double const *lowerSurface_F, double const *thickness_F, double const *beta_F, double const *temperature_F, double *u_normal_F, double *, double *)
void velocity_solver_export_fo_velocity_ ()
void velocity_solver_finalize_ ()
void velocity_solver_compute_2d_grid_ (int const *verticesMask_F)
void velocity_solver_extrude_3d_grid_ (double const *levelsRatio_F, double const *lowerSurface_F, double const *thickness_F)
void get_tetraP1_velocity_on_FEdges (double *uNormal, const std::vector< double > &velocityOnVertices, const std::vector< int > &edgeToFEdge, const std::vector< int > &mpasIndexToVertexID)
void get_prism_velocity_on_FEdges (double *uNormal, const std::vector< double > &velocityOnVertices, const std::vector< int > &edgeToFEdge)
void mapVerticesToCells (const std::vector< double > &velocityOnVertices, double *velocityOnCells, int fieldDim, int numLayers, int ordering)
void createReverseCellsExchangeLists (exchangeList_Type &sendListReverse_F, exchangeList_Type &receiveListReverse_F, const std::vector< int > &fVertexToTriangleID, const std::vector< int > &fCellToVertexID)
void createReverseEdgesExchangeLists (exchangeList_Type &sendListReverse_F, exchangeList_Type &receiveListReverse_F, const std::vector< int > &fVertexToTriangleID, const std::vector< int > &fEdgeToEdgeID)
void mapCellsToVertices (const std::vector< double > &velocityOnCells, std::vector< double > &velocityOnVertices, int fieldDim, int numLayers, int ordering)
bool isGhostTriangle (int i, double relTol)
double signedTriangleArea (const double *x, const double *y)
double signedTriangleAreaOnSphere (const double *x, const double *y, const double *z)
void extendMaskByOneLayer (int const *verticesMask_F, std::vector< int > &extendedFVerticesMask)
void import2DFields (double const *lowerSurface_F, double const *thickness_F, double const *beta_F, double eps)
void importP0Temperature (double const *temperature_F)
void createReducedMPI (int nLocalEntities, MPI_Comm &reduced_comm_id)
void computeLocalOffset (int nLocalEntities, int &localOffset, int &nGlobalEntities)
void getProcIds (std::vector< int > &field, int const *recvArray)
void getProcIds (std::vector< int > &field, exchangeList_Type const *recvList)
exchangeList_Type unpackMpiArray (int const *array)
void allToAll (std::vector< int > &field, int const *sendArray, int const *recvArray, int fieldDim)
void allToAll (std::vector< int > &field, exchangeList_Type const *sendList, exchangeList_Type const *recvList, int fieldDim)
void allToAll (double *field, exchangeList_Type const *sendList, exchangeList_Type const *recvList, int fieldDim)
int initialize_iceProblem (int nTriangles)

Variables

Teuchos::RCP
< Albany::MpasSTKMeshStruct
meshStruct2D
 Includes.
Teuchos::RCP
< Albany::MpasSTKMeshStruct
meshStruct
Teuchos::RCP< const Epetra_Comm > mpiComm
Teuchos::RCP
< Teuchos::ParameterList > 
appParams
Teuchos::RCP
< Teuchos::ParameterList > 
discParams
Teuchos::RCP
< Albany::SolverFactory
slvrfctry
Teuchos::RCP
< Thyra::ModelEvaluator
< double > > 
solver
int Ordering = 0
MPI_Comm comm
MPI_Comm reducedComm
bool isDomainEmpty = true
bool initialize_velocity = true
bool first_time_step = true
int nCells_F
int nEdges_F
int nVertices_F
int nCellsSolve_F
int nEdgesSolve_F
int nVerticesSolve_F
int nVertices
int nEdges
int nTriangles
int nGlobalVertices
int nGlobalEdges
int nGlobalTriangles
int maxNEdgesOnCell_F
int const * cellsOnEdge_F
int const * cellsOnVertex_F
int const * verticesOnCell_F
int const * verticesOnEdge_F
int const * edgesOnCell_F
int const * indexToCellID_F
int const * nEdgesOnCells_F
std::vector< double > layersRatio
std::vector< double > levelsNormalizedThickness
int nLayers
double const * xCell_F
double const * yCell_F
double const * zCell_F
double const * areaTriangle_F
std::vector< double > xCellProjected
std::vector< double > yCellProjected
std::vector< double > zCellProjected
const double unit_length = 1000
const double T0 = 273.15
const double minThick = 1e-2
const double minBeta = 1e-5
void * phgGrid = 0
std::vector< int > edgesToReceive
std::vector< int > fCellsToReceive
std::vector< int > indexToTriangleID
std::vector< int > verticesOnTria
std::vector< int > trianglesOnEdge
std::vector< int > trianglesPositionsOnEdge
std::vector< int > verticesOnEdge
std::vector< int > indexToVertexID
std::vector< int > vertexToFCell
std::vector< int > indexToEdgeID
std::vector< int > edgeToFEdge
std::vector< int > mask
std::vector< int > fVertexToTriangleID
std::vector< int > fCellToVertex
std::vector< double > temperatureOnTetra
std::vector< double > velocityOnVertices
std::vector< double > velocityOnCells
std::vector< double > elevationData
std::vector< double > thicknessData
std::vector< double > betaData
std::vector< double > smb_F
std::vector< double > thicknessOnCells
std::vector< bool > isVertexBoundary
std::vector< bool > isBoundaryEdge
int numBoundaryEdges
double radius
exchangeList_Type const * sendCellsList_F = 0
exchangeList_Type const * recvCellsList_F = 0
exchangeList_Type const * sendEdgesList_F = 0
exchangeList_Type const * recvEdgesList_F = 0
exchangeList_Type const * sendVerticesList_F = 0
exchangeList_Type const * recvVerticesList_F = 0
exchangeList_Type sendCellsListReversed
exchangeList_Type recvCellsListReversed
exchangeList_Type sendEdgesListReversed
exchangeList_Type recvEdgesListReversed

Define Documentation

#define GET_HERE   printf("get %25s, line: %d\n", __FILE__, __LINE__);

Definition at line 273 of file Interface.cpp.


Typedef Documentation

typedef struct TET_ TET

Function Documentation

Teuchos::RCP<const Epetra_Vector> epetraVectorFromThyra ( const Teuchos::RCP< const Epetra_Comm > &  comm,
const Teuchos::RCP< const Thyra::VectorBase< double > > &  thyra 
)

Definition at line 92 of file Interface.cpp.

Teuchos::RCP<const Epetra_MultiVector> epetraMultiVectorFromThyra ( const Teuchos::RCP< const Epetra_Comm > &  comm,
const Teuchos::RCP< const Thyra::MultiVectorBase< double > > &  thyra 
)

Definition at line 105 of file Interface.cpp.

void epetraFromThyra ( const Teuchos::RCP< const Epetra_Comm > &  comm,
const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< double > > > &  thyraResponses,
const Teuchos::Array< Teuchos::Array< Teuchos::RCP< const Thyra::MultiVectorBase< double > > > > &  thyraSensitivities,
Teuchos::Array< Teuchos::RCP< const Epetra_Vector > > &  responses,
Teuchos::Array< Teuchos::Array< Teuchos::RCP< const Epetra_MultiVector > > > &  sensitivities 
)

Definition at line 117 of file Interface.cpp.

int velocity_solver_init_mpi_ ( int *  fComm  ) 

Interface functions.

Interface function.

Definition at line 184 of file Interface.cpp.

void velocity_solver_set_grid_data_ ( int const *  _nCells_F,
int const *  _nEdges_F,
int const *  _nVertices_F,
int const *  _nLayers,
int const *  _nCellsSolve_F,
int const *  _nEdgesSolve_F,
int const *  _nVerticesSolve_F,
int const *  _maxNEdgesOnCell_F,
double const *  radius_F,
int const *  _cellsOnEdge_F,
int const *  _cellsOnVertex_F,
int const *  _verticesOnCell_F,
int const *  _verticesOnEdge_F,
int const *  _edgesOnCell_F,
int const *  _nEdgesOnCells_F,
int const *  _indexToCellID_F,
double const *  _xCell_F,
double const *  _yCell_F,
double const *  _zCell_F,
double const *  _areaTriangle_F,
int const *  sendCellsArray_F,
int const *  recvCellsArray_F,
int const *  sendEdgesArray_F,
int const *  recvEdgesArray_F,
int const *  sendVerticesArray_F,
int const *  recvVerticesArray_F 
)

Definition at line 194 of file Interface.cpp.

void velocity_solver_init_l1l2_ ( double const *  levelsRatio_F  ) 

Definition at line 252 of file Interface.cpp.

void velocity_solver_export_2d_data_ ( double const *  lowerSurface_F,
double const *  thickness_F,
double const *  beta_F 
)

Definition at line 279 of file Interface.cpp.

void velocity_solver_solve_l1l2_ ( double const *  lowerSurface_F,
double const *  thickness_F,
double const *  beta_F,
double const *  temperature_F,
double *  u_normal_F,
double *  ,
double *   
)

Definition at line 296 of file Interface.cpp.

void velocity_solver_export_l1l2_velocity_ (  ) 

Definition at line 304 of file Interface.cpp.

void velocity_solver_init_fo_ ( double const *  levelsRatio_F  ) 

Definition at line 337 of file Interface.cpp.

void velocity_solver_solve_fo_ ( double const *  lowerSurface_F,
double const *  thickness_F,
double const *  beta_F,
double const *  temperature_F,
double *  u_normal_F,
double *  ,
double *   
)

Definition at line 357 of file Interface.cpp.

void velocity_solver_export_fo_velocity_ (  ) 

Definition at line 519 of file Interface.cpp.

void velocity_solver_finalize_ (  ) 

Definition at line 532 of file Interface.cpp.

void velocity_solver_compute_2d_grid_ ( int const *  verticesMask_F  ) 

Definition at line 555 of file Interface.cpp.

void velocity_solver_extrude_3d_grid_ ( double const *  levelsRatio_F,
double const *  lowerSurface_F,
double const *  thickness_F 
)

Definition at line 952 of file Interface.cpp.

void get_tetraP1_velocity_on_FEdges ( double *  uNormal,
const std::vector< double > &  velocityOnVertices,
const std::vector< int > &  edgeToFEdge,
const std::vector< int > &  mpasIndexToVertexID 
)

Definition at line 1011 of file Interface.cpp.

void get_prism_velocity_on_FEdges ( double *  uNormal,
const std::vector< double > &  velocityOnVertices,
const std::vector< int > &  edgeToFEdge 
)

Definition at line 1053 of file Interface.cpp.

void mapVerticesToCells ( const std::vector< double > &  velocityOnVertices,
double *  velocityOnCells,
int  fieldDim,
int  numLayers,
int  ordering 
)

Definition at line 1094 of file Interface.cpp.

void createReverseCellsExchangeLists ( exchangeList_Type sendListReverse_F,
exchangeList_Type receiveListReverse_F,
const std::vector< int > &  fVertexToTriangleID,
const std::vector< int > &  fCellToVertexID 
)

Definition at line 1124 of file Interface.cpp.

void createReverseEdgesExchangeLists ( exchangeList_Type sendListReverse_F,
exchangeList_Type receiveListReverse_F,
const std::vector< int > &  fVertexToTriangleID,
const std::vector< int > &  fEdgeToEdgeID 
)

Definition at line 1194 of file Interface.cpp.

void mapCellsToVertices ( const std::vector< double > &  velocityOnCells,
std::vector< double > &  velocityOnVertices,
int  fieldDim,
int  numLayers,
int  ordering 
)

Definition at line 1388 of file Interface.cpp.

bool isGhostTriangle ( int  i,
double  relTol 
)

Definition at line 1411 of file Interface.cpp.

double signedTriangleArea ( const double *  x,
const double *  y 
)

Definition at line 1426 of file Interface.cpp.

double signedTriangleAreaOnSphere ( const double *  x,
const double *  y,
const double *  z 
)

Definition at line 1434 of file Interface.cpp.

void extendMaskByOneLayer ( int const *  verticesMask_F,
std::vector< int > &  extendedFVerticesMask 
)

Definition at line 1446 of file Interface.cpp.

void import2DFields ( double const *  lowerSurface_F,
double const *  thickness_F,
double const *  beta_F,
double  eps 
)

Definition at line 1466 of file Interface.cpp.

void importP0Temperature ( double const *  temperature_F  ) 

Definition at line 1536 of file Interface.cpp.

void createReducedMPI ( int  nLocalEntities,
MPI_Comm &  reduced_comm_id 
)

Definition at line 1571 of file Interface.cpp.

void computeLocalOffset ( int  nLocalEntities,
int &  localOffset,
int &  nGlobalEntities 
)

Definition at line 1593 of file Interface.cpp.

void getProcIds ( std::vector< int > &  field,
int const *  recvArray 
)

Definition at line 1612 of file Interface.cpp.

void getProcIds ( std::vector< int > &  field,
exchangeList_Type const *  recvList 
)

Definition at line 1629 of file Interface.cpp.

exchangeList_Type unpackMpiArray ( int const *  array  ) 

Definition at line 1645 of file Interface.cpp.

void allToAll ( std::vector< int > &  field,
int const *  sendArray,
int const *  recvArray,
int  fieldDim 
)

Definition at line 1658 of file Interface.cpp.

void allToAll ( std::vector< int > &  field,
exchangeList_Type const *  sendList,
exchangeList_Type const *  recvList,
int  fieldDim 
)

Definition at line 1715 of file Interface.cpp.

void allToAll ( double *  field,
exchangeList_Type const *  sendList,
exchangeList_Type const *  recvList,
int  fieldDim 
)

Definition at line 1756 of file Interface.cpp.

int initialize_iceProblem ( int  nTriangles  ) 

Definition at line 1797 of file Interface.cpp.


Variable Documentation

Includes.

Namespaces

Definition at line 35 of file Interface.cpp.

Definition at line 36 of file Interface.cpp.

Teuchos::RCP<const Epetra_Comm> mpiComm

Definition at line 37 of file Interface.cpp.

Teuchos::RCP<Teuchos::ParameterList> appParams

Definition at line 38 of file Interface.cpp.

Teuchos::RCP<Teuchos::ParameterList> discParams

Definition at line 39 of file Interface.cpp.

Definition at line 40 of file Interface.cpp.

Teuchos::RCP<Thyra::ModelEvaluator<double> > solver

Definition at line 41 of file Interface.cpp.

int Ordering = 0

Definition at line 42 of file Interface.cpp.

MPI_Comm comm

Definition at line 43 of file Interface.cpp.

MPI_Comm reducedComm

Definition at line 43 of file Interface.cpp.

bool isDomainEmpty = true

Definition at line 44 of file Interface.cpp.

bool initialize_velocity = true

Definition at line 45 of file Interface.cpp.

bool first_time_step = true

Definition at line 46 of file Interface.cpp.

int nCells_F

Definition at line 47 of file Interface.cpp.

int nEdges_F

Definition at line 47 of file Interface.cpp.

Definition at line 47 of file Interface.cpp.

Definition at line 48 of file Interface.cpp.

Definition at line 48 of file Interface.cpp.

Definition at line 48 of file Interface.cpp.

int nVertices

Definition at line 49 of file Interface.cpp.

int nEdges

Definition at line 49 of file Interface.cpp.

Definition at line 49 of file Interface.cpp.

Definition at line 49 of file Interface.cpp.

Definition at line 49 of file Interface.cpp.

Definition at line 49 of file Interface.cpp.

Definition at line 50 of file Interface.cpp.

int const* cellsOnEdge_F

Definition at line 51 of file Interface.cpp.

int const * cellsOnVertex_F

Definition at line 51 of file Interface.cpp.

int const * verticesOnCell_F

Definition at line 51 of file Interface.cpp.

int const * verticesOnEdge_F

Definition at line 51 of file Interface.cpp.

int const * edgesOnCell_F

Definition at line 51 of file Interface.cpp.

int const * indexToCellID_F

Definition at line 51 of file Interface.cpp.

int const * nEdgesOnCells_F

Definition at line 51 of file Interface.cpp.

std::vector<double> layersRatio

Definition at line 52 of file Interface.cpp.

std::vector<double> levelsNormalizedThickness

Definition at line 52 of file Interface.cpp.

int nLayers

Definition at line 53 of file Interface.cpp.

double const* xCell_F

Definition at line 54 of file Interface.cpp.

double const * yCell_F

Definition at line 54 of file Interface.cpp.

double const * zCell_F

Definition at line 54 of file Interface.cpp.

double const * areaTriangle_F

Definition at line 54 of file Interface.cpp.

std::vector<double> xCellProjected

Definition at line 55 of file Interface.cpp.

std::vector<double> yCellProjected

Definition at line 55 of file Interface.cpp.

std::vector<double> zCellProjected

Definition at line 55 of file Interface.cpp.

const double unit_length = 1000

Definition at line 56 of file Interface.cpp.

const double T0 = 273.15

Definition at line 57 of file Interface.cpp.

const double minThick = 1e-2

Definition at line 58 of file Interface.cpp.

const double minBeta = 1e-5

Definition at line 59 of file Interface.cpp.

void* phgGrid = 0

Definition at line 60 of file Interface.cpp.

std::vector<int> edgesToReceive

Definition at line 61 of file Interface.cpp.

std::vector<int> fCellsToReceive

Definition at line 61 of file Interface.cpp.

std::vector<int> indexToTriangleID

Definition at line 61 of file Interface.cpp.

std::vector<int> verticesOnTria

Definition at line 61 of file Interface.cpp.

std::vector<int> trianglesOnEdge

Definition at line 61 of file Interface.cpp.

std::vector<int> trianglesPositionsOnEdge

Definition at line 61 of file Interface.cpp.

std::vector<int> verticesOnEdge

Definition at line 61 of file Interface.cpp.

std::vector<int> indexToVertexID

Definition at line 62 of file Interface.cpp.

std::vector<int> vertexToFCell

Definition at line 62 of file Interface.cpp.

std::vector<int> indexToEdgeID

Definition at line 62 of file Interface.cpp.

std::vector<int> edgeToFEdge

Definition at line 62 of file Interface.cpp.

std::vector<int> mask

Definition at line 62 of file Interface.cpp.

std::vector<int> fVertexToTriangleID

Definition at line 62 of file Interface.cpp.

std::vector<int> fCellToVertex

Definition at line 62 of file Interface.cpp.

std::vector<double> temperatureOnTetra

Definition at line 63 of file Interface.cpp.

std::vector<double> velocityOnVertices

Definition at line 63 of file Interface.cpp.

std::vector<double> velocityOnCells

Definition at line 63 of file Interface.cpp.

std::vector<double> elevationData

Definition at line 63 of file Interface.cpp.

std::vector<double> thicknessData

Definition at line 63 of file Interface.cpp.

std::vector<double> betaData

Definition at line 63 of file Interface.cpp.

std::vector<double> smb_F

Definition at line 63 of file Interface.cpp.

std::vector<double> thicknessOnCells

Definition at line 63 of file Interface.cpp.

std::vector<bool> isVertexBoundary

Definition at line 64 of file Interface.cpp.

std::vector<bool> isBoundaryEdge

Definition at line 64 of file Interface.cpp.

Definition at line 65 of file Interface.cpp.

double radius

Definition at line 67 of file Interface.cpp.

Definition at line 69 of file Interface.cpp.

Definition at line 69 of file Interface.cpp.

Definition at line 70 of file Interface.cpp.

Definition at line 70 of file Interface.cpp.

Definition at line 71 of file Interface.cpp.

Definition at line 71 of file Interface.cpp.

Definition at line 72 of file Interface.cpp.

Definition at line 72 of file Interface.cpp.

Definition at line 72 of file Interface.cpp.

Definition at line 72 of file Interface.cpp.