How to create my first material?

318 views
Skip to first unread message

Edgar Rios

unread,
Nov 2, 2017, 3:10:28 PM11/2/17
to moose...@googlegroups.com
• Short version.

I am trying to create the St. Venant-Kirchoff elasticity tensor. My
later goal is to get to the neo-hookean material. I produced the code
at the end of this e-mail, and I have some questions.

• Can I assign the youngs_modulus (or any other property) as shown?

• is initIdentitySymmetricFour() = $\delta_{ij}\, \delta_{kl}$

• Is this the right way to create the St. Venant-Kirchhoff elasticity
tensor?

• Longer version

Hello,

I am working with TensorMechanics (tensor_mechanics). This is my first
time creating a material and I wonder if there is a guideline (or
someone willing to help me) to do it. I want to (re)-create a simple
linear elastic and isotropic material (to check that I am doing it
right). Later, I intend to extend it to the neo-hookean case.

I have come up with the code which is shown at the end by trying to
follow the .C and .h versions of ComputeElasticityTensor,
ComputeElasticityTensorCP, LinearElasticTruss, TrussMaterial and
PackedColumn (the latter from the darcy tutorial).

I would like to know if I am doing it correctly. (I would test it
myself, but I don't know how I would go and use it yet.) I just want
to know if what I am doing is right, and clarify some questions along
the way:

• Can I assign the youngs_modulus (or any other property) as shown?

• is initIdentitySymmetricFour() = $\delta_{ij} \cdot \delta_{kl}$

• Is this the right way to create the St. Venant-Kirchhoff elasticity
tensor?

This thread is related to:
https://groups.google.com/forum/?_escaped_fragment_=myforums#!topic/moose-users/o9ihbxrSaDc

┌────
│ // License: GPL v.3 or later, at your convenience

│ #ifndef ELASTICITYTENSORX_H
│ #define ELASTICITYTENSORX_H

│ #include "ComputeElasticityTensor.h"

│ class ElasticityTensorX;

│ template <>
│ InputParameters validParams<ElasticityTensorX>();

│ class ElasticityTensorX : public ComputeElasticityTensor
│ {
│ public:
│ ElasticityTensorX(const InputParameters & parameters);

│ protected:
│ virtual void computeQpElasticityTensor();

│ const Real & _some_constant;

│ MaterialProperty<Real> & _el_modulus;
│ };

│ #endif // ELASTICITYTENSORX_H
└────
File 1: ElasticityTensorX.h

┌────
│ // License: GPL v.3 or later, at your convenience

│ #include "ElasticityTensorX.h"

│ template <>
│ InputParameters
│ validParams<ElasticityTensorX>()
│ {
│ InputParameters params = validParams<ComputeElasticityTensor>();

│ params.addClassDescription("Elasticity tensor made for tests. Do not use.");

│ // Why would I declare this (and not _el_modulus) in this template?
│ params.addParam<Real>("myconstant",
│ 1.0,
│ "Some constant that I defined here to test.");

│ return params;
│ }

│ PackedColumn::ElasticityTensorX(const InputParameters & parameters)
│ : ComputeElasticityTensor(parameters),

│ _some_constant(getParam<Real>("myconstant")),

│ _el_modulus(declareProperty<Real>("el_modulus")),
│ {
│ // Do something with it

│ // Can I assign the _youngs_modulus from the ComputeElasticityTensor
│ // like this?
│ _youngs_modulus = _el_modulus;
│ }

│ void
│ ElasticityTensorX::computeQpElasticityTensor()
│ {
│ /* \delta_{ij} * \delta_{kl} */
│ // initIdentitySymmetricFour() in
│ // moose/framework/src/utils/RankFourTensor.C
│ RankFourTensor Iijkl = RankFourTensor::initIdentitySymmetricFour();

│ /* St. Venant–Kirchhoff Material (example; not useful) */
│ // In this case _el_modulus is just a name, do not confuse with the
│ // actual elasticity modulus.
│ _elasticity_tensor[_qp] = _youngs_modulus * Iijkl + 2 *
_some_constant * Ijkl;
│ }
└────
File 2: ElasticityTensorX.C

Andrew....@csiro.au

unread,
Nov 2, 2017, 7:45:07 PM11/2/17
to moose...@googlegroups.com
Your approach is not really correct. For this initial piece of code, the _some_constant and my_constant stuff is fine. You do not need the _el_modulus. You are inheriting from ComputeElasticityTensor, but ComputeElasticityTensorBase would be better. That class declares a RankFourTensor MaterialProperty called _elasticity_tensor that you need to populate with values in your computeQpElasticityTensor method. Your only piece of non-trivial code would be

_elasticity_tensor[_qp] = whatever_you_want;

Have a look at ComputeIsotropicElasticityTensor. There are lots of options there, but the user must provide two numbers, and the class fills a constant RankFourTensor _Cijkl appropriately depending on what numbers the user provided. Then in computeQpElasticityTensor, it copies the values in _Cijkl into _elasticity_tensor[_qp].

Also, have a look at framework/include/utils/RankFourTensor.h and the .C file, and you'll see that initIdentitySymmetricFour gives (de_ij de_kl + de_il de_jk)/2.

a

________________________________________
From: moose...@googlegroups.com <moose...@googlegroups.com> on behalf of Edgar Rios <edga...@u.boisestate.edu>
Sent: Friday, 3 November 2017 5:10 AM
To: moose...@googlegroups.com
Subject: How to create my first material?

• Short version.

• Longer version

Hello,

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/CAGXJvspKuP1QyGioyE1VF%2B-1yFdh43sc6ay55-4899oMot8OnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Edgar Rios

unread,
Nov 3, 2017, 4:15:26 PM11/3/17
to moose...@googlegroups.com
andrew.wilkins Nov 02 11:44PM
> https://groups.google.com/forum/#!msg/moose-users/BMQKsvm2tfE/dt5u5xUxBwAJ
>
> Your approach is not really correct.

Thank you very much for your support Dr. Wilkins. I will post again as
soon as I have something new (I already have some questions :) ) .
Have a nice weekend.

