\item \code{getCelerity}:~The stability criterion of the explicit integration scheme depend on the fastest wave celerity~\eqref{eqn:smm:explicit:stabletime}. This celerity depend on the material, and therefore the value of this velocity should be defined in this method for each new material. By default, the fastest wave speed is the compressive wave whose celerity can be defined in~\code{getPushWaveSpeed}.
\end{itemize}
Once the declaration and implementation of the new material has been
completed, this material can be used in the user's example by including the header file:
\begin{cpp}
#include "material_XXX.hh"
\end{cpp}
For existing materials, as mentioned in Section~\ref{sect:smm:CL}, by
default, the materials are initialized inside the method
\code{initFull}. If a local material should be used instead, the
initialization of the material has to be postponed until the local
material is registered in the model. Therefore, the model is
initialized with the boolean for skipping the material initialization
Only at this point the material can be initialized:
\begin{cpp}
model.initMaterials();
\end{cpp}
A full example for adding a new damage law can be found in
\shellcode{\examplesdir/new\_material}.
\subsection{Adding a New Non-Local Constitutive Law}\index{Material!create a new non-local material}
In order to add a new non-local material we first have to add the local constitutive law in \akantu (see above). We can then add the non-local version of the constitutive law by adding the two files (\code{material\_XXX\_non\_local.hh} and \code{material\_XXX\_non\_local.cc}) where \code{XXX} is the name of the corresponding local material. The new law must inherit from the two classes, non-local parent class, such as the \code{MaterialNonLocal} class, and from the local version of the constitutive law, \textit{i.e.} \code{MaterialXXX}. It is therefore necessary to include the interface of those classes in the header file of your custom material and indicate the inheritance in the declaration of the class:
In the intialization of the non-local material we need to register the local quantity for the averaging process. In our example the internal field \emph{grad\_u\_nl} is the non-local counterpart of the gradient of the displacement field (\emph{grad\_u\_nl}):
\begin{cpp}
void MaterialXXXNonLocal::initMaterial() {
MaterialXXX::initMaterial();
MaterialNonLocal::initMaterial();
/// register the non-local variable in the manager
The function to register the non-local variable takes as parameters the name of the local internal field, the name of the non-local counterpart and the number of components of the field we want to average.
In the \emph{computeStress} we now need to compute all the quantities we want to average. We can then write a loop for the stress computation in the function \emph{computeNonLocalStresses} and then provide the constitutive law on each integration point in the function \emph{computeNonLocalStress}.
- + id : my_mesh:mesh_data:subelement_to_element:_hexahedron_8
- + size : 64
- + nb_component : 6
- + allocated size : 64
- + memory size : 54.00KiByte
- + address : 0x55c7edbeba80
- ]
- Element [_quadrangle_4, 0, not_ghost], Element [_quadrangle_4, 35, not_ghost], Element [_quadrangle_4, 51, not_ghost], ElementNull, ElementNull, ElementNull, for element 0
- Element [_quadrangle_4, 34, not_ghost], Element [_quadrangle_4, 55, not_ghost], ElementNull, ElementNull, ElementNull, ElementNull, for element 1
- Element [_quadrangle_4, 33, not_ghost], Element [_quadrangle_4, 59, not_ghost], ElementNull, ...
-The rest of the test output was removed since it exceeds the threshold of 1024 bytes.
-[==========] Running 120 tests from 84 test cases.
-[----------] Global test environment set-up.
-[----------] 1 test from Split1/TestGaussIntegrationFixture/0, where TypeParam = std::tuple<std::integral_constant<akantu::ElementType, (akantu::ElementType)9>, std::integral_constant<unsigned long, 0ul> >
-[ RUN ] Split1/TestGaussIntegrationFixture/0.ArbitraryOrder
-[ OK ] Split1/TestGaussIntegrationFixture/0.ArbitraryOrder (5 ms)
-[----------] 1 test from Split1/TestGaussIntegrationFixture/0 (5 ms total)
-
-[----------] 1 test from Split1/TestGaussIntegrationFixture/1, where TypeParam = std::tuple<std::integral_constant<akantu::ElementType, (akantu::ElementType)9>, std::integral_constant<unsigned long, 1ul> >
-[ RUN ] Split1/TestG...
-The rest of the test output was removed since it exceeds the threshold of 1024 bytes.
-<1234>[R0|S1] {1547131895556212} --- The connectivity vector for the type _hexahedron_8 created (getConnectivityPointer(): /home/jenkins/workspace/akantu-private-master-5327/src/mesh/mesh_inline_impl.cc:185)
-<1234>[R0|S1] {1547131895573213} --- There are not facets, add them in the mesh file or call the buildFacet method. (fillElementToSubElementsData(): /home/jenkins/workspace/akantu-private-master-5327/src/mesh_utils/mesh_utils.cc:1514)
-<1690>[R0|S1] {1547131924190753} /!\ No parameter named Plane_Stress registered in solid_mechanics_model:0:elastic. (parseParam(): /home/jenkins/workspace/akantu-private-master-5327/src/io/parser/parsable.cc:64)
-(terminate_handler(): /home/jenkins/workspace/akantu-private-master-5327/src/common/aka_error.cc:235)!! Uncaught exception of type akantu::debug::AssertException !!
-what(): "assert [this->size_ > 0] The array "mesh:nodes_flags" is empty"
-[5b4962022198:03203] *** Process received signal ***
-<3219>[R0|S1] {1547134015573895} /!\ The group corner does not contain only boundaries elements (applyBC(): /home/jenkins/workspace/akantu-private-master-5327/src/model/boundary_condition_tmpl.hh:222)
-[----------] 5 tests from TestSMMCFixture/0, where TypeParam = std::tuple<std::integral_constant<akantu::ElementType, (akantu::ElementType)1>, std::integral_constant<akantu::ElementType, (akantu::ElementType)9>, std::integral_constant<akantu::ElementType, (akantu::ElementType)9> >
-[ RUN ] TestSMMCFixture/0.ExtrinsicModeI
-[ OK ] TestSMMCFixture/0.ExtrinsicModeI (302 ms)
-[ RUN ] TestSMMCFixture/0.ExtrinsicModeIFiniteDef
-unknown file: Failure
-C++ exception with description "assert [((i < this->n[0]) && (j < this->n[1]))] Access out of the matrix! Index (1, 0) is out of the matrix of size (1, 1)" thrown in the test body.
-double free or corruption (!prev)
-[5b4962022198:03356] *** Process received signal ***
-<3667>[R0|S1] {1547134207166258} /!\ The field element_type is not registered in this Dumper. Nothing to do. (unRegisterField(): /home/jenkins/workspace/akantu-private-master-5327/src/io/dumper/dumper_iohelper.cc:174)
-<3667>[R0|S1] {1547134207167258} /!\ The field element_type is not registered in this Dumper. Nothing to do. (unRegisterField(): /home/jenkins/workspace/akantu-private-master-5327/src/io/dumper/dumper_iohelper.cc:174)
-<3837>[R0|S1] {1547134237081876} /!\ getForce was maintained for backward compatibility, use getExternalForce instead (getForce(): /home/jenkins/workspace/akantu-private-master-5327/src/model/solid_mechanics/solid_mechanics_model.hh:392)
# Akantu is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# Akantu 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along with Akantu. If not, see <http://www.gnu.org/licenses/>.
# Akantu is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# Akantu 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along with Akantu. If not, see <http://www.gnu.org/licenses/>.