Skip to content

Commit

Permalink
Merge pull request #1683 from KratosMultiphysics/solid/Release-5.3
Browse files Browse the repository at this point in the history
correction in kratos GiDio line3nodes
  • Loading branch information
josep-m-carbonell authored Mar 15, 2018
2 parents 991395d + 78810e1 commit 4cd5e7e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def ImportModel(self):

self._add_dofs()

# Somewhere must ask if you want to clean previous files
self._clean_previous_result_files()

elif(self.settings["input_file_settings"]["type"].GetString() == "rest"):
# Import model part from restart file.
restart_path = os.path.join(problem_path, self.settings["input_file_settings"]["name"].GetString() + "__" + str(self.settings["input_file_settings"]["label"].GetInt() ) )
Expand Down Expand Up @@ -445,3 +448,17 @@ def _has_bodies(self):
if( self.settings["bodies_list"].size() > 0 ):
return True
return False

#
def _clean_previous_result_files(self):

file_endings = [".post.bin",".post.msh",".post.res",".post.lst",".post.csv",".rest"]
problem_path = os.getcwd()
for file_end in file_endings:
filelist = [f for f in os.listdir(problem_path) if f.endswith(file_end)]

for f in filelist:
try:
os.remove(f)
except WindowsError:
pass
4 changes: 2 additions & 2 deletions kratos/includes/gid_mesh_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ class GidMeshContainer
|| mGeometryType == GeometryData::Kratos_Line3D3 )
{
nodes_id[0] = (it)->GetGeometry() [0].Id();
nodes_id[1] = (it)->GetGeometry() [2].Id();
nodes_id[2] = (it)->GetGeometry() [1].Id();
nodes_id[1] = (it)->GetGeometry() [1].Id();
nodes_id[2] = (it)->GetGeometry() [2].Id();
}
nodes_id[ (it)->GetGeometry().size()]= (it)->GetProperties().Id()+1;

Expand Down

0 comments on commit 4cd5e7e

Please sign in to comment.