Coder Social home page Coder Social logo

louisepb / texgen Goto Github PK

View Code? Open in Web Editor NEW
50.0 50.0 28.0 54.87 MB

TexGen is a geometric textile modelling software package to be used for obtaining engineering properties of woven textiles and textile composites.

License: GNU General Public License v2.0

CMake 0.76% Makefile 0.56% C 28.20% MATLAB 2.34% Awk 0.01% C++ 61.83% Python 1.44% NSIS 1.62% Batchfile 0.03% HTML 1.25% CSS 0.18% Shell 0.05% Tcl 0.48% M4 0.76% Roff 0.22% Fortran 0.07% SWIG 0.19%

texgen's People

Contributors

georgespackman avatar louisepb avatar mike-matveev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

texgen's Issues

Specifiy the project's license in Gituhb repository settings

Hi!

I found there's a GPL license text in the source code (gpl.txt), but the license isn't set in Repository's settings on Github, so Github doesn't display it in the usual place on the repository's main page.
It'd be great to get it set there as well so people can easily see the license at a glance :)

endl was not declared in the scope

Hello,

I am getting the following error while compiling the make file

[ 47%] Building CXX object Core/CMakeFiles/TexGenCore.dir/AdjustMeshInterference.o In file included from /home/teja/Documents/texgen/TexGen/Core/PrecompiledHeaders.h:35:0, from /home/teja/Documents/texgen/TexGen/Core/AdjustMeshInterference.cpp:20: /home/teja/Documents/texgen/TexGen/Core/Misc.h: In function ‘void TexGen::WriteValues(std::ostream&, T&, int)’: /home/teja/Documents/texgen/TexGen/Core/Misc.h:269:15: error: ‘endl’ was not declared in this scope Output << endl;
^~~~
I am guessing it has something to do with writing endl as std::endl

3D wizard yarn spacing

3D wizard: yarn selection with 0 spacing
Can't select yarn if spacing set to 0.0 (even if width is wider and can see yarn) - check what is used in pattern dialog

However, better solution probably to change so that minimum spacing of yarn width is enforced in dialog

Outliner window doesn't update

If duplicate a yarn:
yarn = CYarn(textile.GetYarn(0))
textile.AddYarn(yarn)

the Outliner window doesn't update (yarn has been created - it's there if save and reload textile)

error when compiling minimal TexGen on Mac

Hello, I tried compiling TexGen but I got several errors after using the make command in my terminal.
I am on MacOS 14.4 with an ARM chip.

All the errors print the same text but at multiple lines in TexGen, here is one example :

TexGen/Core/OctreeVoxelMesh.cpp:73:18: error: a space is required between consecutive right angle brackets (use '> >')
vector<vector<int>> COctreeVoxelMesh::FaceX_min;
                 ^~
                 > >

Edit : After some pocking online, I found out that by adding the following line in the file TexGen/CMakeLists.txt, the cpp codes standard used to compile the code are change from C++98 to C++11. In The case of TexGen, the C++11 standard should be followed from what I see.

SET(CMAKE_CXX_STANDARD 11)

Unable to launch version 3.11.0

After installing version 3.11.0 I am unable to launch the program

  • Double clicking on the exe file shows the busy cursor for a split second, then nothing
  • Running as Administrator has the same result.
  • No error messages

