Topic: How to add a new element where each node has one new dof?

Hi, ladies and gentlemen,

I want to add a new triangle element in src/sm. And each node has one new dof. The element may be like the tr1_ht.C and the new dof can be consider as Temperature. However, I am unfamiliar with heat transfer problem. My questions are listd below:

1. How to add a new dof? I have added the new dof information like the Temperature dof in
bcvaltype.h, cltypes.C, dofiditem.h, domain.C, domaintype.h, field.h, internalstatetype.h, materialmode.h, unknowntype.h.
Although oofem can be built with these changes, I receive a error that is "'p_f' cannot be resolved"(p_f is the new dof). Do I miss some files needed to be changed?

2. tr1_ht.C is based on transportelement. And transportelement.C is based on stationarytransportproblem. To me, heat transfer problem is more complicated than structural one. In src/sm, can I add the element like trplanstrss.C?

3. If the new element can be write like trplanstrss.C, does it base on structural2delement.h? And how to make the link between the new dof and the element's node?

Thank u for watching this message. And I would appreciate ur help.

zhuang ^_^

Re: How to add a new element where each node has one new dof?

Hi,

do you need strong coupling between transport and structural problems or would be weak coupling good enought?

Martin

Re: How to add a new element where each node has one new dof?

Hi, Martin

Thanks for ur reply. My ultimate goal is coupling D_u, D_v and the new dof p_f(which is used to modeling phase field). And I think weak coupling would be enough. I have two ideas below.

The first one is adding a new element where each node just has one dof. Using both the new element and trplanstrss element to build the model. And then selecting two solvers to solve it one by one. Can oofem support using two solvers at the same time? Or can the staggered solver select two solvers?(The reason why I need two solvers is that p_f is between 0 and 1, which is different from D_u and D_v)

The second one is just like the transfer element. But the coupling items StiffnessMatrix_ud and StiffnessMatrix_du will be set as 0. Then using the staggered solver to solve it. It seems that it's easier than the first one. I try to imitate the transfer element in src/sm but failed. Yet I think the new element that I need doesn't have to build so compilcated like the tranfer one.

Moreover, I don't know how to use staggered solver. The test file tmquad12.in is just like the structural one except the problem and domain that it chooses.  The file oofemInput.pdf illustrates that the input file should have key words prob1 and prob2 but tmquad12.in doesn't have. It is ambiguous to me.

with regards

zhuang

Re: How to add a new element where each node has one new dof?

Hi,

you can download a version of OOFEM with phase field from here https://github.com/nitramkaroh/phaseField. It is still under development, i.e., not prepared to be added to the git repository. It is not 100% working but you can get some results and maybe help me to correct some errors.
An input file is also attached. The model is not called phase field, but it is completely equivalent. It is based on the strongly coupled approach, but you can easily set the off-diagonal terms to zero.
I am not sure about the staggered solver, I will look at it.

Let me know if you need some more help or explanation.

Martin

Post's attachments

phaseFieldTension.txt 9.78 kb, 3 downloads since 2017-10-24 

You don't have the permssions to download the attachments of this post.

Re: How to add a new element where each node has one new dof?

Hi, Martin

Thanks for ur reply and ur version of oofem. It's a precious treasure for me. And now I probably know how to add an element.

However, I can't compile OOFEM with phase field directly. I receive some errors like
1.  "Description    Resource    Path    Location    Type
The type 'oofem::NRSolver' must implement the inherited pure virtual method 'oofem::SparseNonLinearSystemNM::solve'     stokesflow.C    /oofem-debug@debug/[Source directory]/src/fm    line 274    Code Analysis Problem"(OOFEM with phase field has been changed a lot compared with OOFEM-2.4. I try to correct it but I receive more errors...So I just add the files about quad1planestraingraddamage)
2. "'fabs' was not declared in this scope."(This error is also meet in OOFEM-2.4. I fix it by adding head file "math.h" to those error files.)
3. The phaseFieldTension.in use lstype 4 and smtype 10. Then I get error about NRSolver. I change it to lstype 3 and smtype 7. And It works.

In addition, I don't know where ‘PiecewiseLinFunction’ act upon. And Why use ‘initialGuess 1’? Could you tell me which experiment  does the test base on ?

Thanks for ur help again!

zhuang

Re: How to add a new element where each node has one new dof?

Hi,

