Skip to content

Commit

Permalink
Merge branch 'master' into arte-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
anaegel authored Jul 11, 2024
2 parents 7fa4404 + 9a75dc9 commit 317720d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 138 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/jenkins-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
name: Trigger Jenkins CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel

jobs:
# This workflow contains a single job called "build"
build:
name: Build
trigger-jenkins-job:
runs-on: ubuntu-latest
steps:
- name: Trigger jenkins job
uses: anaegel/jenkins-githubaction@master
- id: triggerjenkinsjob
uses: mickeygoussetorg/trigger-jenkins-job@v1
with:
url: ${{ secrets.JENKINS_URL }}
job_name: ug-build-pipeline
username: ${{ secrets.JENKINS_USER }}
api_token: ${{ secrets.JENKINS_TOKEN }}
timeout: "3600"
interval: "300"
jenkins-server: ${{ secrets.JENKINS_URL }} # URL of the jenkins server. ex: http://myjenkins.acme.com:8080
jenkins-job: "ug-build-pipeline" # The name of the jenkins job to run
jenkins-username: ${{ secrets.JENKINS_USER }} # user name for accessing jenkins
jenkins-pat: ${{ secrets.JENKINS_TOKEN }} # personal Access token for accessing Jenkins
poll-time: 90 # how often (seconds) to poll the jenkins server for results
timeout-value: 3600 # How long (seconds) to poll before timing out the action
verbose: true # true/false - turns on extra logging
4 changes: 2 additions & 2 deletions scripts/shell/schedulers/pbs-generic
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function UJS_Submit


# PBSnodes="-l select=$nnodes:node_type=rome:mpiprocs=$nppn"
PBSnodes=""
PBSnodes="-l select=$nnodes:ncpus=$nppn:mpiprocs=$nppn"


if [ -z "$queue" ]; then
Expand Down Expand Up @@ -82,7 +82,7 @@ function UJS_Submit
exit
fi
jobid=`echo $jobid | sed 's/\([0-9]*\).*/\1/'`
fi
fi
}


Expand Down
11 changes: 1 addition & 10 deletions ugbase/bridge/grid_bridges/file_io_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "lib_grid/multi_grid.h"
#include "lib_grid/file_io/file_io.h"
#include "lib_grid/file_io/file_io_ugx.h"
#include "lib_grid/file_io/file_io_vtu.h"

using namespace std;

Expand Down Expand Up @@ -78,13 +77,6 @@ bool SaveGridHierarchy(MultiGrid& mg, const char* filename)
return SaveGridToFile(mg, mg.get_hierarchy_handler(), filename);
}

void SetVTURegionOfInterestIdentifier( char const * regOfInt )
{
PROFILE_FUNC_GROUP("grid");
GridReaderVTU::setRegionOfInterestIdentifier( std::string( regOfInt ) );
return;
}


void RegisterGridBridge_FileIO(Registry& reg, string parentGroup)
{
Expand Down Expand Up @@ -137,8 +129,7 @@ void RegisterGridBridge_FileIO(Registry& reg, string parentGroup)
.add_function("SaveParallelGridLayout", &SaveParallelGridLayout,
grp, "", "mg#filename#offset")
.add_function("SaveSurfaceViewTransformed", &SaveSurfaceViewTransformed)
.add_function("SaveGridLevelToFile", &SaveGridLevelToFile)
.add_function("SetVTURegionOfInterestIdentifier", static_cast<void (*)(char const *)>(&SetVTURegionOfInterestIdentifier) );
.add_function("SaveGridLevelToFile", &SaveGridLevelToFile);
}

}// end of namespace
Expand Down
100 changes: 1 addition & 99 deletions ugbase/lib_grid/file_io/file_io_vtu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
*/

#include "file_io_vtu.h"
#include <string>
#include <iostream>

using namespace std;
using namespace rapidxml;
Expand Down Expand Up @@ -413,8 +411,7 @@ GridReaderVTU::~GridReaderVTU()
{
}

#if 0
// original function

bool GridReaderVTU::
parse_file(const char* filename)
{
Expand Down Expand Up @@ -445,81 +442,6 @@ parse_file(const char* filename)
// notify derived classes that a new document has been parsed.
return new_document_parsed();
}
#else

bool GridReaderVTU::
parse_file(const char* filename)
{
ifstream in(filename, ios::binary);
if(!in)
return false;

m_filename = filename;

// get the length of the file
streampos posStart = in.tellg();
in.seekg(0, ios_base::end);
streampos posEnd = in.tellg();
streamsize size = posEnd - posStart;

// go back to the start of the file
in.seekg(posStart);

char * fileContentOriginal = new char[size + 1];

in.read(fileContentOriginal,size);
fileContentOriginal[size] = 0;
in.close();

std::string fiCo2Str(fileContentOriginal);

delete [] fileContentOriginal;
fileContentOriginal = NULL;

std::string regInf("RegionInfo");

if ( fiCo2Str.find(regInf) == std::string::npos && fiCo2Str.find(m_regionOfInterest) != std::string::npos )
{
// we need to insert the additional string

std::string regInfLines;

regInfLines.append( "\n<RegionInfo Name=\"" );

regInfLines.append( m_regionOfInterest );

regInfLines.append("\">\n");

regInfLines.append( "</RegionInfo>" );

std::string insAft( "</CellData>" );

size_t cedava = fiCo2Str.find( insAft );

if( cedava == std::string::npos )
return false;

size_t insVal = cedava + insAft.size();

fiCo2Str.insert( insVal, regInfLines );

}

char* fileContent = m_doc.allocate_string(0, fiCo2Str.size() );

strcpy(fileContent, fiCo2Str.c_str());


// parse the xml-data
m_doc.parse<0>(fileContent);

// notify derived classes that a new document has been parsed.
return new_document_parsed();
}

