本文整理汇总了C++中pout函数的典型用法代码示例。如果您正苦于以下问题:C++ pout函数的具体用法?C++ pout怎么用?C++ pout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PMap
void PMap(const CellMap& m)
{
// print out map
CellMap::const_iterator it;
pout() << "Cell Map has " << m.size() << " cells\n";
for ( it = m.begin(); it != m.end(); it++)
{
pout() << "cell "; PIV(it->first); pout() << "\n";
pout() << " verts: "; PVec(it->second.vertices); pout() << "\n";
pout() << " tris : "; PVec(it->second.triangles); pout() << "\n";
}
}
示例2: pout
void tool_app_t::mac(const netlist::factory::element_t *e)
{
auto v = plib::psplit(e->param_desc(), ",");
pstring vs;
for (auto s : v)
{
vs += ", " + s.replace_all("+", "").replace_all(".", "_");
}
pout("{1}(name{2})\n", e->name(), vs);
if (v.size() > 0)
{
pout("/*\n");
for (auto s : v)
{
pstring r(s.replace_all("+", "").replace_all(".", "_"));
if (s.startsWith("+"))
pout("{1:10}: Terminal\n",r);
else
pout("{1:10}: Parameter\n", r);
}
pout("*/\n");
}
}
示例3: read_drive_database
// Read drive database from file.
bool read_drive_database(const char * path)
{
stdio_file f(path, "r"
#ifdef __CYGWIN__ // Allow files with '\r\n'.
"t"
#endif
);
if (!f) {
pout("%s: cannot open drive database file\n", path);
return false;
}
return parse_drive_database(parse_ptr(f), knowndrives, path);
}
示例4: pout
// Define new AMR level
void AMRLevelPluto::define(AMRLevel* a_coarserLevelPtr,
const ProblemDomain& a_problemDomain,
int a_level,
int a_refRatio)
{
if (s_verbosity >= 3)
{
pout() << "AMRLevelPluto::define " << a_level << endl;
}
// Call inherited define
AMRLevel::define(a_coarserLevelPtr,
a_problemDomain,
a_level,
a_refRatio);
// Get setup information from the next coarser level
if (a_coarserLevelPtr != NULL)
{
AMRLevelPluto* amrGodPtr = dynamic_cast<AMRLevelPluto*>(a_coarserLevelPtr);
if (amrGodPtr != NULL)
{
m_cfl = amrGodPtr->m_cfl;
m_domainLength = amrGodPtr->m_domainLength;
m_refineThresh = amrGodPtr->m_refineThresh;
m_tagBufferSize = amrGodPtr->m_tagBufferSize;
}
else
{
MayDay::Error("AMRLevelPluto::define: a_coarserLevelPtr is not castable to AMRLevelPluto*");
}
}
// Compute the grid spacing
m_dx = m_domainLength / (a_problemDomain.domainBox().bigEnd(0)-a_problemDomain.domainBox().smallEnd(0)+1.);
// Nominally, one layer of ghost cells is maintained permanently and
// individual computations may create local data with more
m_numGhost = 1;
CH_assert(m_patchPluto != NULL);
CH_assert(isDefined());
m_patchPluto->define(m_problem_domain,m_dx,m_level,m_numGhost);
// Get additional information from the patch integrator
m_numStates = m_patchPluto->numConserved();
m_ConsStateNames = m_patchPluto->ConsStateNames();
m_PrimStateNames = m_patchPluto->PrimStateNames();
}
示例5: pout
// ---------------------------------------------------------------
void
AMRNavierStokes::writeCheckpointHeader(HDF5Handle& a_handle) const
{
if (s_verbosity >= 3)
{
pout() << "AMRNavierStokes::writeCheckpointHeader" << endl;
}
HDF5HeaderData header;
// since number of velocity components is obviously SpaceDim,
// only need to do number of scalar components here
CH_assert (s_num_vel_comps == SpaceDim);
header.m_int["num_components"] = s_num_scal_comps;
char comp_str[30];
for (int comp=0; comp<s_num_scal_comps; ++comp)
{
sprintf (comp_str, "component_%d", comp);
header.m_string[comp_str] = s_scal_names[comp];
}
// now write lambda name
header.m_string["lambda_component"] = "lambda";
// now write velocity names..
for (int comp=0; comp<s_num_vel_comps; ++comp)
{
sprintf (comp_str, "vel_component_%d", comp);
header.m_string[comp_str] = s_vel_names[comp];
}
header.writeToFile(a_handle);
if (s_verbosity >= 3)
{
pout () << header << endl;
}
}
示例6: main
int
main(void)
{
static const char *pcap_files[] = {
"../../sample/icmp.pcap",
"../../sample/tcp.pcap",
"../../sample/udp.pcap",
"../../sample/tcp6.pcap",
"../../sample/udp6.pcap",
};
pout("peak packet test suite... ");
/* make sure this is always aligned to 8 bytes */
assert(!(sizeof(struct peak_packet) % sizeof(uint64_t)));
memset(&net_saddr4, 0, sizeof(net_saddr4));
memset(&net_daddr4, 0, sizeof(net_daddr4));
memset(&net_saddr6, 0, sizeof(net_saddr6));
memset(&net_daddr6, 0, sizeof(net_daddr6));
netaddr4(&net_saddr4, be32dec(&src_ip4));
netaddr4(&net_daddr4, be32dec(&dst_ip4));
netaddr6(&net_saddr6, src_ip6);
netaddr6(&net_daddr6, dst_ip6);
test_icmp(pcap_files[0]);
test_transport_ip4(pcap_files[1]); /* TCP over IPv4 */
test_transport_ip4(pcap_files[2]); /* UDP over IPv4 */
test_transport_ip6(pcap_files[3]); /* TCP over IPv6 */
test_transport_ip6(pcap_files[4]); /* UDP over IPv6 */
pout("ok\n");
return (0);
}
示例7: gather_memory_from_procs
// Maintain backward compatibility in code.
// Can now use reduce_print_avg_min_max("label", value);
void gather_memory_from_procs(Real end_memory,
Real &avg_memory,
Real &min_memory,
Real &max_memory)
{
reduce_avg_min_max(end_memory, avg_memory, min_memory, max_memory);
// results only need to be on rank0 (and are)
if (procID() == 0)
{
pout() << "Gather end memory from procs: avg: " << avg_memory
<< " min: " << min_memory
<< " max: " << max_memory << " (MB)\n";
}
}
示例8: QuickScan_Email
void QuickScan_Email(void)
{
int FoundMsg = FALSE;
int i;
char temp[81];
iLineCount = 2;
WhosDoingWhat(READ_POST, NULL);
if (EmailBase.Total == 0) {
Enter(1);
/* There are no messages in this area. */
pout(WHITE, BLACK, (char *) Language(205));
Enter(2);
sleep(3);
return;
}
clear();
/* # From To Subject */
poutCR(YELLOW, BLUE, (char *) Language(220));
if (Msg_Open(sMailpath)) {
for (i = EmailBase.Lowest; i <= EmailBase.Highest; i++) {
if (Msg_ReadHeader(i)) {
snprintf(temp, 81, "%-6u", Msg.Id);
pout(WHITE, BLACK, temp);
snprintf(temp, 81, "%s ", padleft(Msg.From, 20, ' '));
pout(CYAN, BLACK, temp);
snprintf(temp, 81, "%s ", padleft(Msg.To, 20, ' '));
pout(GREEN, BLACK, temp);
snprintf(temp, 81, "%s", padleft(Msg.Subject, 31, ' '));
pout(MAGENTA, BLACK, temp);
Enter(1);
FoundMsg = TRUE;
if (LC(1))
break;
}
}
Msg_Close();
}
if(!FoundMsg) {
Enter(1);
/* There are no messages in this area. */
pout(LIGHTGREEN, BLACK, (char *) Language(205));
Enter(2);
sleep(3);
}
iLineCount = 2;
Pause();
}
示例9: safeBarrier
//-----------------------------------------------------------------------------
// Function : safeBarrier
// Purpose : This barrier will exit cleanly in parallel if one PE exits
// with an error. The region covered is that following a
// previous call to startSafeBarrier
// Special Notes :
// Scope : Public
// Creator : Dave Shirley, PSSi
// Creation Date : 07/18/05
//-----------------------------------------------------------------------------
void safeBarrier(Parallel::Machine comm)
{
// Collect all pending message to the log file.
pout(comm);
unsigned count = get_message_count(MSG_FATAL) + get_message_count(MSG_ERROR);
if (Parallel::is_parallel_run(comm))
Parallel::AllReduce(comm, MPI_SUM, &count, 1);
if (count > 0) {
UserFatal0().die() << "Simulation aborted due to error";
Xyce_exit(-1);
}
}
示例10: switch
void
GUIManager::update(const Input::Event& event)
{
switch (event.type)
{
case Input::POINTER_EVENT_TYPE:
mouse_pos.x = int(event.pointer.x);
mouse_pos.y = int(event.pointer.y);
on_pointer_move(mouse_pos.x, mouse_pos.y);
break;
case Input::BUTTON_EVENT_TYPE:
if (event.button.name == PRIMARY_BUTTON)
{
if (event.button.state == Input::BUTTON_PRESSED)
on_primary_button_press(mouse_pos.x, mouse_pos.y);
else if (event.button.state == Input::BUTTON_RELEASED)
on_primary_button_release(mouse_pos.x, mouse_pos.y);
}
else if (event.button.name == SECONDARY_BUTTON)
{
if (event.button.state == Input::BUTTON_PRESSED)
on_secondary_button_press(mouse_pos.x, mouse_pos.y);
else if (event.button.state == Input::BUTTON_RELEASED)
on_secondary_button_release(mouse_pos.x, mouse_pos.y);
}
break;
case Input::AXIS_EVENT_TYPE:
// AxisEvents can be ignored in the GUI, they are handled elsewhere
pout(PINGUS_DEBUG_GUI) << "GUIManager: AxisEvent: " << event.axis.dir << std::endl;
break;
case Input::KEYBOARD_EVENT_TYPE:
on_key_pressed(event.keyboard.key);
break;
case Input::SCROLLER_EVENT_TYPE:
on_scroller_move(event.scroll.x_delta, event.scroll.y_delta);
break;
default:
pwarn (PINGUS_DEBUG_GUI) << "GUIManager: unhandled event type " << event.type << std::endl;
break;
}
}
示例11: testEBFluxFAB
int
testEBFluxFAB(const EBISBox& a_ebisBox, const Box& a_box)
{
Interval comps(0,0);
IntVectSet ivs(a_box);
EBFluxFAB srcFab( a_ebisBox, a_box, 1);
EBFluxFAB dstFab( a_ebisBox, a_box, 1);
for (int idir = 0; idir < SpaceDim; idir++)
{
//set source fab to right ans
for (FaceIterator faceit(ivs, a_ebisBox.getEBGraph(), idir, FaceStop::SurroundingWithBoundary);
faceit.ok(); ++faceit)
{
srcFab[idir](faceit(), 0) = rightAns(faceit());
}
}
//linearize the data to dst
int sizeFab = srcFab.size(a_box, comps);
unsigned char* buf = new unsigned char[sizeFab];
srcFab.linearOut(buf, a_box, comps);
dstFab.linearIn( buf, a_box, comps);
delete[] buf;
//check the answer
int eekflag = 0;
for (int idir = 0; idir < SpaceDim; idir++)
{
Real tolerance = 0.001;
for (FaceIterator faceit(ivs, a_ebisBox.getEBGraph(), idir, FaceStop::SurroundingWithBoundary);
faceit.ok(); ++faceit)
{
Real correct = rightAns(faceit());
if (Abs(dstFab[idir](faceit(), 0) - correct) > tolerance)
{
pout() << "ivfab test failed at face "
<< faceit().gridIndex(Side::Lo)
<< faceit().gridIndex(Side::Hi) << endl;
eekflag = -4;
return eekflag;
}
}
}
return 0;
}
示例12: divergenceTest
void
divergenceTest()
{
int maxsize;
ParmParse pp;
pp.get("max_grid_size", maxsize);
//make layouts == domain
Box domainBoxFine, domainBoxCoar;
Real dxFine, dxCoar;
sphereGeometry(domainBoxFine, dxFine);
domainBoxCoar = coarsen(domainBoxFine, 2);
//debug
dxFine = 1.0;
dxCoar = 2.*dxFine;
Vector<Box> boxFine;
domainSplit(domainBoxFine, boxFine, maxsize);
Vector<int> proc(boxFine.size(), 0);
DisjointBoxLayout dblFine(boxFine, proc);
DisjointBoxLayout dblCoar;
coarsen(dblCoar, dblFine, 2);
LevelData<EBCellFAB> errorFine, errorCoar;
EBISLayout ebislFine, ebislCoar;
const EBIndexSpace* const ebisPtr = Chombo_EBIS::instance();
ebisPtr->fillEBISLayout(ebislFine, dblFine, domainBoxFine, 2);
ebisPtr->fillEBISLayout(ebislCoar, dblCoar, domainBoxCoar, 2);
getError(errorFine, ebislFine, dblFine, dxFine);
getError(errorCoar, ebislCoar, dblCoar, dxCoar);
for (DataIterator dit= dblFine.dataIterator(); dit.ok(); ++dit)
{
const EBCellFAB& errorFineFAB = errorFine[dit()];
const EBCellFAB& errorCoarFAB = errorCoar[dit()];
int i1 = errorFineFAB.getMultiCells().numPts();
int i2 = errorCoarFAB.getMultiCells().numPts();
pout() << i1 << i2 << endl;
}
compareError(errorFine, ebislFine, dblFine, domainBoxFine,
errorCoar, ebislCoar, dblCoar, domainBoxCoar);
}
示例13: intlog_binning
void intlog_binning(deque<int> c, int number_of_bins, string file) {
DD Xs;
DD Ys;
DD var;
char b[file.size()+1];
cast_string_to_char(file, b);
ofstream pout(b);
intlog_binning(c, number_of_bins, Xs, Ys, var);
RANGE_loop(i, Xs) {
pout<<Xs[i]<<" "<<Ys[i]<<" "<<var[i]<<endl;
}
}
示例14: skip_white
// Skip whitespace and comments.
static parse_ptr skip_white(parse_ptr src, const char * path, int & line)
{
for ( ; ; ++src) switch (*src) {
case ' ': case '\t':
continue;
case '\n':
++line;
continue;
case '/':
switch (src[1]) {
case '/':
// skip '// comment'
++src; ++src;
while (*src && *src != '\n')
++src;
if (*src)
++line;
break;
case '*':
// skip '/* comment */'
++src; ++src;
for (;;) {
if (!*src) {
pout("%s(%d): Missing '*/'\n", path, line);
return src;
}
char c = *src; ++src;
if (c == '\n')
++line;
else if (c == '*' && *src == '/')
break;
}
break;
default:
return src;
}
continue;
default:
return src;
}
}
示例15: CH_assert
// Things to do after initialization
void AMRLevelPluto::postInitialize()
{
CH_assert(allDefined());
if (s_verbosity >= 3)
{
pout() << "AMRLevelPluto::postInitialize " << m_level << endl;
}
if (m_hasFiner)
{
// Volume weighted average from finer level data
AMRLevelPluto* amrGodFinerPtr = getFinerLevel();
amrGodFinerPtr->m_coarseAverage.averageToCoarse(m_UNew,
amrGodFinerPtr->m_UNew);
}
}