22 #include "MooseTypes.h" 33 #include "libmesh/point.h" 48 static int build_only;
128 void write_usrwrk_field_file(
const int & slot,
const std::string & prefix,
const dfloat & time,
const int & step,
const bool & write_coords);
136 void write_field_file(
const std::string & prefix,
const dfloat time,
const int & step);
321 template <
typename T>
322 void allgatherv(
const std::vector<int> & base_counts,
325 const int multiplier = 1);
337 const int multiplier);
358 double * scratch,
const double * I,
double * x,
int N,
double * Ix,
int M);
367 Point
centroidFace(
int local_elem_id,
int local_face_id);
382 Point
gllPoint(
int local_elem_id,
int local_node_id);
392 Point
gllPointFace(
int local_elem_id,
int local_face_id,
int local_node_id);
402 const std::vector<int> & boundary,
418 void scaleUsrwrk(
const unsigned int & slot,
const dfloat & value);
485 const std::vector<int> & boundary_id,
506 double massFlowrate(
const std::vector<int> & boundary_id,
664 validBoundaryIDs(
const std::vector<int> & boundary_id,
int & first_invalid_id,
int & n_boundaries);
744 double get_scalar01(
const int id,
const int surf_offset);
751 double get_scalar02(
const int id,
const int surf_offset);
758 double get_scalar03(
const int id,
const int surf_offset);
765 double get_usrwrk00(
const int id,
const int surf_offset);
772 double get_usrwrk01(
const int id,
const int surf_offset);
779 double get_usrwrk02(
const int id,
const int surf_offset);
793 double get_pressure(
const int id,
const int surf_offset);
800 double get_unity(
const int id,
const int surf_offset);
828 double get_velocity(
const int id,
const int surf_offset);
863 void set_flux(
const int id,
const dfloat value);
975 template <
typename T>
985 template <
typename T>
987 allgatherv(
const std::vector<int> & base_counts,
const T * input, T *
output,
const int multiplier)
989 int * recvCounts = (
int *)calloc(
commSize(),
sizeof(int));
990 int * displacement = (
int *)calloc(
commSize(),
sizeof(int));
993 MPI_Allgatherv(input,
997 (
const int *)recvCounts,
998 (
const int *)displacement,
1000 platform->comm.mpiComm);
Cardinal-specific nekRS API.
Definition: NekUility.C:21
void set_heat_source(const int id, const dfloat value)
MPI_Datatype resolveType()
void setStartTime(const double &start)
int mesh_velocity_z
z-velocity of moving boundary (for mesh blending solver)
Definition: NekInterface.h:692
Definition: NekInterface.h:702
double sideMassFluxWeightedIntegral(const std::vector< int > &boundary_id, const field::NekFieldEnum &integrand, const nek_mesh::NekMeshEnum pp_mesh)
bool endControlNumSteps()
double get_velocity(const int id, const int surf_offset)
double ds03_ref
Definition: NekInterface.h:721
void storeBoundaryCoupling(const std::vector< int > &boundary_id, int &N)
void(*)(int, dfloat) solutionWritePointer(const field::NekWriteEnum &field)
Definition: NekInterface.h:736
double get_scalar01(const int id, const int surf_offset)
void initializeScratch(const unsigned int &n_slots)
double get_usrwrk01(const int id, const int surf_offset)
double massFlowrate(const std::vector< int > &boundary_id, const nek_mesh::NekMeshEnum pp_mesh)
NekWriteEnum
Enumeration of possible fields to write in nekRS.
Definition: CardinalEnums.h:116
double P_ref
Definition: NekInterface.h:707
double get_velocity_x_squared(const int id, const int surf_offset)
double A_ref
Definition: NekInterface.h:709
void dimensionalizeVolume(double &integral)
void write_usrwrk_field_file(const int &slot, const std::string &prefix, const dfloat &time, const int &step, const bool &write_coords)
Point centroidFace(int local_elem_id, int local_face_id)
double volumeExtremeValue(const field::NekFieldEnum &field, const nek_mesh::NekMeshEnum pp_mesh, const bool max)
void set_temperature(const int id, const dfloat value)
double V_ref
Definition: NekInterface.h:710
bool isMovingMeshBoundary(const int boundary)
void set_y_displacement(const int id, const dfloat value)
double volumeIntegral(const field::NekFieldEnum &integrand, const double &volume, const nek_mesh::NekMeshEnum pp_mesh)
int heat_source
volumetric heat source (for volumetric heating)
Definition: NekInterface.h:683
void displacementAndCounts(const std::vector< int > &base_counts, int *counts, int *displacement, const int multiplier)
double get_velocity_x(const int id, const int surf_offset)
double source_ref
Definition: NekInterface.h:714
Definition: CardinalEnums.h:91
double T_ref
Definition: NekInterface.h:705
bool isTemperatureBoundary(const int boundary)
Real nondimensionalAdditive(const field::NekFieldEnum &field)
double(*)(int, int) solutionPointer(const field::NekFieldEnum &field)
Definition: NekInterface.h:729
void copyDeformationToDevice()
Copy the deformation from host to device.
void setRelativeTol(double tol)
void dimensionalizeArea(double &integral)
void interpolateSurfaceFaceHex3D(double *scratch, const double *I, double *x, int N, double *Ix, int M)
int mesh_velocity_x
x-velocity of moving boundary (for mesh blending solver)
Definition: NekInterface.h:686
bool hasTemperatureSolve()
NekMeshEnum
Definition: CardinalEnums.h:50
void initializeDimensionalScales(const double U, const double T, const double dT, const double L, const double rho, const double Cp, const double s01, const double ds01, const double s02, const double ds02, const double s03, const double ds03)
void scaleUsrwrk(const unsigned int &slot, const dfloat &value)
double get_velocity_z_squared(const int id, const int surf_offset)
bool hasHeatSourceKernel()
int temperature
temperature (for reverse-direction conjugate heat transfer coupling)
Definition: NekInterface.h:695
double L_ref
Definition: NekInterface.h:708
Definition: CardinalEnums.h:150
double volume(const nek_mesh::NekMeshEnum pp_mesh)
void limitTemperature(const double *min_T, const double *max_T)
double get_scalar03(const int id, const int surf_offset)
double sideIntegral(const std::vector< int > &boundary_id, const field::NekFieldEnum &integrand, const nek_mesh::NekMeshEnum pp_mesh)
const std::string temperatureBoundaryType(const int boundary)
double ds02_ref
Definition: NekInterface.h:719
void set_z_displacement(const int id, const dfloat value)
double pressureSurfaceForce(const std::vector< int > &boundary_id, const Point &direction, const nek_mesh::NekMeshEnum pp_mesh)
void write_field_file(const std::string &prefix, const dfloat time, const int &step)
double get_velocity_y(const int id, const int surf_offset)
double flux_ref
Definition: NekInterface.h:713
bool hasTemperatureVariable()
void allgatherv(const std::vector< int > &base_counts, const T *input, T *output, const int multiplier=1)
Definition: NekInterface.h:987
Point gllPointFace(int local_elem_id, int local_face_id, int local_node_id)
bool isHeatFluxBoundary(const int boundary)
double get_unity(const int id, const int surf_offset)
double area(const std::vector< int > &boundary_id, const nek_mesh::NekMeshEnum pp_mesh)
double get_usrwrk02(const int id, const int surf_offset)
mesh_t * temperatureMesh()
Point gllPoint(int local_elem_id, int local_node_id)
int velocityFieldOffset()
int NfaceVertices()
Number of vertices required to define an element face Vertices refer to the points required to place ...
double t_ref
Definition: NekInterface.h:715
double Cp_ref
Definition: NekInterface.h:712
NekFieldEnum
Enumeration of possible fields to read from nekRS.
Definition: CardinalEnums.h:94
Definition: NekInterface.h:677
double s01_ref
Definition: NekInterface.h:716
void buildOnly(int buildOnly)
double ds01_ref
Definition: NekInterface.h:717
void updateHostMeshParameters()
Update the mesh parameters on host.
Real scratchUnits(const int slot)
void freeScratch()
Free the scratch space.
Real nondimensionalDivisor(const field::NekFieldEnum &field)
Return the reference divisor scale that defines the non-dimensional field.
void dimensionalizeVolumeIntegral(const field::NekFieldEnum &integrand, const Real &volume, double &integral)
double s02_ref
Definition: NekInterface.h:718
void checkFieldValidity(const field::NekFieldEnum &field)
double heatFluxIntegral(const std::vector< int > &boundary_id, const nek_mesh::NekMeshEnum pp_mesh)
double get_pressure(const int id, const int surf_offset)
void interpolationMatrix(double *I, int starting_points, int ending_points)
void initializeHostMeshParameters()
Allocate memory for the host mesh parameters.
double U_ref
Definition: NekInterface.h:704
void setNekSetupTime(const double &time)
void setAbsoluteTol(double tol)
bool validBoundaryIDs(const std::vector< int > &boundary_id, int &first_invalid_id, int &n_boundaries)
double get_temperature(const int id, const int surf_offset)
int flux
boundary heat flux (for conjugate heat transfer)
Definition: NekInterface.h:680
double s03_ref
Definition: NekInterface.h:720
void nondimensional(const bool n)
bool endControlElapsedTime()
double get_usrwrk00(const int id, const int surf_offset)
mesh_t * getMesh(const nek_mesh::NekMeshEnum pp_mesh)
double rho_ref
Definition: NekInterface.h:711
void set_flux(const int id, const dfloat value)
bool hasScalarVariable(int scalarId)
Definition: CardinalEnums.h:129
void set_x_displacement(const int id, const dfloat value)
std::vector< double > usrwrkSideIntegral(const unsigned int &slot, const std::vector< int > &boundary, const nek_mesh::NekMeshEnum pp_mesh)
double dT_ref
Definition: NekInterface.h:706
double usrwrkVolumeIntegral(const unsigned int &slot, const nek_mesh::NekMeshEnum pp_mesh)
double get_scalar02(const int id, const int surf_offset)
Point centroid(int local_elem_id)
double get_velocity_z(const int id, const int surf_offset)
int mesh_velocity_y
y-velocity of moving boundary (for mesh blending solver)
Definition: NekInterface.h:689
void interpolateVolumeHex3D(const double *I, double *x, int N, double *Ix, int M)
void gradient(const int offset, const int e, const double *f, double *grad_f, const nek_mesh::NekMeshEnum pp_mesh)
void dimensionalizeSideIntegral(const field::NekFieldEnum &integrand, const Real &area, double &integral)
double sideExtremeValue(const std::vector< int > &boundary_id, const field::NekFieldEnum &field, const nek_mesh::NekMeshEnum pp_mesh, const bool max)
double get_velocity_y_squared(const int id, const int surf_offset)