eDgar

unread,
Jan 10, 2018, 7:22:06 PM1/10/18
to moose-users
Hello Dr. Wilkins, moose-users and moose-devs,


On Thursday, November 2, 2017 at 11:45:07 PM UTC, andrew.wilkins wrote:
but ComputeElasticityTensorBase would be better.  That class declares a RankFourTensor MaterialProperty called _elasticity_tensor that you need to populate with values in your computeQpElasticityTensor method.

I just finished a new version, and would like to have your input.
 
 Your only piece of non-trivial code would be

_elasticity_tensor[_qp] = whatever_you_want;

Have a look at ComputeIsotropicElasticityTensor.  There are lots of options there, but the user must provide two numbers, and the class fills a constant RankFourTensor _Cijkl appropriately depending on what numbers the user provided. 

Then in computeQpElasticityTensor, it copies the values in _Cijkl into _elasticity_tensor[_qp].

Also, have a look at framework/include/utils/RankFourTensor.h and the .C file, and you'll see that initIdentitySymmetricFour gives (de_ij de_kl + de_il de_jk)/2.    

 
Do you think that there is a better way of doing it than what I am sending? The elasticity (compliance) tensor of the St. Venant-Kirchhoff equation is

Cijkl=λδijδkl+2μδikδjl

[Bonet, J., & Wood, R. D., Nonlinear continuum mechanics for finite element analysis (1999), : Cambridge Univ. Press.]

I am preparing some documentation that I will freely distribute later, thus there are a lot of comments. If this is right, I will come with some other questions about it later. I will compile this, but I would appreciate having your input as I go ahead.

{I post the code below, because not everyone has access to the files on the mailing list}

/*************************************************************/
/*  Headers for a test of a new elasticity tensor in MOOSE   */
/*                  Status: not working                      */
/*                                                           */
/* Copyright (C) 2017, 2018  eDgar                           */
/*                                                           */
/* This program is free software: you can redistribute it    */
/* and/or modify it under the terms of the GNU General       */
/* Public License as published by the Free Software          */
/* Foundation, either version 3 of the License, or (at your  */
/* option) any later version.                                */
/*                                                           */
/* This program is distributed in the hope that it will be   */
/* useful, but WITHOUT ANY WARRANTY; without even the        */
/* implied warranty of MERCHANTABILITY or FITNESS FOR A      */
/* PARTICULAR PURPOSE.  See the GNU General Public License   */
/* for more details.                                         */
/*                                                           */
/* You should have received a copy of the GNU General Public */
/* License along with this program.  If not, see             */
/* <http://www.gnu.org/licenses/>.                           */
/*************************************************************/

// Lines like this (starting with //) are extra documentation

