[Dune] Problem running DUNE course 2015 pdelab-exercise4sol

Eike Mueller E.Mueller at bath.ac.uk
Fri Jun 5 13:18:04 CEST 2015


Hi Tatiana,

that sounds good! The program expects the name as an input file as the first command line parameter, but it aborts since you probably did not provide this.
argc is the number of command line parameters (including the name of the executable). So if you run it, for example, with

./ldom_example CONFIGFILE

(where CONFIGFILE is the name of the configuration file), you will get argc=2, argv = [“./ldom_example”,"CONFIGFILE”]

but if you run

./ldom_example

you will get argc=1, argv = [“./ldom_example”], as you say, and the program aborts with the message you see due to the if (argc!=2). Without seeing the rest of the code (and I can’t find the examples for this year’s DUNE course on the webpage) I can’t really tell what exactly is expected in the parameter file.

Eike

> On 5 Jun 2015, at 12:11, Tatiana Kim <T.Kim at bath.ac.uk> wrote:
> 
> Hi Christoph and Eike. Thanks for your help! Removing "Generic" from "GenericReferenceElements" solves the problem and I can compile the code without errors.
> 
> However, when I run ldom_examples, I get the following output:
> 
> parallel run on 1 process(es)
> usage: ./ldom_example <cfg-file>
> 
> 
> The first few lines of the ldom_examples.cc are:
> 
> int main(int argc, char** argv)
> {
>    std::cout << "Have " << argc << " arguments:" << std::endl;
>    for (int i = 0; i < argc; ++i) {
>        std::cout << argv[i] << std::endl;
>    }
> 
>    try{
>        // Maybe initialize Mpi
>        Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
>        if (Dune::MPIHelper::isFake)
>            std::cout<< "This is a sequential program." << std::endl;
>        else
>        {
>            if(helper.rank()==0)
>                std::cout << "parallel run on " << helper.size() << " process(es)" << std::endl;
>        }
> 
>        if (argc!=2)
>        {
>            if (helper.rank()==0)
>                std::cout << "usage: ./ldom_example <cfg-file>" << std::endl;
>            return 1;
>        }
> 
> 
> In my code, argc =1 - hence the output "usage: ./ldom_example <cfg-file>". The code then exits the program.
> 
> I am not an expert in C++ so not sure what the problem here might be. Any help would be much appreciated! 
> 
> Thanks,
> Tatiana.
> 
> 
> 
> 
> 
> ________________________________________
> From: Christoph Grüninger <christoph.grueninger at iws.uni-stuttgart.de>
> Sent: 05 June 2015 10:46
> To: Eike Mueller; DUNE Liste; Tatiana Kim
> Subject: Re: [Dune] Problem running DUNE course 2015 pdelab-exercise4sol
> 
> Hi Tatiana, hi Eike,
> as stated in the release notes of 2.3
>   http://www.dune-project.org/releasenotes/releasenotes-2.3.html
> the GenericRefereceElements where deprecated and were
> removed after Dune 2.3 as noted in the recent changes
>   http://www.dune-project.org/recent_changes.html
> 
>> PS: GenericReferenceElements is also used in
>> dune-pdelab-howto (see below), so I guess there the trunk is
>> also out of sync with dune-geometry?
> 
> I assume so, too.
> 
> Tatiana, please try to remove all the "Generic", that usually
> solves
> 90% of the problems. If you still get stuck afterwards, report
> back.
> 
> Bye
> Christoph
> 
> --
> Je n'ai rien contre les étrangers, quelques uns de mes
> meilleurs amis
> sont des étrangers. Mais ces étrangers là ne sont pas de chez
> nous!
> [Agecanonix, Astérix - Le cadeau de César]





More information about the Dune mailing list