I updated the .C program based on the up to date examples. The only error I
get now is:
  CXX      example_opt-eigenproblems_ex2.o
eigenproblems_ex2.C: In function ‘int main(int, char**)’:
eigenproblems_ex2.C:89:32: error: invalid initialization of reference of
type ‘const libMesh::Point&’ from expression of type ‘libMesh::Node’
             const Point& p = **node_it;
                                ^
This looks like a C++ error to me but supposedly the code used to work. Was
libmesh::Point a class in the old libMesh (libMesh 0.7.3.3)?

Thankfully,
Harry Pearce


On Tue, Aug 16, 2016 at 12:37 PM, Cody Permann <codyperm...@gmail.com>
wrote:

> You need to spend some time updating your code. Many of these changes
> occurred more than a one to two years ago. The fixes are generally small.
> Just use the current examples to get your old example back in line.
> Just to get started, libMesh has a communicator class so that you can
> split communicators and not necessarily work with just the global
> communicator so you won't find processor_id() in a namespace any more as a
> result. The Mesh constructors was changed a few years ago. AutoPtr is
> deprecated in favor of UniquePtr, etc...
>
> Mike, UniquePtr is actually quite nice! You can't accidentally assign a
> UniquePtr resulting in having the resource stolen like you could freely do
> with AutoPtr. Overall these changes shouldn't be viewed on as "bad", these
> are positive changes that reflect new capabilities and feature evolution of
> the project.
>
> On Tue, Aug 16, 2016 at 12:19 PM Harry Pearce <harroontheg...@gmail.com>
> wrote:
>
>> >Again, I would not worry about adding an example but rather just try
>> >to build and test standalone. I just reinstalled libmesh adding petsc
>> >and other things, repeated the process of running "make -n example-opt"
>> >and extracting the compile and link lines and it seems to work ok,
>>
>> I was wondering if you tried that with my code. I tried to use the output
>> and named my file by the same name but errors appeared. I also tried using
>> the compile and link lines and errors seemed to appear. As a test I tried
>> running the make example-opt on an example that I added a comment line to
>> (so it would know there was a change in the .C file and recompile the
>> example-opt program and that worked fine. When I used my .C program
>> instead
>> (which I named eigenproblems_ex2.C and put in the eigenprobmes_ex2.C
>> example folder) and ran make example-opt errors appeared. These errors
>> are:
>>
>>
>>   CXX      example_opt-eigenproblems_ex2.o
>> eigenproblems_ex2.C: In function ‘int main(int, char**)’:
>> eigenproblems_ex2.C:44:13: error: ‘processor_id’ is not a member of
>> ‘libMesh’
>>          if (libMesh::processor_id() == 0)
>>              ^
>> eigenproblems_ex2.C:65:10: error: no matching function for call to
>> ‘libMesh::Mesh::Mesh()’
>>      Mesh mesh;
>>           ^
>> eigenproblems_ex2.C:65:10: note: candidates are:
>> In file included from eigenproblems_ex2.C:3:0:
>> ../../../include/libmesh/mesh.h:75:3: note: libMesh::Mesh::Mesh(const
>> libMesh::UnstructuredMesh&)
>>    Mesh (const UnstructuredMesh & other_mesh) : DefaultMesh(other_mesh) {}
>>    ^
>> ../../../include/libmesh/mesh.h:75:3: note:   candidate expects 1
>> argument,
>> 0 provided
>> ../../../include/libmesh/mesh.h:56:3: note: libMesh::Mesh::Mesh(const
>> libMesh::Parallel::Communicator&, unsigned char)
>>    Mesh (const Parallel::Communicator & comm_in,
>>    ^
>> ../../../include/libmesh/mesh.h:56:3: note:   candidate expects 2
>> arguments, 0 provided
>> ../../../include/libmesh/mesh.h:46:7: note: libMesh::Mesh::Mesh(const
>> libMesh::Mesh&)
>>  class Mesh : public DefaultMesh
>>        ^
>> ../../../include/libmesh/mesh.h:46:7: note:   candidate expects 1
>> argument,
>> 0 provided
>> eigenproblems_ex2.C:93:32: error: invalid initialization of reference of
>> type ‘const libMesh::Point&’ from expression of type ‘libMesh::Node’
>>              const Point& p = **node_it;
>>                                 ^
>> eigenproblems_ex2.C: In function ‘void
>> assemble_mass(libMesh::EquationSystems&, const string&)’:
>> eigenproblems_ex2.C:178:52: error: no matching function for call to
>> ‘libMesh::AutoPtr<libMesh::FEGenericBase<double>
>> >::AutoPtr(libMesh::UniquePtr<libMesh::FEGenericBase<double> >)’
>>      AutoPtr<FEBase> fe (FEBase::build(dim, fe_type));
>>                                                     ^
>> eigenproblems_ex2.C:178:52: note: candidates are:
>> In file included from ../../../include/libmesh/parallel.h:25:0,
>>                  from ../../../include/libmesh/libmesh.h:28,
>>                  from eigenproblems_ex2.C:2:
>> ../../../include/libmesh/auto_ptr.h:355:3: note:
>> libMesh::AutoPtr<Tp>::AutoPtr(libMesh::AutoPtrRef<Tp>) [with Tp =
>> libMesh::FEGenericBase<double>]
>>    AutoPtr(AutoPtrRef<element_type> ref)
>>    ^
>> ../../../include/libmesh/auto_ptr.h:355:3: note:   no known conversion
>> for
>> argument 1 from ‘libMesh::UniquePtr<libMesh::FEGenericBase<double> > {aka
>> std::unique_ptr<libMesh::FEGenericBase<double>,
>> std::default_delete<libMesh::FEGenericBase<double> > >}’ to
>> ‘libMesh::AutoPtrRef<libMesh::FEGenericBase<double> >’
>> ../../../include/libmesh/auto_ptr.h:215:3: note: template<class Tp1>
>> libMesh::AutoPtr<Tp>::AutoPtr(libMesh::AutoPtr<Tp1>&)
>>    AutoPtr(AutoPtr<Tp1> & a)
>>    ^
>> ../../../include/libmesh/auto_ptr.h:215:3: note:   template argument
>> deduction/substitution failed:
>> eigenproblems_ex2.C:178:52: note:
>> ‘libMesh::UniquePtr<libMesh::FEGenericBase<double> > {aka
>> std::unique_ptr<libMesh::FEGenericBase<double>,
>> std::default_delete<libMesh::FEGenericBase<double> > >}’ is not derived
>> from ‘libMesh::AutoPtr<Tp>’
>>      AutoPtr<FEBase> fe (FEBase::build(dim, fe_type));
>>                                                     ^
>> In file included from ../../../include/libmesh/parallel.h:25:0,
>>                  from ../../../include/libmesh/libmesh.h:28,
>>                  from eigenproblems_ex2.C:2:
>> ../../../include/libmesh/auto_ptr.h:200:3: note:
>> libMesh::AutoPtr<Tp>::AutoPtr(libMesh::AutoPtr<Tp>&) [with Tp =
>> libMesh::FEGenericBase<double>]
>>    AutoPtr(AutoPtr & a)
>>    ^
>> ../../../include/libmesh/auto_ptr.h:200:3: note:   no known conversion
>> for
>> argument 1 from ‘libMesh::UniquePtr<libMesh::FEGenericBase<double> > {aka
>> std::unique_ptr<libMesh::FEGenericBase<double>,
>> std::default_delete<libMesh::FEGenericBase<double> > >}’ to
>> ‘libMesh::AutoPtr<libMesh::FEGenericBase<double> >&’
>> ../../../include/libmesh/auto_ptr.h:185:3: note:
>> libMesh::AutoPtr<Tp>::AutoPtr(libMesh::AutoPtr<Tp>::element_type*) [with
>> Tp
>> = libMesh::FEGenericBase<double>; libMesh::AutoPtr<Tp>::element_type =
>> libMesh::FEGenericBase<double>]
>>    AutoPtr(element_type * p = 0)
>>    ^
>> ../../../include/libmesh/auto_ptr.h:185:3: note:   no known conversion
>> for
>> argument 1 from ‘libMesh::UniquePtr<libMesh::FEGenericBase<double> > {aka
>> std::unique_ptr<libMesh::FEGenericBase<double>,
>> std::default_delete<libMesh::FEGenericBase<double> > >}’ to
>> ‘libMesh::AutoPtr<libMesh::FEGenericBase<double> >::element_type* {aka
>> libMesh::FEGenericBase<double>*}’
>> make: *** [example_opt-eigenproblems_ex2.o] Error 1
>>
>>
>> Also I ran make check and the examples do rerun when I do that but now
>> when
>> I do make run_examples. When I do make run_examples it looks in each
>> directory but doesn't do anything other than "make all-am". Then it says
>> there is nothing to do in the directory of the example and looks at the
>> next example.
>>
>> Harry Pearce
>>
>> On Fri, Aug 12, 2016 at 12:48 PM, Mike Marchywka <marchy...@hotmail.com>
>> wrote:
>>
>> > Again, I would not worry about adding an example but rather just try
>> > to build and test standalone. I just reinstalled libmesh adding petsc
>> > and other things, repeated the process of running "make -n example-opt"
>> > and extracting the compile and link lines and it seems to work ok,
>> >
>> > Silent failures can be hard to track down. Normally, you could just
>> > start in a debugger. Or, if you think you are missing a library
>> > run ldd. It turns out the output of the libtool step is a script
>> > that runs .libs/lt-foo. and you can run ldd on this if you want.
>> >
>> > If you mean it only makes once, you need to insure the dependencies
>> > are right but for testing I usually just write a script that rebuilds
>> > everything although checking for "newer" would not be too hard.
>> >
>> > Again, the compile seems normal but maybe someone could explain the
>> > odd linking lol. What is the point of this?
>> >
>> > When I get some simple examples to work and think
>> > Iunderstand FEM, I was going to link
>> > to a larger program I have which uses tcl and things like jdft.
>> > I have no idea how this will go but curious what you find :)
>> >
>> >
>> >
>> >
>> >
>> >
>> > ----------------------------------------
>> > > From: harroontheg...@gmail.com
>> > > Date: Fri, 12 Aug 2016 12:34:41 -0700
>> > > To: libmesh-users@lists.sourceforge.net
>> > > Subject: [Libmesh-users] Example files won't run a second time
>> > >
>> > > Hello libmesh users!,
>> > > I tried to run the example programs using make run_examples but after
>> the
>> > > makefile descends into the individual example files it keeps saying
>> > > "Nothing to be done for all-am" after trying to make all-am. It
>> doesn't
>> > try
>> > > to run or modify the programs. I wanted to recompile the
>> > eigenproblems_ex2
>> > > with my own .C file in it instead of the one that comes with the
>> > examples.
>> > >
>> > > I did modify the Makefile.am in the example directory, but just to
>> add an
>> > > example to the SUBDIRS variable, following the directions of
>> > > https://github.com/libMesh/libmesh/wiki/Adding-a-new-example
>> > (instructions
>> > > for adding a new example program to libMesh). I changed it back though
>> > and
>> > > now the only difference that I know of between it and the original
>> > > Makefile.am is that I commented out the members of the SUBDIRS
>> variable
>> > > other than eigenproblems_ex2 which I modified the .C file of.
>> > >
>> > > My Professor never used make check when downloading libmesh-1.0.0-rc1.
>> > > Instead he used make run_examples.
>> > >
>> > > Does anyone know why the example programs aren't running (they ran the
>> > > first time) and how to fix it?
>> > >
>> > > Thankfully,
>> > > Harry Pearce
>> > > ------------------------------------------------------------
>> > ------------------
>> > > What NetFlow Analyzer can do for you? Monitors network bandwidth and
>> > traffic
>> > > patterns at an interface-level. Reveals which users, apps, and
>> protocols
>> > are
>> > > consuming the most bandwidth. Provides multi-vendor support for
>> NetFlow,
>> > > J-Flow, sFlow and other flows. Make informed decisions using capacity
>> > > planning reports. http://sdm.link/zohodev2dev
>> > > _______________________________________________
>> > > Libmesh-users mailing list
>> > > Libmesh-users@lists.sourceforge.net
>> > > https://lists.sourceforge.net/lists/listinfo/libmesh-users
>> >
>> ------------------------------------------------------------
>> ------------------
>> _______________________________________________
>> Libmesh-users mailing list
>> Libmesh-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>>
>
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to