#endif



bool GridReaderVTU::
new_document_parsed()
Expand All @@ -539,7 +461,6 @@ new_document_parsed()
m_entries.push_back(GridEntry(curNode));
GridEntry& gridEntry = m_entries.back();


// collect associated subset handlers
xml_node<>* curSHNode = curNode->first_node("RegionInfo");
while(curSHNode){
Expand Down Expand Up @@ -648,14 +569,6 @@ subset_handler(ISubsetHandler& shOut,
vector<int> subsetIndices;
read_scalar_data(subsetIndices, regionDataNode, true);

if( subsetIndices.size() != cells.size() )
{
vector<double> subsetIndicesDbl;
read_scalar_data(subsetIndicesDbl, regionDataNode, true);

trafoDblVec2Int( subsetIndicesDbl, subsetIndices );
}

UG_COND_THROW(subsetIndices.size() != cells.size(),
"Mismatch regarding number of cells and number of region-indices!");

Expand Down Expand Up @@ -859,17 +772,6 @@ create_cells(std::vector<GridObject*>& cellsOut,
return true;
}

void GridReaderVTU::
trafoDblVec2Int( std::vector<double> const & dblVec, std::vector<int> & intVec )
{
intVec = std::vector<int>();

for( auto d : dblVec )
{
intVec.push_back( static_cast<int>( d ) );
}
}


xml_node<>* GridReaderVTU::
find_child_node_by_argument_value(rapidxml::xml_node<>* parent,
Expand Down
10 changes: 0 additions & 10 deletions ugbase/lib_grid/file_io/file_io_vtu.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,6 @@ class GridReaderVTU
size_t refGridIndex,
size_t subsetHandlerIndex);

static std::string const getRegionOfInterestIdentifyer()
{ return m_regionOfInterest; }

static void setRegionOfInterestIdentifier( std::string const & regOfInt )
{ m_regionOfInterest = regOfInt; }

protected:
struct SubsetHandlerEntry
{
Expand Down Expand Up @@ -275,8 +269,6 @@ class GridReaderVTU
rapidxml::xml_node<>* dataNode,
bool clearData = true);

void trafoDblVec2Int( std::vector<double> const & dblVec, std::vector<int> & intVec );

template <class T>
void check_indices(std::vector<T>& inds, size_t first, size_t num, size_t max);

Expand All @@ -295,8 +287,6 @@ class GridReaderVTU
/// holds grids which already have been created
std::vector<GridEntry> m_entries;



static std::string m_regionOfInterest; // ProMesh standard = "regions", in Braunschweig case often "Material Id", but not always

};
Expand Down
10 changes: 6 additions & 4 deletions ugbase/lib_grid/tools/creator_grid_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ namespace ug{
////////////////////////////////////////////////////////////////////////
/**
* To Create GridObject directly under UG4-C++
* instead of ProMesh
* instead of ProMesh:
*
* Functions are copied from plugins/ProMesh/tools/grid_generation_tools.cpp
*/
template<typename TPosition>
Vertex* CreateVertex(Grid& grid,const TPosition& pos,Grid::VertexAttachmentAccessor<Attachment<TPosition> >& aaPos )
Expand All @@ -56,7 +58,7 @@ Vertex* CreateVertex(Grid& grid,const TPosition& pos,Grid::VertexAttachmentAcces



Edge* CreateEdge(Grid& grid, Vertex* vrts[], const size_t, numVrts){
Edge* CreateEdge(Grid& grid, Vertex* vrts[], const size_t numVrts){
//uniquify vrts by hash_value: no
//The vrts can't be simply uniquified by hash_values since it will change the orientation of vrts.
// Hence,it should be generated by aaPos before using this function.
Expand Down Expand Up @@ -144,7 +146,7 @@ Face* CreateFace(Grid& grid, Vertex* vrts[], const size_t numVrts){
//return CreateFace(grid, avrts, numVrts);
}*/

Volume* CreateVolume(Grid& grid, Vertex* vrts, const size_t numVrts){
Volume* CreateVolume(Grid& grid, Vertex* vrts[], const size_t numVrts){
//if(numVrts < 4 || numVrts > 8){
UG_ASSERT(numVrts>3 || numVrts<9,"Bad number of vertices! Can't create a volume element from " << numVrts << " vertices.");

Expand Down Expand Up @@ -209,7 +211,7 @@ void CreatePlane(Grid& grid,
const TPosition& upRight,
const TPosition& lowLeft,
const TPosition& lowRight,
Grid::VertexAttachmentAccessor<Attachment<TPosition> >& aaPos
Grid::VertexAttachmentAccessor<Attachment<TPosition> >& aaPos,
bool fill)
{
Vertex* vrts[4];
Expand Down

0 comments on commit 317720d

Please sign in to comment.