System Information:
OS Name Microsoft Windows 10 Enterprise
Version 10.0.17134 Build 17134
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Name F9W85N72
System Manufacturer Dell Inc.
System Model Latitude E7450
System Type x64-based PC
System SKU 062E
Processor Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2594 Mhz, 2 Core(s), 4 Logical Processor(s)
BIOS Version/Date Dell Inc. A11, 3/29/2016
SMBIOS Version 2.8
Embedded Controller Version 255.255
BIOS Mode UEFI
BaseBoard Manufacturer Dell Inc.
BaseBoard Model Not Available
BaseBoard Name Base Board
Platform Role Mobile
Secure Boot State On
PCR7 Configuration Elevation Required to View
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\system32
Boot Device \Device\HarddiskVolume1
Locale United States
Hardware Abstraction Layer Version = "10.0.17134.858"
User Name AJNET\dchaplin
Time Zone Eastern Daylight Time
Installed Physical Memory (RAM) 8.00 GB
Total Physical Memory 7.89 GB
Available Physical Memory 2.39 GB
Total Virtual Memory 11.0 GB
Available Virtual Memory 3.69 GB
Page File Space 3.13 GB
Page File C:\pagefile.sys
Kernel DMA Protection Off
Virtualization-based security Not enabled
Device Encryption Support Elevation Required to View
Hyper-V - VM Monitor Mode Extensions Yes
Hyper-V - Second Level Address Translation Extensions Yes
Hyper-V - Virtualization Enabled in Firmware Yes
Hyper-V - Data Execution Protection Yes

TexGen Capabilities

Hello,

I'm a composites research engineer and am in need of elastic properties for a UD composite. The only experimental data I have is for an 8HS composite, of the same materials, will TexGen be able to "estimate" (even if very roughly) the UD properties from a woven RVE? Just wanted to ask before I took the time to download, learn the software, and then find out that it is not capable of doing so.

Best,
Allison

NSERP models crash

Check why models from NSERP knitting project crash - work in version 3.9.0

GCC warnings on linux

When compiling version on Ubuntu, 3 warnings are given. Ideally code can be adapted to avoid these warnings. Probably not a big issue however:

[ 80%] Building CXX object Core/CMakeFiles/TexGenCore.dir/SimulationAbaqus.o
/media/benny/hd2/datahd2/git/TexGen/Core/SimulationAbaqus.cpp: In member function ‘virtual std::vector& TexGen::CKeywordMaterial::GetConstants()’:
/media/benny/hd2/datahd2/git/TexGen/Core/SimulationAbaqus.cpp:1146:17: warning: reference to local variable ‘Constants’ returned [-Wreturn-local-addr]
vector Constants;

[ 83%] Building CXX object Core/CMakeFiles/TexGenCore.dir/TetgenMesh.o
/media/benny/hd2/datahd2/git/TexGen/Core/TetgenMesh.cpp: In member function ‘void TexGen::CTetgenMesh::SaveTetgenMesh(TexGen::CTextile&, std::__cxx11::string, std::__cxx11::string, bool)’:
/media/benny/hd2/datahd2/git/TexGen/Core/TetgenMesh.cpp:339:36: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
tetrahedralize("d", &m_in, &m_out);

[ 97%] Building C object Core/CMakeFiles/TexGenCore.dir/__/units/units.o
/media/benny/hd2/datahd2/git/TexGen/units/units.c: In function ‘reduceUnit’:
/media/benny/hd2/datahd2/git/TexGen/units/units.c:541:11: warning: implicit declaration of function ‘isspace’ [-Wimplicit-function-declaration]
while ( isspace(*unitString) ) unitString++;

Dialog Box Too Small

Hello,

I am trying to assign matrix and yarn properties on TexGen v3.12.2, but the dialog boxes are so small that I can't even use them. Is there a way to make them bigger? Some dialog boxes have are adjustable by dragging the bottom right corner, but that is not the case with these.

Thanks

Update render option

Add option and/or key press to re-render without having to turn specific render off and on again

Typing error in Abaqus voxel file

