Adding an attribute to a material
I added the 'eta' attribute in ViscolasticCapi
mat=O.materials
but it gives me the error:
No such attribute: eta.
So I think I have to introduce this attribute also in another place where the ViscElCapMat is introduced but I could not find it. Could you please help me with this?
Regards,
Roxana Saghafian
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hey Roxana,
You would need to add eta to this line of the ViscElCapMat class:
https:/
Then it should be accessible elsewhere in c++ and python.
Let me know if it helps,
Robert
Revision history for this message
|
#2 |
Hi Robert,
Thanks for yours response. However, I had already added the line you mentioned in the .hpp file but got the error:(
Regards,
Roxana Saghafian
Revision history for this message
|
#3 |
Hi Roxana,
could you please tell us a little bit more about your workflow?
I did exactly as Robert said. Next, I compiled the code and launched the yade from the install location. I added the material:
> mat=O.materials
And it has the property, which I can verify by:
> O.materials[
Please note that 'mat' is now just a material id. Hence, if you run
> O.materials[
you can get information that 'int' object has no attribute 'eta'.
Cheers,
Karol
Revision history for this message
|
#4 |
>> Thanks for yours response. However, I had already added the line you mentioned in the .hpp file but got the error:(
Can you provide the full error message?
Thank you,
robert
Revision history for this message
|
#5 |
This is the full error:
Running script eta.py
Traceback (most recent call last):
File "../yade-
execfile(
File "/usr/lib/
exec_(code, myglobals, mylocals)
File "eta.py", line 51, in <module>
ViscElCapMa
AttributeError: No such attribute: eta.
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Regards,
Roxana Saghafian
Revision history for this message
|
#6 |
Hi Karol,
Thank you for your response. I added eta just like the way gamma is defined in cpp and hpp files of viscoelasticCap
VisForceCoeffic
then I recompiled and tried to define a material in my script with a specific eta as ViscElCapMat(
But I received the error.
Regards,
Roxana Saghfian
Revision history for this message
|
#7 |
Hey Roxana,
Seems you may be using the incorrect executable file. Please copy and paste the final 20-30 lines of your compiler output here.
Cheers,
Robert
Revision history for this message
|
#8 |
Hi Robert,
please find it below:
Scanning dependencies of target _gts
[ 66%] Building CXX object py/CMakeFiles/
[ 66%] Building CXX object py/CMakeFiles/
[ 66%] Building CXX object py/CMakeFiles/
[ 67%] Building CXX object py/CMakeFiles/
[ 67%] Building CXX object py/CMakeFiles/
[ 68%] Building CXX object py/CMakeFiles/
[ 68%] Building CXX object py/CMakeFiles/
[ 68%] Building CXX object py/CMakeFiles/
[ 69%] Building CXX object py/CMakeFiles/
[ 69%] Building CXX object py/CMakeFiles/
[ 70%] Linking CXX shared library lib/x86_
[ 70%] Built target _gts
[ 71%] Building CXX object CMakeFiles/
Scanning dependencies of target _libVersions
[ 71%] Building CXX object py/CMakeFiles/
[ 71%] Linking CXX shared library lib/x86_
[ 71%] Built target _libVersions
[ 71%] Building CXX object CMakeFiles/
Scanning dependencies of target _polyhedra_utils
[ 71%] Building CXX object py/CMakeFiles/
In file included from /usr/include/
/usr/include/
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
[ 71%] Building CXX object CMakeFiles/
[ 72%] Linking CXX shared library lib/x86_
[ 72%] Built target _polyhedra_utils
[ 73%] Building CXX object CMakeFiles/
Scanning dependencies of target _packObb
[ 74%] Building CXX object py/CMakeFiles/
[ 74%] Linking CXX shared library lib/x86_
[ 74%] Built target _packObb
Scanning dependencies of target _log
[ 75%] Building CXX object py/CMakeFiles/
[ 75%] Linking CXX shared library lib/x86_
[ 75%] Built target _log
[ 75%] Building CXX object CMakeFiles/
Scanning dependencies of target _minieigenHP
[ 76%] Building CXX object py/CMakeFiles/
[ 76%] Building CXX object py/CMakeFiles/
[ 77%] Building CXX object CMakeFiles/
[ 77%] Building CXX object py/CMakeFiles/
[ 78%] Building CXX object py/CMakeFiles/
[ 78%] Building CXX object CMakeFiles/
[ 78%] Building CXX object py/CMakeFiles/
[ 79%] Building CXX object py/CMakeFiles/
[ 79%] Building CXX object py/CMakeFiles/
[ 79%] Building CXX object CMakeFiles/
[ 79%] Building CXX object py/CMakeFiles/
[ 80%] Building CXX object py/CMakeFiles/
[ 81%] Building CXX object CMakeFiles/
[ 81%] Building CXX object py/CMakeFiles/
[ 82%] Building CXX object py/CMakeFiles/
[ 82%] Building CXX object CMakeFiles/
[ 82%] Building CXX object py/CMakeFiles/
[ 82%] Linking CXX shared library lib/x86_
[ 82%] Built target _minieigenHP
Scanning dependencies of target _packPredicates
[ 83%] Building CXX object py/CMakeFiles/
[ 84%] Building CXX object CMakeFiles/
[ 84%] Linking CXX shared library lib/x86_
[ 84%] Built target _packPredicates
[ 84%] Building CXX object CMakeFiles/
Scanning dependencies of target _math
[ 85%] Building CXX object py/CMakeFiles/
[ 85%] Building CXX object CMakeFiles/
[ 86%] Building CXX object CMakeFiles/
[ 86%] Building CXX object CMakeFiles/
[ 86%] Building CXX object py/CMakeFiles/
[ 86%] Linking CXX shared library lib/x86_
[ 86%] Built target _math
Scanning dependencies of target WeightedAverage2d
[ 86%] Building CXX object py/CMakeFiles/
[ 86%] Linking CXX shared library lib/x86_
[ 86%] Built target WeightedAverage2d
Scanning dependencies of target _utils
[ 86%] Building CXX object py/CMakeFiles/
[ 86%] Building CXX object CMakeFiles/
In file included from /usr/include/
/usr/include/
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
[ 87%] Building CXX object CMakeFiles/
In file included from /usr/include/
/usr/include/
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
[ 87%] Linking CXX shared library lib/x86_
[ 87%] Built target _utils
Scanning dependencies of target _packSpheres
[ 87%] Building CXX object py/CMakeFiles/
[ 88%] Linking CXX shared library lib/x86_
[ 88%] Built target _packSpheres
Scanning dependencies of target wrapper
[ 88%] Building CXX object py/CMakeFiles/
[ 88%] Building CXX object CMakeFiles/
[ 89%] Linking CXX shared library lib/x86_
[ 89%] Built target wrapper
Scanning dependencies of target _customConverters
[ 90%] Building CXX object py/CMakeFiles/
[ 91%] Building CXX object CMakeFiles/
[ 91%] Linking CXX shared library lib/x86_
[ 91%] Built target _customConverters
[ 91%] Building CXX object CMakeFiles/
Scanning dependencies of target _GLViewer
[ 92%] Building CXX object gui/CMakeFiles/
[ 92%] Building CXX object CMakeFiles/
[ 92%] Building CXX object gui/CMakeFiles/
[ 93%] Building CXX object CMakeFiles/
[ 93%] Building CXX object gui/CMakeFiles/
[ 94%] Building CXX object gui/CMakeFiles/
[ 94%] Building CXX object CMakeFiles/
[ 94%] Building CXX object gui/CMakeFiles/
[ 95%] Building CXX object CMakeFiles/
[ 95%] Building CXX object CMakeFiles/
[ 96%] Building CXX object gui/CMakeFiles/
In file included from /home/Roxana/
/home/Roxana/
/home/Roxana/
91 | YADE_CLASS_
| ^
/home/Roxana/
91 | YADE_CLASS_
| ^
[ 96%] Linking CXX shared library lib/x86_
[ 96%] Built target _GLViewer
[ 96%] Building CXX object CMakeFiles/
[ 97%] Building CXX object CMakeFiles/
[ 97%] Linking CXX shared library lib/x86_
[ 99%] Built target pkg_dem
Scanning dependencies of target boot
[ 99%] Building CXX object CMakeFiles/
[100%] Linking CXX shared library lib/x86_
[100%] Built target boot
Regards,
Roxana Saghafian
_______
From: <email address hidden> <email address hidden> on behalf of Robert Caulk <email address hidden>
Sent: Wednesday, June 29, 2022 12:01 PM
To: Saghafian Larijani, Roxana (UT-ET) <email address hidden>
Subject: Re: [Question #702276]: Adding an attribute to a material
Your question #702276 on Yade changed:
https:/
Status: Open => Needs information
Robert Caulk requested more information:
Hey Roxana,
Seems you may be using the incorrect executable file. Please copy and
paste the final 20-30 lines of your compiler output here.
Cheers,
Robert
--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https:/
You received this question notification because you asked the question.
Revision history for this message
|
#9 |
Hello, these are not the final lines of installation. Please attach the final lines of make install
Thank you,
Robert
Revision history for this message
|
#10 |
Hi Robert,
I figured out the problem was because of the skew clock of my docker, and it is solved now!
Thank you!
Regards,
Roxana
_______
From: <email address hidden> <email address hidden> on behalf of Robert Caulk <email address hidden>
Sent: Friday, July 1, 2022 1:11 PM
To: Saghafian Larijani, Roxana (UT-ET) <email address hidden>
Subject: Re: [Question #702276]: Adding an attribute to a material
Your question #702276 on Yade changed:
https:/
Status: Open => Needs information
Robert Caulk requested more information:
Hello, these are not the final lines of installation. Please attach the
final lines of make install
Thank you,
Robert
--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https:/
You received this question notification because you asked the question.
Revision history for this message
|
#11 |
User solved question.