// This line is a conditional to make sure that the function
// is not declared twice (it ends with #endif below;
// everything in-between is within the conditional if it's
// true)
#ifndef ELASTICITYTENSORX_H
// After making sure that the function hasn't been
// previously defined, we state that we are now going to
// define it
#define ELASTICITYTENSORX_H

// We are going to use functions to define the elasticity tensor
// (a material needs an elasticity, strain and stress tensors),
// so we load (include, import) it at compilation time.
// This class provides, among others, _elasticity_tensor (a
// RankFourTensor MaterialProperty--Andrew Wilkins)
#include "ComputeElasticityTensorBase.h"

// State what we are creating.
class ElasticityTensorX;

// ... and declare a (MOOSE) template for it
template <>
InputParameters
validParams<ElasticityTensorX>();

/**
 * ElasticityTensorX defines an elasticity tensor for the
 * St. Venant-Kirchhoff material. It is meant as a guide on
 * the implementation of (elasticity tensors of) new materials.
 */
// We inherit from ComputeElasticityTensorBase, which
// "declares a RankFourTensor MaterialProperty called
// _elasticity_tensor that you need to populate with values
// in your computeQpElasticityTensor method"
// (andrew.wilkins)
class ElasticityTensorX : public ComputeElasticityTensorBase
{
public:
  ElasticityTensorX(const InputParameters & parameters);

protected
:
  // - Qp refers to quadrature points
  //   - This function "Assign{s an} elasticity tensor at a given
  //     given quad point", [see ComputeElasticityTensor.C,
  //     2017-11-01]
  // - `override' means to make sure that you inherit the right
  //   thing (something that exists)
  virtual void computeQpElasticityTensor() override;

  // Something that belongs to your object goes with _,
  // but the program will run without it.
  // We can declare a constant, for instance
  const Real & _some_constant;

  // Following the style in,
  // [[moose/modules/tensor_mechanics/include/materials/ComputeIsotropicElasticityTensor.h]]
  // create Booleans which will be used to test if the Lamé
  // constants were defined in the .i (input) file
  bool _lambda_set;
  bool _mu_set;

  // These are just material properties which don't change
  // (which declaration is better?)
  /* Lamé constant mu (mu > 0). ComputeElasticityTensorBase
     already defines _lambda (Real _lambda;) */
  const MaterialProperty<Real> & _mu;

  // We state that this class has a fourth order tensor
  // called _Cijkl (we could have used another name; not
  // even the indices are required)
  RankFourTensor _Cijkl;
};

// This indicates that the conditional finished, and a tag
// is next to it to identify which "if" it closes (there
// could be nested conditionals, and they become difficult
// to track).
#endif // ELASTICITYTENSORX_H


=================================

/*************************************************************/
/*   Source for a test of a new elasticity tensor in MOOSE   */
/*                  Status: not working                      */
/*                                                           */
/* Copyright (C) 2017, 2018  eDgar                           */
/*                                                           */
/* This program is free software: you can redistribute it    */
/* and/or modify it under the terms of the GNU General       */
/* Public License as published by the Free Software          */
/* Foundation, either version 3 of the License, or (at your  */
/* option) any later version.                                */
/*                                                           */
/* This program is distributed in the hope that it will be   */
/* useful, but WITHOUT ANY WARRANTY; without even the        */
/* implied warranty of MERCHANTABILITY or FITNESS FOR A      */
/* PARTICULAR PURPOSE.  See the GNU General Public License   */
/* for more details.                                         */
/*                                                           */
/* You should have received a copy of the GNU General Public */
/* License along with this program.  If not, see             */
/* <http://www.gnu.org/licenses/>.                           */
/*************************************************************/

// We need to get the specification of how to call the
// functions which will be defined below. That is the main
// point of the header (.h) file
#include "ElasticityTensorX.h"

// Populate the template which was sketched in the header
// file. The parameters given here can be used by the user
// in the input file.
();

  // Description which is shown in the auto-generated
  // documentation
  params.addClassDescription("DO NOT USE!!\n"
                             "ElasticityTensorX defines an "
                             "elasticity tensor for the "
                             "St. Venant-Kirchhoff material. "
                             "It is meant as a guide on the "
                             "implementation of (elasticity "
                             "tensors of) new materials.\n"
                             "\(\Psi(\tensor{E}) = \frac{1}{2}\,"
                             "\lambda\,(\Tr{\tensor{E}})^{2} + "
                             "\mu\,\tensor{E}:\tensor{E}\)");

  // State that _lambda and _mu are required parameters
  // (technically, only one is needed)
  params.addRequiredParam<Real>("lambda",
                                1.0,
                                "Lame's first constant for the material.");
  params.addRequiredParam<Real>("mu",
                        1.0,
                        "Lamé second constant for the material");

  return params;
}