There is a bug in TexGen v3.10.0 (and possible in 3.11.0 - I can't run it), which happens when user exports Abaqus voxel file. There is a block in the file which contains constraint equations. One string in there has a typing error in the name of of the node set ConstraintsDriver2. There is an unnecessary space symbol.

Constraints Driver2

Abaqus solver somehow doesn't react to this error and doesn't put any error messages. This error appears only once in the file.

Surface constacts

Hi, I am importing a texgen dry fibre geometry into Abaqus for analysis. The upper and lower contact surfaces seems to have been created as sown in the .inp file however, the contacts are not shown in Abaqus interaction properties section. What could be the reason? Thanks
AqWeaveGeo2.zip

2D weave refine bug

Generation of 2D weave with refine causes crash with parameters:
Spacing = 0.00045
Width = 0.00035
Thickness = 0.000289

Documentation to compile from source is out of date for current version of texgen

https://texgen.sourceforge.io/index.php/Compiling_from_Source

Documentation out of date for current version:

  • I assume instead of Python 2.7, Python 3 is now required.
  • Is the SWIG install still version 4.0.0
    (although not for the initial build):
  • What specifically should be installed from OpenCascade because the link is broken: https://dev.opencascade.org/getocc/download
  • Is version 6.3 of VTK still the version to use
  • Is ver 3.0.4 of wxWidgets (wxMSW) still used (I see it is possible to get this from their github)
  • Does the cpp unit test version matter?

Values of effective shear moduli G13 and G23 are swapped

There are bugs in TexGen's part of code that generates Abaqus voxel file and in the Python script for calculating effective RVE properties, which together result in swapping values of the effective shear moduli G13 and G23. The bug exists in TexGen v3.10.0 (and possible in 3.11.0 - I still can't run it).

To watch the bug you have to create any Abaqus voxel file through TexGen, and then make some modifications to the *.inp file:

  1. Create an orthotropic material with apparent properties, for example:
    E1 = 1111
    E2 = 2222
    E3 = 3333
    G12 = 1212
    G13 = 1313
    G23 = 2323
    nu12 = 0.1212
    nu13 = 0.1313
    nu23 = 0.2323
  2. Create a local coordinate system for material orientation with axes parallel to the global axes.
  3. Create a solid section that references to the new material and to the new coordinate system and assign it to all elements.
  4. Clear old orientation, section and material data from the model.

Now the model in the *.inp file is just a rectangular brick of material with apparent properties and orientation aligned with the global axes. I attach an example of such file below for your convenience (please change file extension from *.txt to *.inp).

VoxelContinuumTest.txt

Run Abaqus solver and then run the postprocessing script effectiveMatPropRVE.py. The result is:

effective properties

EXPLANATION WHY THIS HAPPENS

First of all, we meet a "rule" in the *.inp file which states:

************************************
*** PERIODIC BOUNDARY CONDITIONS ***
************************************
*** ConstraintsDriver0 = e_x
*** ConstraintsDriver1 = e_y
*** ConstraintsDriver2 = e_z
*** ConstraintsDriver3 = e_xy
*** ConstraintsDriver4 = e_xz
*** ConstraintsDriver5 = e_yz

Let's memorize that 5th node set ConstraintsDriver4 is responsible for shear 13 and 6th node set ConstraintsDriver5 is for shear 23. Next we go to the output request section, and there we see the following:

***********************
*** OUTPUT REQUESTS ***
***********************
*Output, field
*Element Output, directions=YES
S,
*** FIELD OUTPUT: Output Request Fx ***
*Node Output, nset=ConstraintsDriver0
U,
*** FIELD OUTPUT: Output Request Fy ***
*Node Output, nset=ConstraintsDriver1
U,
*** FIELD OUTPUT: Ouput Request Fz ***
*Node Output, nset=ConstraintsDriver2
U,
*** FIELD OUTPUT: Output Request Shear_xy ***
*Node Output, nset=ConstraintsDriver3
U,
*** FIELD OUTPUT: Output Request Shear_yz ***
*Node Output, nset=ConstraintsDriver5
U,
*** FIELD OUTPUT: Output Request Shear_zx ***
*Node Output, nset=ConstraintsDriver4
U,