there was one error and I just pushed a fix. Note that there are many changes in this version in comparison with version 2.4, not just the phase field, I will add them gradually to the git version.
ad 1. I have no idea about this error. Can you download the new version from https://github.com/nitramkaroh/phaseField and try to compile it again?
ad 3. This line is defining just type of solver, to be able to run with ls 4, sm 10 you need to compile with DSS(direct sparse solver).
The PiecewiseLinFunction is applied at the boundary conditions, i.e., it controls the increase of displacement during time steps. 
The input file is just testing one, it is not based on any experiment and as I wrote the code is so far experimental and more work will be necessary.

Re: How to add a new element where each node has one new dof?

Hi, Martin

OOFEM with phase field can work now! I turn on DSS and try to compile with it, but nothing happen. I am not clear where the problem is. Yet it doesn't matter. I can use the PETScSolver.

I write an element which just has phase-field dof. I think if I can't add this one, I am not sure whether I can handle the couple one. Could you give me some advice? The files are attached. Maybe the input file is wrong.

It fails to be solved. Error that I meet is
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 59.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentat … l#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Signal received
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.7.3, Jul, 24, 2016
[0]PETSC ERROR: /home/zhuang/oofem/build/debug/oofem on a x86_64-linux-gnu-real named zhuang by zhuang Tue Oct 31 22:36:15 2017
[0]PETSC ERROR: Configure options --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --with-silent-rules=0 --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --with-maintainer-mode=0 --with-dependency-tracking=0 --with-debugging=0 --shared-library-extension=_real --with-hypre=1 --with-hypre-dir=/usr --with-clanguage=C++ --with-shared-libraries --with-pic=1 --useThreads=0 --with-fortran-interfaces=1 --with-mpi-dir=/usr/lib/openmpi --with-blas-lib=-lblas --with-lapack-lib=-llapack --with-blacs=1 --with-blacs-lib="-lblacsCinit-openmpi -lblacs-openmpi" --with-scalapack=1 --with-scalapack-lib=-lscalapack-openmpi --with-mumps=1 --with-mumps-include="[]" --with-mumps-lib="-ldmumps -lzmumps -lsmumps -lcmumps -lmumps_common -lpord" --with-suitesparse=1 --with-suitesparse-include=/usr/include/suitesparse --with-suitesparse-lib="-lumfpack -lamd -lcholmod -lklu" --with-spooles=1 --with-spooles-include=/usr/include/spooles --with-spooles-lib=-lspooles --with-ptscotch=1 --with-ptscotch-include=/usr/include/scotch --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr" --with-fftw=1 --with-fftw-include="[]" --with-fftw-lib="-lfftw3 -lfftw3_mpi" --with-superlu=0 --CXX_LINKER_FLAGS=-Wl,--no-as-needed --prefix=/usr/lib/petscdir/3.7.3/x86_64-linux-gnu-real PETSC_DIR=/build/petsc-fA70UI/petsc-3.7.3.dfsg1 --PETSC_ARCH=x86_64-linux-gnu-real CFLAGS="-g -O2 -fdebug-prefix-map=/build/petsc-fA70UI/petsc-3.7.3.dfsg1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC" CXXFLAGS="-g -O2 -fdebug-prefix-map=/build/petsc-fA70UI/petsc-3.7.3.dfsg1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC" FCFLAGS="-g -O2 -fdebug-prefix-map=/build/petsc-fA70UI/petsc-3.7.3.dfsg1=. -fstack-protector-strong -fPIC" FFLAGS="-g -O2 -fdebug-prefix-map=/build/petsc-fA70UI/petsc-3.7.3.dfsg1=. -fstack-protector-strong -fPIC" CPPFLAGS="-Wdate-time -D_FORTIFY_SOURCE=2" LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro -fPIC" MAKEFLAGS=w
[0]PETSC ERROR: #1 User provided function() line 0 in  unknown file

Thank u

zhuang

Post's attachments

sm.zip 27.6 kb, 2 downloads since 2017-10-31 

You don't have the permssions to download the attachments of this post.

Re: How to add a new element where each node has one new dof?

Hi,

I don't understand why you implement a new element. The phase field element is already implemented, so you can just use an existing one.

Martin

Re: How to add a new element where each node has one new dof?

Hi, Martin
Yes, u r right. But the graddamage one is different from the phase-field. What's more, the solver doesn't support the features I want. And I have my mission. I know a true result of a simple model about phase-field. Before coupling the phase-field, I want to test the correctness of the phase-field dof.
Now I have almost succeed to add the element. Although I still debug the codes. The phase field element that you provide help me learning more about the structure of oofem.
Thanks for ur help vvvery much!
zhuang

Re: How to add a new element where each node has one new dof?

Actually, the graddamage is exactly the same as the phase-field. If you want to test just the phase-field part of the model, you can simply fix the displacement degrees of freedom.
Martin