ElasticityTensorX::ElasticityTensorX(const InputParameters & parameters)
  : ComputeElasticityTensorBase(parameters),

    // When this function is called, it is because the
    // application is compiled and executed with an input
    // file (.i).
    //
    // First, make sure that the parameters were given in
    // the .i (input) file. Note that we called it "lambda"
    // in the template above, but the variable in the .h
    // file is _lambda. For the user filling the .i (input)
    // file, it will be `lambda'. For calculations in the
    // code, it will be `_lambda'.
    _lambda_set(parameters.isParamValid("lambda")),
    _mu_set(parameters.isParamValid("mu")),

    // Get parameters from the input file. The following
    // line is an implicit conditional. It checks if the
    // Boolean value is True, in which case, it assigns the
    // value after the `?' (and before `:'). If the value is
    // False, then the variable gets the value indicated
    // after `:'. In this case, if `lambda' was set in the
    // .i (input) file, it gets the value from
    // there. Otherwise, it sets it to -1.
    _lambda(_lambda_set ? getParam<Real>("lambda") : -1),
    // The same for `mu'.
    _mu(_mu_set ? getParam<Real>("mu") : -1)
{
  // St. Venant-Kirchhoff material model (example; not
  // useful for any practical application).

  // Now we are going to initialise the tensor

  // Make sure that the values are not both negative or zero
  // Holzapfel, G. A., Nonlinear solid mechanics : a
  // continuum approach for engineering (2000), : Wiley. p.250
  if (_lambda <= 0.0 || _mu <= 0.0)
    mooseError("The Lamé constants must be positive in material '"
               + name() + "'.");

  // The St. Venant-Kirchhoff model is defined as
  //
  // LaTeX:
  // \({\cal C}_{ijkl} = \lambda\,\delta_{ij}\,\delta_{kl}
  //                     + 2\,\mu\,\delta_{ik}\,\delta_{jl} \)
  //
  // You have to make sure that whatever operatations
  // (including addition, subtraction, etc. work as you
  // think). In this case, check that the definition of
  // RankFourTensor has the required operations.
  // [[moose/framework/src/utils/RankFourTensor.C]]

  // LaTeX:
  // \( \delta_{ij} \, \delta_{kl} \)
  //
  // initIdentity() in
  // [[moose/framework/src/utils/RankFourTensor.C]]
  const RankFourTensor dij_dkl = RankFourTensor::initIdentity();

  // initIdentityFour() in
  // [[moose/framework/src/utils/RankFourTensor.C]]
  const RankFourTensor dik_djl = RankFourTensor::initIdentityFour();

  // Knowing that the * operator is defined as we expect
  // between a tensor and a scalar, as well as the +
  // operator between the two RankFourTensor, from the
  // definition:
  _Cijkl = _lambda * dij_dkl + 2 * _mu * dik_djl;
}

void
ElasticityTensorX::computeQpElasticityTensor()
{
  // This assigns an elasticity tensor at each quadrature
  // point (_qp) to each of the elements of the material.
  _elasticity_tensor[_qp] = _Cijkl;
}

============================================

[Materials]
  [./elasticity_tensor]
    type = ElasticityTensorX
    lambda = 2.1e5
    mu = 3.3e5
  [../]

  [./strain]
    type = ComputeFiniteStrain
    displacements = 'disp_x disp_y disp_z'
  [../]

  [./stress]
    type = ComputeFiniteStrainElasticStress
  [../]
[]

================================================

#################################################
#      Makefile adapted by eDgar from           #
#      MOOSE Application Standard Makefile      #
#################################################
#
# Optional Environment variables
# MOOSE_DIR        - Root directory of the MOOSE project
#
# ###############################################
# Use the MOOSE submodule if it exists and MOOSE_DIR is not
# set
MOOSE_SUBMODULE    := $(CURDIR)/moose
ifneq ($(wildcard $(MOOSE_SUBMODULE)/framework/Makefile),)
  MOOSE_DIR        ?= $(MOOSE_SUBMODULE)
else
  MOOSE_DIR        ?= ../../../../../moose
endif

# framework
FRAMEWORK_DIR      := $(MOOSE_DIR)/framework
include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk

# MODULES #######################################
ALL_MODULES               := no

CHEMICAL_REACTIONS        := no
CONTACT                   := no
FLUID_PROPERTIES          := no
HEAT_CONDUCTION           := no
LINEAR_ELASTICITY         := no
MISC                      := no
NAVIER_STOKES             := no
PHASE_FIELD               := no
POROUS_FLOW               := no
RICHARDS                  := no
SOLID_MECHANICS           := no
# all that we are doing is TensorMechanics
TENSOR_MECHANICS          := yes
WATER_STEAM_EOS           := no
XFEM                      := no
include $(MOOSE_DIR)/modules/modules.mk
# ###############################################

# dep apps
APPLICATION_DIR    := $(CURDIR)
# Set my application name
APPLICATION_NAME   := hyper_materials
# Make the application executable
BUILD_EXEC         := yes
DEP_APPS           := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include            $(FRAMEWORK_DIR)/app.mk

# ###############################################
# Additional special case targets should be added here
 
 
material.tar.gz
Auto Generated Inline Image 1

Andrew....@csiro.au

unread,
Jan 10, 2018, 7:58:59 PM1/10/18
to moose...@googlegroups.com
Overall that looks good :-) If you are going to contribute this back to MOOSE there will be lots of small things to change, eg, you probably don't need you _lambda_set and _mu_set variables because you're also providing a default value for mu and lambda: instead you just need to check that the parameters are positive. My main suggestion is to ensure that you really want to use initIdentityFour instead of initIdentitySymmetricFour. It's possible that someone might use this with crazy non-symmetric stresses and strains and initIdentitySymmetricFour essentially symmetrises the strain before forming the stress.

a


Ph: +61 7 3327 4497.  Fax: +61 7 3327 4666
Queensland Centre for Advanced Technologies
PO Box 883, Kenmore, Qld, 4069 
 
From: moose...@googlegroups.com [mailto:moose...@googlegroups.com] On Behalf Of eDgar
Sent: Thursday, 11 January 2018 10:22 AM
To: moose-users <moose...@googlegroups.com>
Subject: Re: How to create my first material?

Hello Dr. Wilkins, moose-users and moose-devs,

On Thursday, November 2, 2017 at 11:45:07 PM UTC, andrew.wilkins wrote:
but ComputeElasticityTensorBase would be better.  That class declares a RankFourTensor MaterialProperty called _elasticity_tensor that you need to populate with values in your computeQpElasticityTensor method.

I just finished a new version, and would like to have your input.
 
 Your only piece of non-trivial code would be
_elasticity_tensor[_qp] = whatever_you_want;
Have a look at ComputeIsotropicElasticityTensor.  There are lots of options there, but the user must provide two numbers, and the class fills a constant RankFourTensor _Cijkl appropriately depending on what numbers the user provided. 
Then in computeQpElasticityTensor, it copies the values in _Cijkl into _elasticity_tensor[_qp].
Also, have a look at framework/include/utils/RankFourTensor.h and the .C file, and you'll see that initIdentitySymmetricFour gives (de_ij de_kl + de_il de_jk)/2.    
 
Do you think that there is a better way of doing it than what I am sending? The elasticity (compliance) tensor of the St. Venant-Kirchhoff equation is

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/ec9b0490-cc9e-4162-b72f-a1de2c498078%40googlegroups.com.

eDgar

unread,
Jan 23, 2018, 1:12:44 PM1/23/18
to moose-users

What is the right way to compile a new app?


Hello moose-users,

I recently made a small piece of code with the intention of creating a new material (1, 2). I attach the code as a tar.gz. If I run make, I get no errors, but I don't know where the executable is. I am guessing that I made a silly mistake along the road, and would appreciate if someone could enlighten my way. I post the my way of doing it below. Thanks!

I compile like this:

cd spider
make -j4

This produces a ../hyper_materials-opt, which I can use

cd problems
../hyper_materials-opt -i stress.i

and tells me that

*** ERROR ***
A 'spider' is not a registered object.

If you are trying to find this object in a dynamically linked library, make sure that
the library can be found either in your "Problem/library_path" parameter or in the
MOOSE_LIBRARY_PATH environment variable.

[1] https://groups.google.com/forum/#!topic/moose-users/o9ihbxrSaDc [2] https://groups.google.com/forum/#!topic/moose-users/BMQKsvm2tfE

 

Cody Permann