Pay attention to the two last requests. Their order is reversed. The order of output requests is very important, as the results in each load case will be saved to the output database in sequential order. There won't be any comments or node set names, so a postprocessing program must know what constraint driver each result corresponds to. Let's memorize that despite the "rule" above, 5th result in each load case corresponds to the displacement of the constraint driver responsible for shear 23, and 6th result corresponds to the displacement of the constraint driver responsible for shear 13.

Load cases order is important too, because the results will be saved to the output database as sequential frames. Here we have:

*Load Case, name=Load4
*Boundary, op=NEW
MasterNode1, 1, 1
MasterNode1, 2, 2
MasterNode1, 3, 3
*Cload
ConstraintsDriver4, 1, 0.88
*End Load Case

*Load Case, name=Load5
*Boundary, op=NEW
MasterNode1, 1, 1
MasterNode1, 2, 2
MasterNode1, 3, 3
*Cload
ConstraintsDriver5, 1, 0.88
*End Load Case

As one can see, load case order is in agreement with the "rule" above, i.e. 5th load case (subsequently 5th frame) is shear 13 and 6th load case (subsequently 6th frame) is shear 23.

Now let's move to the postprocessing script dataHandling.py to see frame extraction.

	# 5 holds the Shear_yz load-case.
	frameShear_yz = resultODB.steps[isothermalStep.name].frames[5]
	# 6 holds the Shear_zx load-case.
	frameShear_zx = resultODB.steps[isothermalStep.name].frames[6]

And here is first error: 5th frame holds shear 13, not shear 23. In its turn frame number 6 contains results for shear 23 load case. The next piece of code extracts displacements of the constraint drivers from swapped frames:

	# Load case Shear_yz.
	Shear_yz_gamma0_yz = frameShear_yz.fieldOutputs['U'].values[5].data[0]
	
	# Load case Shear_zx.
	Shear_zx_gamma0_zx = frameShear_zx.fieldOutputs['U'].values[4].data[0]

As mentioned above the results order in each frame doesn't agree with the "rule", therefore these lines of code by accident don't cause an error. It's obvious that Shear_yz_gamma0_yz now contains displacements of ConstraintsDriver4, which as we know corresponds to shear 13. And the value of Shear_zx_gamma0_zx is the displacement of ConstraintsDriver5, in other words shear 23.

As a result, the values of shear moduli G13 and G23 are now swapped.

HOW TO FIX THE BUG

  1. In the input file modify output requests order:
***********************
*** OUTPUT REQUESTS ***
***********************
*Output, field
*Element Output, directions=YES
S,
*** FIELD OUTPUT: Output Request Fx ***
*Node Output, nset=ConstraintsDriver0
U,
*** FIELD OUTPUT: Output Request Fy ***
*Node Output, nset=ConstraintsDriver1
U,
*** FIELD OUTPUT: Ouput Request Fz ***
*Node Output, nset=ConstraintsDriver2
U,
*** FIELD OUTPUT: Output Request Shear_xy ***
*Node Output, nset=ConstraintsDriver3
U,
*** FIELD OUTPUT: Output Request Shear_zx ***
*Node Output, nset=ConstraintsDriver4
U,
*** FIELD OUTPUT: Output Request Shear_yz ***
*Node Output, nset=ConstraintsDriver5
U,
  1. In the dataHandling.py file modify frames extraction:
	# 5 holds the Shear_zx load-case.
	frameShear_zx = resultODB.steps[isothermalStep.name].frames[5]
	# 6 holds the Shear_yz load-case.
	frameShear_yz = resultODB.steps[isothermalStep.name].frames[6]
  1. In the dataHandling.py file reorder strings for displacements extraction:
	# Load case Shear_zx.
	Shear_zx_gamma0_zx = frameShear_zx.fieldOutputs['U'].values[4].data[0]

	# Load case Shear_yz.
	Shear_yz_gamma0_yz = frameShear_yz.fieldOutputs['U'].values[5].data[0]

Now everything is OK.

Best regards,
Mikhail Kozlov

