SCOREC / fep

Finite Element Programming course materials
6 stars 4 forks source link

"not declared, queue.pop()" issues #19

Closed goinea closed 3 years ago

goinea commented 3 years ago

Summary

"void value not ignored as it aught to be", not sure how to ignore when I need to in the code below. Also, per some of the examples in the psudo code and online that I've seen, if then statements can be used but even with similar syntax do not work here.

Details

Code

     while (queue1.size(e) > 0) { // process entities until the queue is empty, change to text to 
                                                      queue1.size() > 0 to adjust the needed language
              e = queue1.pop(); //changed entity to "e", and changed e=q dequeue to queue1.pop to remove 
         something from the queue
             node = pumi_numbering_getNumNode(pNumbering(mesh));  //changed entity to "e", also 
                      changed e 
            getNode() to node=pumi_numbering_getNumNode(pNumbering(mesh));
             if (pumi_ment_isOwned(node)) //adding pumi_ment_isOwned(node), to specify tagging the 
                       owned entity
             then {
             labelnode = labelnode -1;
             node setLabel(labelnode);
     }

Error message: 44 | e = queue1.pop()//changed entity to "e", and changed e=q dequeue to queue1.pop to remove something from the queue | ~~^~ /gpfs/u/home/FEP5/FEP5gnsd/a2/a2.cc:46:25: error: 'node' was not declared in this scope 46 | if (pumi_ment_isOwned(node)) //adding pumi_ment_isOwned(node), to specify tagging the owned entity | ^~~~ /gpfs/u/home/FEP5/FEP5gnsd/a2/a2.cc:47:2: error: 'then' was not declared in this scope 47 | then {

cwsmith commented 3 years ago

Please fix the formatting (i.e., indentation) of the code snippet posted.

There are missing semicolons on multiple lines.

cwsmith commented 3 years ago

That looks better. Are the compile errors fixed?

The long comments at the end of each line also are not helping readability. I'd suggest moving all but the shortest comments (i.e., one to three words) to the line above and breaking all lines over that extend beyond the 80th column. For example, this:

                  e = queue1.pop(); //changed entity to "e", and changed e=q dequeue to queue1.pop to remove 
             something from the queue

becomes

                  //changed entity to "e", and changed e=q dequeue
                  // to queue1.pop to remove something from the queue
                  e = queue1.pop(); 
cwsmith commented 3 years ago

Also, assuming you haven’t always had a Mac, did you have to download a package to send files from Linux to windows?

WSL in windows10 has support for scp.

winscp is a graphical tool I've used before: https://winscp.net/eng/index.php

VSCode also supports file transfers.