unread,
Jan 23, 2018, 3:01:00 PM1/23/18
to moose...@googlegroups.com
Every new object needs to be registered before use. See the Registration example in the middle of the "Kernels" tutorial here:

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.

eDgar

unread,
Jan 25, 2018, 12:26:07 PM1/25/18
to moose-users
On Tuesday, January 23, 2018 at 8:01:00 PM UTC, Cody Permann wrote:
Every new object needs to be registered before use. See the Registration example in the middle of the "Kernels" tutorial here:
 
Thank you, Dr. Permann. I tried by adding this to `spiderApp.C':

┌────
│ void
│ spiderApp::registerObjects(Factory & factory)
│ {
│   /* Uncomment Factory parameter and register your new production objects here! */
│   registerKernel(spider);
│ }
└────

, and this to `spider.h'

┌────
│ class spider;

│ template <>
│ InputParameters
│ validParams<spider>();
└────

I have been trying to find a solution without taking your
time. Therefore, I relocated `spider.h' and `spider.C' to a `kernels'
directory in `include' and another one in `src', respectively. It's nice
to see that MOOSE doesn't really need this, and would find them in
either location. Yet, I get this error:

┌────
│ In file included from /home/edgar/Progs/moose/framework/include/base/MooseApp.h:22:0,
│                  from spider/include/base/spiderApp.h:4,
│                  from spider/src/base/spiderApp.C:1:
│ spider/src/base/spiderApp.C: In static member function ‘static void spiderApp::registerObjects(Factory&)’:
│ spider/src/base/spiderApp.C:39:18: error: ‘spider’ was not declared in this scope
│    registerKernel(spider);
│                   ^
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:34:42: note: in definition of macro ‘registerObject’
│  #define registerObject(name) factory.reg<name>(stringifyName(name), __FILE__, __LINE__)
│                                           ^~~~
│ spider/src/base/spiderApp.C:39:3: note: in expansion of macro ‘registerKernel’
│    registerKernel(spider);
│    ^~~~~~~~~~~~~~
│ spider/src/base/spiderApp.C:39:18: note: suggested alternative: ‘spiderApp’
│    registerKernel(spider);
│                   ^
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:34:42: note: in definition of macro ‘registerObject’
│  #define registerObject(name) factory.reg<name>(stringifyName(name), __FILE__, __LINE__)
│                                           ^~~~
│ spider/src/base/spiderApp.C:39:3: note: in expansion of macro ‘registerKernel’
│    registerKernel(spider);
│    ^~~~~~~~~~~~~~
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:34:87: error: no matching function for call to ‘Factory::reg<<expression error> >(const char [7], const char [79], int)’
│  #define registerObject(name) factory.reg<name>(stringifyName(name), __FILE__, __LINE__)
│                                                                                        ^
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:49:30: note: in expansion of macro ‘registerObject’
│  #define registerKernel(name) registerObject(name)
│                               ^~~~~~~~~~~~~~
│ spider/src/base/spiderApp.C:39:3: note: in expansion of macro ‘registerKernel’
│    registerKernel(spider);
│    ^~~~~~~~~~~~~~
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:163:8: note: candidate: template<class T> void Factory::reg(const string&, const string&, int)
│    void reg(const std::string & obj_name, const std::string & file = "", int line = -1)
│         ^~~
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:163:8: note:   template argument deduction/substitution failed:
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:34:87: error: template argument 1 is invalid
│  #define registerObject(name) factory.reg<name>(stringifyName(name), __FILE__, __LINE__)
│                                                                                        ^
│ /home/edgar/Progs/moose/framework/include/base/Factory.h:49:30: note: in expansion of macro ‘registerObject’
│  #define registerKernel(name) registerObject(name)
│                               ^~~~~~~~~~~~~~
│ spider/src/base/spiderApp.C:39:3: note: in expansion of macro ‘registerKernel’
│    registerKernel(spider);
│    ^~~~~~~~~~~~~~
└────

What am I doing wrongly? Thanks.

Cody Permann

unread,
Jan 25, 2018, 1:14:21 PM1/25/18
to moose...@googlegroups.com
Did you make sure to add 
#include "spider.h"
to your spiderApp file? You'll get the error that the type isn't known if the header isn't included before trying to register.

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.

Edgar Rios

unread,
Jan 25, 2018, 1:22:29 PM1/25/18
to moose...@googlegroups.com
I can't believe I missed that. Thanks.
Reply all
Reply to author
Forward
0 new messages