Volume mesh crash

Create volume mesh crashes on SinglePly.py (in UserQueries)
Probably because domain selected isn't periodic but still shouldn't crash

TexGen crashing

An unstable behaviour was observed when retrieving information from yarns for a grid of points using multiple nested loops in Python. More specifically using the functions: PointInsideYarn() and GetSlaveNodes(). This seems to occur for any textile.

Below is an example python code for a simple plain weave:

#----------------------------------------------------------------------------------------------------------

Example model generation:

numOfWarp, numOfWeft, yarnWidth, yarnSpacings, thickness, patternMatrix=2, 2, 2.97, 3.14, 0.62375, [[0,1],[1,0]]

weave = CTextileWeave2D(numOfWarp, numOfWeft, yarnSpacings, thickness, True, True)
weave.SetGapSize(0)
weave.SetYarnWidths(yarnWidth)
for i in range(numOfWarp):
for j in range(numOfWeft):
if patternMatrix[i][j]==1:
weave.SwapPosition(i,j)

for i in range(numOfWarp):
weave.SetXYarnWidths(i, yarnWidth)
weave.SetXYarnHeights(i, thickness/2)
weave.SetXYarnSpacings(i, yarnSpacings)

for j in range(numOfWarp):
weave.SetYYarnWidths(j, yarnWidth)
weave.SetYYarnHeights(j, thickness/2)
weave.SetYYarnSpacings(j, yarnSpacings)

domSizeX=yarnSpacingsnumOfWeft
domSizeY=yarnSpacings
numOfWarp
weave.AssignDefaultDomain()
textilename = AddTextile(weave)
domain = CDomainPlanes()
domain.AddPlane(PLANE(XYZ(1, 0, 0), -domSizeX/2))
domain.AddPlane(PLANE(XYZ(-1, 0, 0), -domSizeY/2))
domain.AddPlane(PLANE(XYZ(0, 1, 0), -domSizeY/2))
domain.AddPlane(PLANE(XYZ(0, -1, 0), -domSizeY/2))
domain.AddPlane(PLANE(XYZ(0, 0, 1), 0))
domain.AddPlane(PLANE(XYZ(0, 0, -1), -thickness))
GetTextile('2DWeave(W:%i,H:%i)' % (numOfWarp,numOfWeft)).AssignDomain(domain)
#Code for retrieving information:
xstart, xend, ystart, yend, zstart, zend = -domSizeX/2, domSizeX/2, -domSizeY/2, domSizeY/2, 0.0, thickness
num=50 #point grid resolution
xstep=(xend-xstart)/num
ystep=(yend-ystart)/num
zstep=(zend-zstart)/num
xarray=[xstart+i * xstep for i in range(num)]
yarray=[ystart+i * ystep for i in range(num)]
zarray=[zstart+i * zstep for i in range(num)]

point_vector=XYZVector()
for x in xarray:
for y in yarray:
for z in zarray:
point_vector.push_back(XYZ(x,y,z))

Textile=GetTextile()
Yarns=Textile.GetYarns()

for point in point_vector:
for yarn in Yarns:
if yarn.PointInsideYarn(point):
Tangent=XYZ()
Loc=XY()
VolumeFraction=None
DistanceToSurface=None
Tolerance=1e-9
Orientation=XYZ()
data=yarn.PointInsideYarn(point,Tangent,Loc,VolumeFraction, DistanceToSurface, Tolerance, Orientation)
slave_nodes=yarn.GetSlaveNodes(0)
slave_nodes_vector=XYZVector()
for node in slave_nodes:
slave_nodes_vector.push_back(node.GetPosition())
else:
continue

Orthogonal edit

When edit orthogonal weave gets yarn height incorrect for warp and weft yarns.
Edit textile doesn't always change size of yarns when change in edit boxes (seems to change if use pattern control) - see notes 13/6/19
3DOrthogonal.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.