Skip to content
Snippets Groups Projects
Select Git revision
  • e78659487ada24bcd8bf67c5a21a7b25490c6a50
  • master default protected
  • alphashapes
  • quadMeshingTools
  • cygwin_conv_path
  • macos_arm64
  • add-transfiniteautomatic-to-geo
  • patch_releases_4_10
  • HierarchicalHDiv
  • isuruf-master-patch-63355
  • hyperbolic
  • hexdom
  • hxt_update
  • jf
  • 1618-pythonocc-and-gmsh-api-integration
  • octreeSizeField
  • hexbl
  • alignIrregularVertices
  • getEdges
  • patch_releases_4_8
  • isuruf-master-patch-51992
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
  • gmsh_4_8_4
  • gmsh_4_8_3
  • gmsh_4_8_2
  • gmsh_4_8_1
  • gmsh_4_8_0
  • gmsh_4_7_1
  • gmsh_4_7_0
41 results

OptHomRun.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    OptHomRun.cpp 22.30 KiB
    // Copyright (C) 2013 ULg-UCL
    //
    // Permission is hereby granted, free of charge, to any person
    // obtaining a copy of this software and associated documentation
    // files (the "Software"), to deal in the Software without
    // restriction, including without limitation the rights to use, copy,
    // modify, merge, publish, distribute, and/or sell copies of the
    // Software, and to permit persons to whom the Software is furnished
    // to do so, provided that the above copyright notice(s) and this
    // permission notice appear in all copies of the Software and that
    // both the above copyright notice(s) and this permission notice
    // appear in supporting documentation.
    //
    // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    // NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE
    // COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR
    // ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
    // DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
    // ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
    // OF THIS SOFTWARE.
    //
    // Please report all bugs and problems to the public mailing list
    // <gmsh@geuz.org>.
    //
    // Contributors: Thomas Toulorge, Jonathan Lambrechts
    
    #include <stdio.h>
    #include <sstream>
    #include <iterator>
    #include <string.h>
    #include "GmshConfig.h"
    #include "OptHOM.h"
    #include "OptHomRun.h"
    #include "GModel.h"
    #include "Gmsh.h"
    #include "MTriangle.h"
    #include "MQuadrangle.h"
    #include "MTetrahedron.h"
    #include "MHexahedron.h"
    #include "MPrism.h"
    #include "MLine.h"
    #include "OS.h"
    #include <stack>
    
    #if defined(HAVE_BFGS)
    
    double distMaxStraight(MElement *el)
    {
      const polynomialBasis *lagrange = (polynomialBasis*)el->getFunctionSpace();
      const polynomialBasis *lagrange1 = (polynomialBasis*)el->getFunctionSpace(1);
      int nV = lagrange->points.size1();
      int nV1 = lagrange1->points.size1();
      SPoint3 sxyz[256];
      for (int i = 0; i < nV1; ++i) {
        sxyz[i] = el->getVertex(i)->point();
      }
      for (int i = nV1; i < nV; ++i) {
        double f[256];
        lagrange1->f(lagrange->points(i, 0), lagrange->points(i, 1),
                     lagrange->points(i, 2), f);
        for (int j = 0; j < nV1; ++j)
          sxyz[i] += sxyz[j] * f[j];
      }
    
      double maxdx = 0.0;
      for (int iV = nV1; iV < nV; iV++) {
        SVector3 d = el->getVertex(iV)->point()-sxyz[iV];