22 #include "MooseTypes.h" 33 #include "libmesh/point.h" 48 static int build_only;
107 void write_usrwrk_field_file(
const int & slot,
const std::string & prefix,
const dfloat & time,
const int & step,
const bool & write_coords);
115 void write_field_file(
const std::string & prefix,
const dfloat time,
const int & step);
294 template <
typename T>
295 void allgatherv(
const std::vector<int> & base_counts,
298 const int multiplier = 1);
310 const int multiplier);
331 double * scratch,
const double * I,
double * x,
int N,
double * Ix,
int M);
340 Point
centroidFace(
int local_elem_id,
int local_face_id);
355 Point
gllPoint(
int local_elem_id,
int local_node_id);
365 Point
gllPointFace(
int local_elem_id,
int local_face_id,
int local_node_id);
375 const std::vector<int> & boundary,
391 void scaleUsrwrk(
const unsigned int & slot,
const dfloat & value);
403 const std::vector<int> & boundary,
404 const std::vector<double> & moose_integral,
405 std::vector<double> & nek_integral,
406 double & normalized_nek_integral);
418 const std::vector<int> & boundary,
419 const double moose_integral,
421 double & normalized_nek_integral);
488 const std::vector<int> & boundary_id,
509 double massFlowrate(
const std::vector<int> & boundary_id,
557 void gradient(
const int offset,
const double * f,
double * grad_f,
663 validBoundaryIDs(
const std::vector<int> & boundary_id,
int & first_invalid_id,
int & n_boundaries);
795 double unity(
const int id);
830 void flux(
const int id,
const dfloat value);
837 void heat_source(
const int id,
const dfloat value);
873 const double rho_ref,
874 const double Cp_ref);
922 template <
typename T>
932 template <
typename T>
934 allgatherv(
const std::vector<int> & base_counts,
const T * input, T * output,
const int multiplier)
936 int * recvCounts = (
int *)calloc(
commSize(),
sizeof(int));
937 int * displacement = (
int *)calloc(
commSize(),
sizeof(int));
940 MPI_Allgatherv(input,
944 (
const int *)recvCounts,
945 (
const int *)displacement,
947 platform->comm.mpiComm);
double unity(const int id)
Cardinal-specific nekRS API.
Definition: NekUility.C:21
MPI_Datatype resolveType()
void setStartTime(const double &start)
double velocity_x(const int id)
int mesh_velocity_z
z-velocity of moving boundary (for mesh blending solver)
Definition: NekInterface.h:691
Characteristic scales assumed in nekRS if using a non-dimensional solution.
Definition: NekInterface.h:710
double sideMassFluxWeightedIntegral(const std::vector< int > &boundary_id, const field::NekFieldEnum &integrand, const nek_mesh::NekMeshEnum pp_mesh)
bool endControlNumSteps()
void storeBoundaryCoupling(const std::vector< int > &boundary_id, int &N)
void initializeScratch(const unsigned int &n_slots)
double velocity(const int id)
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:105
double A_ref
Definition: NekInterface.h:720
void dimensionalizeVolume(double &integral)
double velocity_z(const int id)
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)
int boundary_temperature
boundary temperature (for separate domain coupling)
Definition: NekInterface.h:697
double V_ref
Definition: NekInterface.h:722
bool isMovingMeshBoundary(const int boundary)
double volumeIntegral(const field::NekFieldEnum &integrand, const double &volume, const nek_mesh::NekMeshEnum pp_mesh)
void flux(const int id, const dfloat value)
int heat_source
volumetric heat source (for volumetric heating)
Definition: NekInterface.h:682
bool nondimensional_T
Definition: NekInterface.h:732
void displacementAndCounts(const std::vector< int > &base_counts, int *counts, int *displacement, const int multiplier)
double scalar03(const int id)
Get the scalar03 solution at given GLL index.
double pressure(const int id)
void heat_source(const int id, const dfloat value)
double source_ref
Definition: NekInterface.h:730
Definition: CardinalEnums.h:86
double T_ref
Definition: NekInterface.h:714
bool isTemperatureBoundary(const int boundary)
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)
void y_displacement(const int id, const dfloat value)
int mesh_velocity_x
x-velocity of moving boundary (for mesh blending solver)
Definition: NekInterface.h:685
bool hasTemperatureSolve()
NekMeshEnum
Definition: CardinalEnums.h:45
int boundary_scalar03
boundary scalar03 (for separate domain coupling)
Definition: NekInterface.h:706
void scaleUsrwrk(const unsigned int &slot, const dfloat &value)
bool hasHeatSourceKernel()
int boundary_velocity
boundary velocity (for separate domain coupling)
Definition: NekInterface.h:694
bool normalizeFlux(const NekBoundaryCoupling &nek_boundary_coupling, const std::vector< int > &boundary, const double moose_integral, double nek_integral, double &normalized_nek_integral)
void initializeDimensionalScales(const double U_ref, const double T_ref, const double dT_ref, const double L_ref, const double rho_ref, const double Cp_ref)
double L_ref
Definition: NekInterface.h:718
void dimensionalize(const field::NekFieldEnum &field, double &value)
Dimensionalize a field by multiplying the nondimensional form by the reference.
Definition: CardinalEnums.h:123
double volume(const nek_mesh::NekMeshEnum pp_mesh)
void limitTemperature(const double *min_T, const double *max_T)
int boundary_scalar01
boundary scalar01 (for separate domain coupling)
Definition: NekInterface.h:700
double sideIntegral(const std::vector< int > &boundary_id, const field::NekFieldEnum &integrand, const nek_mesh::NekMeshEnum pp_mesh)
double scalar02(const int id)
Get the scalar02 solution at given GLL index.
const std::string temperatureBoundaryType(const int boundary)
double(*)(int) solutionPointer(const field::NekFieldEnum &field)
Definition: NekInterface.h:740
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 flux_ref
Definition: NekInterface.h:728
bool hasTemperatureVariable()
void allgatherv(const std::vector< int > &base_counts, const T *input, T *output, const int multiplier=1)
Definition: NekInterface.h:934
Point gllPointFace(int local_elem_id, int local_face_id, int local_node_id)
bool isHeatFluxBoundary(const int boundary)
double area(const std::vector< int > &boundary_id, const nek_mesh::NekMeshEnum pp_mesh)
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 Cp_ref
Definition: NekInterface.h:726
NekFieldEnum
Enumeration of possible fields to read from nekRS.
Definition: CardinalEnums.h:89
Definition: NekInterface.h:676
double temperature(const int id)
Get the temperature solution at given GLL index.
Definition: NekBoundaryCoupling.h:29
void buildOnly(int buildOnly)
void updateHostMeshParameters()
Update the mesh parameters on host.
void freeScratch()
Free the scratch space.
void dimensionalizeVolumeIntegral(const field::NekFieldEnum &integrand, const Real &volume, double &integral)
double heatFluxIntegral(const std::vector< int > &boundary_id, const nek_mesh::NekMeshEnum pp_mesh)
void interpolationMatrix(double *I, int starting_points, int ending_points)
void initializeHostMeshParameters()
Allocate memory for the host mesh parameters.
double scalar01(const int id)
Get the scalar01 solution at given GLL index.
double U_ref
Definition: NekInterface.h:712
double velocity_y(const int id)
void setNekSetupTime(const double &time)
int boundary_scalar02
boundary scalar02 (for separate domain coupling)
Definition: NekInterface.h:703
void setAbsoluteTol(double tol)
bool validBoundaryIDs(const std::vector< int > &boundary_id, int &first_invalid_id, int &n_boundaries)
int flux
boundary heat flux (for conjugate heat transfer)
Definition: NekInterface.h:679
void x_displacement(const int id, const dfloat value)
bool endControlElapsedTime()
mesh_t * getMesh(const nek_mesh::NekMeshEnum pp_mesh)
void gradient(const int offset, const double *f, double *grad_f, const nek_mesh::NekMeshEnum pp_mesh)
double rho_ref
Definition: NekInterface.h:724
bool hasScalarVariable(int scalarId)
void z_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:716
double usrwrkVolumeIntegral(const unsigned int &slot, const nek_mesh::NekMeshEnum pp_mesh)
Point centroid(int local_elem_id)
int mesh_velocity_y
y-velocity of moving boundary (for mesh blending solver)
Definition: NekInterface.h:688
void interpolateVolumeHex3D(const double *I, double *x, int N, double *Ix, int M)
bool normalizeFluxBySideset(const NekBoundaryCoupling &nek_boundary_coupling, const std::vector< int > &boundary, const std::vector< double > &moose_integral, std::vector< double > &nek_integral, double &normalized_nek_integral)
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)